vasile eugen Posted May 29, 2017 Share Posted May 29, 2017 Salutare.Am acest afisor la care am incercat mai multe exemple.Am reusit sa il comand cu codul de aici: http://q61.org/en/chibimo/build/chibimofw_20110212.txt saitul cu date este aici: http://q61.org/en/chibimo/build/ Intrebarea mea este cum imi pot da seama ce librarie foloseste? Link to comment
Liviu M Posted May 29, 2017 Share Posted May 29, 2017 La cum arata, nu foloseste nici o biblioteca, si-a scris singur toate functiile care-i trebuie. Link to comment
vasile eugen Posted May 29, 2017 Author Share Posted May 29, 2017 Am reusit sub forma aceasta: U8GLIB_KS0108_128 u8g(2, 3, 4, 5, 6, 7, 8, 9, A5, 11, 12, A3, A4); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=5, cs1=11, cs2=12,di=A3,rw=4 Dupa cum am citit cred ca este functionare pe 8 biti si libraria de la KS0108 Link to comment
MifTy Posted May 30, 2017 Share Posted May 30, 2017 Salutare.Am acest afisor la care am incercat mai multe exemple.Am reusit sa il comand cu codul de aici: http://q61.org/en/chibimo/build/chibimofw_20110212.txt saitul cu date este aici: http://q61.org/en/chibimo/build/ Intrebarea mea este cum imi pot da seama ce librarie foloseste? pe ultimul link scrie, când vorbeşte de ecran: Any LCD that has a resolution of 128 x 64 and that is "compatible with KS0108" will do. You may choose negative LCDs as well. deloc de mirare că a mers cu u8glib, care "ştie" deja cum să comande un ecran cu chipset KS0108 sau echivalent... Link to comment
vasile eugen Posted May 30, 2017 Author Share Posted May 30, 2017 Acesta este codul. /* PrintTest.pde How to use the base class "Print" >>> Before compiling: Please remove comment from the constructor of the >>> connected graphics display (see below). Universal 8bit Graphics Library, http://code.google.com/p/u8glib/ Copyright (c) 2012, [email protected] All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "U8glib.h" // setup u8g object, please remove comment from one of the following constructor calls // IMPORTANT NOTE: The following list is incomplete. The complete list of supported // devices with all constructor calls is here: http://code.google.com/p/u8glib/wiki/device //U8GLIB_NHD27OLED_BW u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_NHD27OLED_2X_BW u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_NHD27OLED_GR u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_NHD27OLED_2X_GR u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_NHD31OLED_BW u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_NHD31OLED_2X_BW u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_NHD31OLED_GR u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_NHD31OLED_2X_GR u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_DOGS102 u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_DOGM132 u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_DOGM128 u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_DOGM128_2X u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_ST7920_128X64_1X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16 //U8GLIB_ST7920_128X64_4X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16 //U8GLIB_ST7920_128X64_1X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17 //U8GLIB_ST7920_128X64_4X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17 //U8GLIB_ST7920_192X32_1X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16 //U8GLIB_ST7920_192X32_4X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16 //U8GLIB_ST7920_192X32_1X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17 //U8GLIB_ST7920_192X32_4X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17 //U8GLIB_ST7920_192X32_1X u8g(13, 11, 10); // SPI Com: SCK = en = 13, MOSI = rw = 11, CS = di = 10 //U8GLIB_ST7920_192X32_4X u8g(10); // SPI Com: SCK = en = 13, MOSI = rw = 11, CS = di = 10, HW SPI //U8GLIB_ST7920_202X32_1X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16 //U8GLIB_ST7920_202X32_4X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16 //U8GLIB_ST7920_202X32_1X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17 //U8GLIB_ST7920_202X32_4X u8g(18, 16, 17); // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17 //U8GLIB_LM6059 u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_LM6063 u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_DOGXL160_BW u8g(10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_DOGXL160_GR u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_DOGXL160_2X_BW u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_DOGXL160_2X_GR u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_PCD8544 u8g(13, 11, 10, 9, 8); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9, Reset = 8 //U8GLIB_PCF8812 u8g(13, 11, 10, 9, 8); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9, Reset = 8 //U8GLIB_KS0108_128 u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 14, 15, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, cs1=14, cs2=15,di=17,rw=16 //U8GLIB_LC7981_160X80 u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 14, 15, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, cs=14 ,di=15,rw=17, reset = 16 //U8GLIB_LC7981_240X64 u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 14, 15, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, cs=14 ,di=15,rw=17, reset = 16 //U8GLIB_LC7981_240X128 u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 14, 15, 17, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, cs=14 ,di=15,rw=17, reset = 16 //U8GLIB_ILI9325D_320x240 u8g(18,17,19,U8G_PIN_NONE,16 ); // 8Bit Com: D0..D7: 0,1,2,3,4,5,6,7 en=wr=18, cs=17, rs=19, rd=U8G_PIN_NONE, reset = 16 //U8GLIB_SBN1661_122X32 u8g(8,9,10,11,4,5,6,7,14,15, 17, U8G_PIN_NONE, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 cs1=14, cs2=15,di=17,rw=16,reset = 16 //U8GLIB_SSD1306_128X64 u8g(13, 11, 10, 9); // SW SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_SSD1306_128X64 u8g(10, 9); // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are SCK = 13 and MOSI = 11) //U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE); // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are SCK = 13 and MOSI = 11) //U8GLIB_SSD1306_128X32 u8g(13, 11, 10, 9); // SW SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_SSD1306_128X32 u8g(10, 9); // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are SCK = 13 and MOSI = 11) //U8GLIB_SSD1306_128X32 u8g(U8G_I2C_OPT_NONE); // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are SCK = 13 and MOSI = 11) //U8GLIB_SSD1309_128X64 u8g(13, 11, 10, 9); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9 //U8GLIB_SSD1327_96X96_GR u8g(U8G_I2C_OPT_NONE); // I2C //U8GLIB_SSD1327_96X96_2X_GR u8g(U8G_I2C_OPT_NONE); // I2C //U8GLIB_NHD_C12864 u8g(13, 11, 10, 9, 8); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9, RST = 8 //U8GLIB_NHD_C12832 u8g(13, 11, 10, 9, 8); // SPI Com: SCK = 13, MOSI = 11, CS = 10, A0 = 9, RST = 8 //U8GLIB_T6963_240X128 u8g(8, 9, 10, 11, 4, 5, 6, 7, 14, 15, 17, 18, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7, cs=14, a0=15, wr=17, rd=18, reset=16 //U8GLIB_T6963_240X64 u8g(8, 9, 10, 11, 4, 5, 6, 7, 14, 15, 17, 18, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7, cs=14, a0=15, wr=17, rd=18, reset=16 //U8GLIB_T6963_128X64 u8g(8, 9, 10, 11, 4, 5, 6, 7, 14, 15, 17, 18, 16); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7, cs=14, a0=15, wr=17, rd=18, reset=16 //U8GLIB_HT1632_24X16 u8g(3, 2, 4); // WR = 3, DATA = 2, CS = 4 //U8GLIB_SSD1351_128X128_332 u8g(13, 11, 8, 9, 7); // Arduino UNO: SW SPI Com: SCK = 13, MOSI = 11, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx) //U8GLIB_SSD1351_128X128_332 u8g(76, 75, 8, 9, 7); // Arduino DUE: SW SPI Com: SCK = 13, MOSI = 11, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx) //U8GLIB_SSD1351_128X128_332 u8g(8, 9, 7); // Arduino: HW SPI Com: SCK = 13, MOSI = 11, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx) //U8GLIB_SSD1351_128X128_4X_332 u8g(76, 75, 8, 9, 7); // Arduino DUE: SW SPI Com: SCK = 13, MOSI = 11, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx) //U8GLIB_SSD1351_128X128_4X_332 u8g(8, 9, 7); // Arduino : HW SPI Com: SCK = 13, MOSI = 11, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx) //U8GLIB_SSD1351_128X128_HICOLOR u8g(76, 75, 8, 9, 7); // Arduino DUE, SW SPI Com: SCK = 76, MOSI = 75, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx) //U8GLIB_SSD1351_128X128_HICOLOR u8g(8, 9, 7); // Arduino, HW SPI Com: SCK = 76, MOSI = 75, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx) //U8GLIB_SSD1351_128X128_4X_HICOLOR u8g(76, 75, 8, 9, 7); // Arduino DUE, HW SPI Com, 4x Memory: SCK = 76, MOSI = 75, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx) //U8GLIB_SSD1351_128X128_4X_HICOLOR u8g(8, 9, 7); // Arduino, HW SPI Com, 4x Memory: SCK = 76, MOSI = 75, CS = 8, A0 = 9, RESET = 7 (http://electronics.ilsoft.co.uk/ArduinoShield.aspx) //U8GLIB_SSD1351_128X128GH_332 u8g(8, 9, 7); // Arduino, HW SPI Com: SCK = 76, MOSI = 75, CS = 8, A0 = 9, RESET = 7 (Freetronics OLED) //U8GLIB_SSD1351_128X128GH_HICOLOR u8g(8, 9, 7); // Arduino, HW SPI Com: SCK = 76, MOSI = 75, CS = 8, A0 = 9, RESET = 7 (Freetronics OLED) U8GLIB_KS0108_128 u8g(2, 3, 4, 5, 6, 7, 8, 9, A5, 11, 12, A3, A4); void draw(void) { // graphic commands to redraw the complete screen should be placed here u8g.setFont(u8g_font_unifont); u8g.setPrintPos(0, 20); // call procedure from base class, http://arduino.cc/en/Serial/Print u8g.print("Vasile eugen"); } void setup(void) { // flip screen, if required // u8g.setRot180(); } void loop(void) { // picture loop u8g.firstPage(); do { draw(); } while( u8g.nextPage() ); // rebuild the picture after some delay delay(500); } Vreu sa implementez un ceas si un senzor presiune sau umiditate.Incerc sa vad acum,pornind de la alte exemple. Link to comment
vasile eugen Posted May 31, 2017 Author Share Posted May 31, 2017 Am reusit sub forma aceasta: U8GLIB_KS0108_128 u8g(2, 3, 4, 5, 6, 7, 8, 9, A5, 11, 12, A3, A4); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=5, cs1=11, cs2=12,di=A3,rw=4 Dupa cum am citit cred ca este functionare pe 8 biti si libraria de la KS0108 Ca sa am pini liberi la arduino uno,acest afisor se poate comanda si altfel decit am trecut mai sus? Link to comment
nico_2010 Posted May 31, 2017 Share Posted May 31, 2017 Da, insa este un pic mai complicat. Trebuie sa folosesti C.I. MCP23017(018) sau MCP 23S17(18), ambele expandere pe 16 biti, porturi bidirectionale cu comanda I2C sau SPI (cele care au litera S). Link to comment
vasile eugen Posted May 31, 2017 Author Share Posted May 31, 2017 Da, insa este un pic mai complicat. Trebuie sa folosesti C.I. MCP23017(018) sau MCP 23S17(18), ambele expandere pe 16 biti, porturi bidirectionale cu comanda I2C sau SPI (cele care au litera S). Mersi,am vazut un tutorial cu asa ceva. Am sa incerc sa mut iesirile de pe A4 si A5 .Un DS3231 incerc sa implementez. Link to comment
vasile eugen Posted June 2, 2017 Author Share Posted June 2, 2017 Salutare.revin din nou cu o intrebare.Am implementat un DS1307 si imi afiseaza.Mi-a ramas pini liberi la Arduino Uno ,pinii 0 , 1 ,10.Vreau sa fac sectiunea de reglare a minutelor,orei,zi luna,an. Se poate face sub forma de meniu?adica asa cum sunt pe LCDkey schield: https://www.dfrobot.com/wiki/images/a/a7/LCDKeypad_Shield_SCH.png si configurarea ca aici? https://www.dfrobot.com/wiki/index.php/Arduino_LCD_KeyPad_Shield_(SKU:_DFR0009) sau este diferit pentru librariile U8GLIB,in acest format: https://codebender.cc/example/U8glib/Menu#Menu.ino sau poate care este mai avansat poate da un sfat mai simplu Va multumesc. Link to comment
vasile eugen Posted June 3, 2017 Author Share Posted June 3, 2017 Am mai cautat date ca sa pot implementa butoane si am incercat de aici: https://www.dfrobot.com/forum/viewtopic.php?f=8&t=1838 codul care l-am facut pentru test este facut: #include "U8glib.h" // setup u8g object, please remove comment from one of the following constructor calls // IMPORTANT NOTE: The complete list of supported devices is here: http://code.google.com/p/u8glib/wiki/device // U8GLIB_NHD_C12864 u8g(13, 11, 10, 9, 8); U8GLIB_KS0108_128 u8g(2, 3, 4, 5, 6, 7, 8, 9, A2, 11, 12, A3, A1); // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=A2, cs1=11, cs2=12,di=A3,rw=A1 #define KEY_NONE 0 #define KEY_PREV 1 #define KEY_NEXT 2 #define KEY_SELECT 3 #define KEY_BACK 4 /* DOGS102 shield configuration values uint8_t uiKeyPrev = 2; uint8_t uiKeyNext = 4; uint8_t uiKeySelect = 5; uint8_t uiKeyBack = 3; */ /* DOGM128-Shield configuration values DOGXL60-Shield configuration values uint8_t uiKeyPrev = 7; uint8_t uiKeyNext = 3; uint8_t uiKeySelect = 2; uint8_t uiKeyBack = 8; */ uint8_t uiKeyCodeFirst = KEY_NONE; uint8_t uiKeyCodeSecond = KEY_NONE; uint8_t uiKeyCode = KEY_NONE; int adc_key_in; int key = -1; int oldkey = -1; /*Convert ADC Value to key number 4 | 0--1--3 | 2 */ int get_key(unsigned int input) { if (input < 10) return 4; else if (input < 200) return 0; else if (input < 400) return 2; else if (input < 600) return 1; else if (input < 800) return 3; else return -1; } void uiStep(void) { Serial.println("uiStep"); adc_key_in = analogRead(0); key = get_key(adc_key_in); if (key != oldkey) { delay(50); adc_key_in = analogRead(0); key = get_key(adc_key_in); if (key != oldkey) { oldkey = key; if (key >= 0) { uiKeyCodeFirst = KEY_BACK; } else if (key == 0) uiKeyCodeFirst = KEY_SELECT; else if (key == 1) uiKeyCodeFirst = KEY_NEXT; else if (key == 2) uiKeyCodeFirst = KEY_PREV; else if (key == 4) uiKeyCodeFirst = KEY_NONE; uiKeyCode = uiKeyCodeFirst; } } delay(100); } #define MENU_ITEMS 4 char *menu_strings[MENU_ITEMS] = { "Ora", "minute", "zi", "luna" }; uint8_t menu_current = 0; uint8_t menu_redraw_required = 0; uint8_t last_key_code = KEY_NONE; void drawMenu(void) { uint8_t i, h; u8g_uint_t w, d; u8g.setFont(u8g_font_6x13); u8g.setFontRefHeightText(); u8g.setFontPosTop(); h = u8g.getFontAscent() - u8g.getFontDescent(); w = u8g.getWidth(); for ( i = 0; i < MENU_ITEMS; i++ ) { d = (w - u8g.getStrWidth(menu_strings[i])) / 2; u8g.setDefaultForegroundColor(); if ( i == menu_current ) { u8g.drawBox(0, i * h + 1, w, h); u8g.setDefaultBackgroundColor(); } u8g.drawStr(d, i * h, menu_strings[i]); } } void updateMenu(void) { Serial.println("update menu"); switch (uiKeyCode) { case KEY_NEXT: menu_current++; if (menu_current >= MENU_ITEMS) menu_current = 0; menu_redraw_required = 1; break; case KEY_PREV: if (menu_current == 0) menu_current - MENU_ITEMS; menu_current--; menu_redraw_required = 1; break; } uiKeyCode = KEY_NONE; } void setup() { // rotate screen, if required // u8g.setRot180(); Serial.begin(9600); uiStep(); // setup key detection and debounce algorithm u8g.setContrast(0); menu_redraw_required = 1; // force initial redraw } void loop() { Serial.println("loop"); uiStep(); // check for key press updateMenu(); if ( menu_redraw_required != 0 ) { u8g.firstPage(); do { drawMenu(); } while ( u8g.nextPage() ); menu_redraw_required = 0; } } Dar nu imi dau seama ce mai am nevoie sa pot comuta. Ca sectiune de butoane vreau sa fie asa: https://www.dfrobot.com/wiki/images/a/a7/LCDKeypad_Shield_SCH.png Link to comment
MifTy Posted June 3, 2017 Share Posted June 3, 2017 m-am uitat pe linkul de pe forumul dfrobot, apoi pe codul pus de tine... îmi pare că ai copiat pur şi simplu codul scris de Steve ăla... iar din unicul reply, se pare că tipul a încălcat oareşce reguli de adresare a u8glib... altfel nu era trimis să recitească user manualul...ai mai folosit push-butoane cu Arduino? au mers exemplele, ai înţeles cum se face?modul de adresare a unui şir de butoane pe un singur fir l-ai înţeles (din ultima schemă pare că asta vrei să faci, şi e o soluţie demult cunoscută şi folosită), ai reuşit să deplasezi cursorul unui afişor 16x2 folosind aşa ceva? (adresarea unui 16x2 e deja trivială, nu ar trebui să ai probleme în a deplasa cursorul şi în a crea meniuri scrollabile).în fine, există un avertisment în legătură cu u8glib: haleşte aproape tot flashul disponibil într-un 328, şi e foarte posibil ca pur şi simplu să nu mai ai loc.am de gând să trec şi prin exemplele de tipul ăsta în curând, şi, deocamdată, nu reuşesc să-mi dau seama exact din codul ăla care e secţiunea care se ocupă de butoane, cum sunt definite, cum se stabileşte modul de adresare, şi am sentimentul că exact asta e problema pe care o ai.(nu te încânta prea tare că la compilare nu primeşti nici un fel de eroare... mi s-a întâmplat şi mie, şi multor altora, să compilez fără erori, dar codul să se comporte altfel decât voiam eu, sau să nu "mişte" deloc... compilatorul se uită doar dacă e codul corect din punct de vedere al sintaxei şi directivelor include, nu se chinuie să ghicească ce vrei tu să obţii, de fapt, şi să îţi spună cum să obţii aia...) Link to comment
vasile eugen Posted June 3, 2017 Author Share Posted June 3, 2017 Acel cod am vrut sa-l adaptez la un ceas grafic.Defapt am trei modele dar nu reusesc sa implementez butoane.Deaceea am postat in speranta ca poate careva a mai folost acest cod.Si daca este ompatibil cu libraria mea u8glib Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now