diff --git a/CHANGELOG.md b/CHANGELOG.md index b4a187d..21e3921 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.3.9] - 2023-11-22 - update readme.md - section about hardware performance (Kudos to SteveMicroCode #29) - - incl badges to platformIO + - badges to platformIO + issues + - improve related section +- update keywords.txt +- **keyScan()** replaces keyscan() => prefer camelCase (prep 0.4.0) + - patched examples. +- minor edits ## [0.3.8] - 2023-07-15 diff --git a/README.md b/README.md index dcf8f34..4cac1b9 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ Library for TM1637 driven displays and key scans. The TM1637 drives 7 segment displays and can also scan a 16 key keyboard. The library is mainly tested with Arduino UNO, both a 6 digits display and 4 digit (clock) display. +The TM1637 can scan max 2 rows and 8 columns or a smaller keyboard. +It is therefore not possible to scan a "standard" 3x4 or 4x4 matrix keypad. ESP32 is supported since 0.2.0 see https://github.com/RobTillaart/TM1637_RT/pull/5 @@ -28,6 +30,10 @@ ESP32 is supported since 0.2.0 see https://github.com/RobTillaart/TM1637_RT/pull - https://docs.wokwi.com/parts/wokwi-tm1637-7segment#simulator-examples - https://github.com/SteveMicroCode/PIC-TM1637-Library-CodeOn - includes interesting hardware notes. +- https://github.com/RobTillaart/HT16K33 +- https://github.com/RobTillaart/AnalogKeypad +- https://github.com/RobTillaart/I2CKeyPad +- https://github.com/RobTillaart/I2CKeyPad8x8 #### Hardware connection and performance @@ -131,14 +137,14 @@ TM.displayCelsius(temperature, (temperature < -9) || (temperature > 99)); Note that the effective range of Celsius and Fahrenheit differs. When Fahrenheit goes from -9 to 99 Celsius goes from -26 to 37 (etc). -| F | C | | F | C | +| F | C | | C | F | |:-----:|:-----:|:----:|:-----:|:-----:| -| -9 | -26 | | 16 | -9 | -| 99 | 37 | | 210 | 99 | +| -9 | -26 | | -9 | 16 | +| 99 | 37 | | 99 | 210 | -A three digit temperature, e.g. range -99 .. 999, would be possible but one has -to leave out either the ° character or the C/F. -As the C/F is more informative, the choice is fairly easy. +A three digit temperature, e.g. range -99 .. 999, or -9.9 .. 99.9 would be possible. +Then one has to leave out either the ° character or the C/F. +As the C/F is far more informative, the choice is fairly easy. Question is how to API should change, new function of new behaviour? See future. @@ -151,8 +157,8 @@ See future. #### KeyScan -- **uint8_t keyscan(void)** scans the keyboard once and return result. -The keyscan() function cannot detect multiple keys. +- **uint8_t keyScan(void)** scans the keyboard once and return result. +The keyScan() function cannot detect multiple keys. #### DisplayRaw explained @@ -247,7 +253,7 @@ Feel free to file an issue to get your processor supported. - Kudos to wfdudley for this section - See #11 -Calling **keyscan()** returns a uint8_t, whose value is 0xff if no keys are being pressed at the time. +Calling **keyScan()** returns a uint8_t, whose value is 0xff if no keys are being pressed at the time. The TM1637 can only see one key press at a time, and there is no "rollover". If a key is pressed, then the values are as follows: @@ -255,7 +261,7 @@ If a key is pressed, then the values are as follows: @@ -273,7 +279,6 @@ If a key is pressed, then the values are as follows:
- keyscan results are reversed left for right from the data sheet. + keyScan results are reversed left for right from the data sheet.
- To modify a "generic" TM1637 board for use with a keyboard, you must add connections to either or both of pins 19 and 20 (these are the "row" selects) and then to as many of pins 2 through 9 (the "columns") as needed. It is easiest to connect to the "column pins" (2-9) by picking them @@ -281,7 +286,7 @@ up where they connect to the LED displays (see second photo). Generic keyboards that are a 4x4 matrix won't work; the TM1637 can only scan a 2x8 matrix. Of course, fewer keys are acceptable; I use a 1x4 keyboard in my projects. -Further, the TM1637 chip needs a fairly hefty pull-up on the DIO pin for the keyscan() routine to work. +Further, the TM1637 chip needs a fairly hefty pull-up on the DIO pin for the keyScan() routine to work. There is no pull-up in the TM1637 itself, and the clone boards don't seem to have one either, despite the data sheet calling for 10K ohms pull-ups on DIO and CLOCK. 10K is too weak anyway. The slow rise-time of the DIO signal means that the "true/high" value isn't reached fast enough and @@ -328,14 +333,14 @@ hooked to the TRIGGER pin, and the two channel probes hooked to DIO and CLK. Vertical sensitivity is 2v/division, horizontal timebase is 20usec/division. -## Keyscan +## KeyScan Implemented in version 0.3.0 Please read the datasheet to understand the limitations. ``` // NOTE: -// on the TM1637 boards tested by @wfdudley, keyscan() works well -// if you add a 910 ohm or 1 Kohm pull-up resistor from DIO to 3.3v +// on the TM1637 boards tested by @wfdudley, keyScan() works well +// if you add a 910 ohm or 1000 ohm pull-up resistor from DIO to 3.3v // This reduces the rise time of the DIO signal when reading the key info. // If one only uses the pull-up inside the microcontroller, // the rise time is too long for the data to be read reliably. @@ -353,6 +358,7 @@ See examples - (0.4.0) - remove obsolete **init()** from code + - remove keyscan() => keyScan() - **setLeadingZeros(bool on = false)** leading zeros flag, set data array to 0. - **getLeadingZeros()** @@ -367,7 +373,6 @@ See examples #### Could -- **keyScan()** camelCase ? - add parameter for **hideSegement(idx, character == SPACE)** to overrule hide char. - space underscore or - are possible. - add **TM1637_UNDERSCORE** to char set. ```seg[19] == 0x08``` diff --git a/TM1637.cpp b/TM1637.cpp index 619f8b8..63cf9a6 100644 --- a/TM1637.cpp +++ b/TM1637.cpp @@ -7,7 +7,7 @@ // URL: https://github.com/RobTillaart/TM1637_RT // NOTE: -// on the inexpensive TM1637 boards @wfdudley has used, keyscan +// on the inexpensive TM1637 boards @wfdudley has used, keyScan // works if you add a 1000 ohm pull-up resistor from DIO to 3.3v // This reduces the rise time of the DIO signal when reading the key info. // If one only uses the pull-up inside the microcontroller, @@ -539,15 +539,15 @@ void TM1637::writeSync(uint8_t pin, uint8_t val) } -// keyscan results are reversed left for right from the data sheet. -// here are the values returned by keyscan(): +// keyScan results are reversed left for right from the data sheet. +// here are the values returned by keyScan(): // // pin 2 3 4 5 6 7 8 9 // sg1 sg2 sg3 sg4 sg5 sg6 sg7 sg8 // 19 k1 0xf7 0xf6 0xf5 0xf4 0xf3 0xf2 0xf1 0xf0 // 20 k2 0xef 0xee 0xed 0xec 0xeb 0xea 0xe9 0xe8 -uint8_t TM1637::keyscan(void) +uint8_t TM1637::keyScan(void) { uint8_t halfDelay = _bitDelay >> 1; uint8_t key; diff --git a/TM1637.h b/TM1637.h index 566de24..69450db 100644 --- a/TM1637.h +++ b/TM1637.h @@ -8,7 +8,7 @@ // URL: https://github.com/RobTillaart/TM1637_RT // NOTE: -// on the inexpensive TM1637 boards @wfdudley has used, keyscan +// on the inexpensive TM1637 boards @wfdudley has used, keyScan // works if you add a 1000 ohm pull-up resistor from DIO to 3.3v // This reduces the rise time of the DIO signal when reading the key info. // If one only uses the pull-up inside the microcontroller, @@ -71,7 +71,7 @@ class TM1637 // KEY SCAN - uint8_t keyscan(void); + uint8_t keyScan(void); // CONFIGURATION @@ -83,14 +83,19 @@ class TM1637 uint8_t g = 6, uint8_t h = 7); - // OBSOLETE - // init will be replaced by begin() in the future (0.4.0) - void init(uint8_t clockPin, uint8_t dataPin, uint8_t digits = 6); - // DEBUG only void dumpCache(); + // OBSOLETE + // init() => begin() in 0.4.0 + [[deprecated("Use begin() instead")]] + void init(uint8_t clockPin, uint8_t dataPin, uint8_t digits = 6); + // keyscan() => keyScan() in 0.4.0 + [[deprecated("Use keyScan() instead => camelCase!")]] + uint8_t keyscan(void) { return keyScan(); }; + + private: uint8_t _clockPin = -1; uint8_t _dataPin = -1; diff --git a/examples/TM1637_HEX/TM1637_HEX.ino b/examples/TM1637_HEX/TM1637_HEX.ino index c845ef6..4b4f96c 100644 --- a/examples/TM1637_HEX/TM1637_HEX.ino +++ b/examples/TM1637_HEX/TM1637_HEX.ino @@ -43,7 +43,7 @@ void test() start = millis(); for (int i = 0; i < 1000; i++) { - TM.displayHex(val); // there is loop overhead etc + TM.displayHex(val); // there is loop overhead etc val++; } stop = millis(); @@ -65,5 +65,5 @@ void test() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/TM1637_alpha/TM1637_alpha.ino b/examples/TM1637_alpha/TM1637_alpha.ino index 5fb3c30..410945a 100644 --- a/examples/TM1637_alpha/TM1637_alpha.ino +++ b/examples/TM1637_alpha/TM1637_alpha.ino @@ -36,10 +36,10 @@ void ascii_to_7segment(char *buff, uint8_t *data) { data[j--] = buff[i] - 'g' + 18; } else if(buff[i] == '.') { - data[j+1] |= 0x80; // decimal point on previous digit + data[j+1] |= 0x80; // decimal point on previous digit } else { - data[j--] = 0x10; // blank + data[j--] = 0x10; // blank } } } @@ -59,5 +59,5 @@ uint8_t data[10]; } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/TM1637_clock_4digits/TM1637_clock_4digits.ino b/examples/TM1637_clock_4digits/TM1637_clock_4digits.ino index 6f060a6..9db55d2 100644 --- a/examples/TM1637_clock_4digits/TM1637_clock_4digits.ino +++ b/examples/TM1637_clock_4digits/TM1637_clock_4digits.ino @@ -49,9 +49,9 @@ void setup() // left as exercise for the programmer ;) void loop() { - uint32_t now = millis() % 100000; // 0 - 99999 - float value = now * 0.001; // 0 - 99.999 - if (value - int(value) < 0.5) value *= 100; // for blink : + uint32_t now = millis() % 100000; // 0 - 99999 + float value = now * 0.001; // 0 - 99.999 + if (value - int(value) < 0.5) value *= 100; // for blink : TM.displayFloat(value); } @@ -65,5 +65,5 @@ void loop2() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/TM1637_custom/TM1637_custom.ino b/examples/TM1637_custom/TM1637_custom.ino index d72039d..43175c1 100644 --- a/examples/TM1637_custom/TM1637_custom.ino +++ b/examples/TM1637_custom/TM1637_custom.ino @@ -7,7 +7,7 @@ // URL: https://github.com/radionerd // Demonstration of how to display char *buff and override the TM1637 library asciiTo7Segment virtual function -// to create a custom 7 segment character set. +// to create a custom 7 segment character set. // The letter 'A' becomes swapped with @ in this trivial example // Status: Experimental. Tested on STM32F103C8T6 Blue Pill and Arduino Nano only @@ -23,15 +23,15 @@ const int DISPLAY_DIGITS_6 = 6; class myTM1637 : TM1637 { public: void setBrightness(uint8_t b) { TM1637::setBrightness(b);}; - + void begin(uint8_t clockPin, uint8_t dataPin, uint8_t digits = 6) {TM1637::begin(clockPin,dataPin,digits);}; - - void displayPChar( char * data ) { - TM1637::displayPChar( &data[0] ); // Call the base class - Serial.println(data); // Copy display output to the serial port + + void displayPChar( char * data ) { + TM1637::displayPChar( &data[0] ); // Call the base class + Serial.println(data); // Copy display output to the serial port }; - - uint8_t asciiTo7Segment ( char c ) { // Override library ascii to 7 segment conversion + + uint8_t asciiTo7Segment ( char c ) { // Override library ascii to 7 segment conversion // -01- // 20 | | 02 @@ -40,15 +40,15 @@ class myTM1637 : TM1637 { // -08- .80 //7+1 Segment patterns for ASCII 0x30-0x5F - const uint8_t asciiTo8Segment[] = { - 0x00,0x86,0x22,0x7f, 0x6d,0x52,0x7d,0x02, // !"# $%&' - 0x39,0x0f,0x7f,0x46, 0x80,0x40,0x80,0x52, // ()*+ ,-./ - 0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d,0x07, // 0123 4567 - 0x7f,0x6f,0x09,0x89, 0x58,0x48,0x4c,0xD3, // 89:; <=>? - 0x77,0x5f,0x7c,0x39, 0x5E,0x79,0x71,0x3d, // @aBC DEFG NB: @ <-> A in this derived class - 0x74,0x06,0x0E,0x75, 0x38,0x37,0x54,0x5c, // HIJK LMNO - 0x73,0x67,0x50,0x6D, 0x78,0x3E,0x1C,0x9c, // PQRS TUVW - 0x76,0x6E,0x5B,0x39, 0x52,0x0F,0x23,0x08 // XYZ[ /]^_ + const uint8_t asciiTo8Segment[] = { + 0x00,0x86,0x22,0x7f, 0x6d,0x52,0x7d,0x02, // !"# $%&' + 0x39,0x0f,0x7f,0x46, 0x80,0x40,0x80,0x52, // ()*+ ,-./ + 0x3f,0x06,0x5b,0x4f, 0x66,0x6d,0x7d,0x07, // 0123 4567 + 0x7f,0x6f,0x09,0x89, 0x58,0x48,0x4c,0xD3, // 89:; <=>? + 0x77,0x5f,0x7c,0x39, 0x5E,0x79,0x71,0x3d, // @aBC DEFG NB: @ <-> A in this derived class + 0x74,0x06,0x0E,0x75, 0x38,0x37,0x54,0x5c, // HIJK LMNO + 0x73,0x67,0x50,0x6D, 0x78,0x3E,0x1C,0x9c, // PQRS TUVW + 0x76,0x6E,0x5B,0x39, 0x52,0x0F,0x23,0x08 // XYZ[ /]^_ }; uint8_t segments = c &0x80; @@ -69,12 +69,12 @@ void setup() delay(1000); Serial.println(__FILE__); - // set clockpin, datapin to your own board pin names - // e.g. myTM.begin(PB8, PB9 , DISPLAY_DIGITS_6 ); - myTM.begin( 14, 15 , DISPLAY_DIGITS_6 ); // clockpin, datapin, and digits + // set clockpin, datapin to your own board pin names + // e.g. myTM.begin(PB8, PB9 , DISPLAY_DIGITS_6 ); + myTM.begin( 14, 15 , DISPLAY_DIGITS_6 ); // clockpin, datapin, and digits myTM.setBrightness(2); - + } @@ -82,12 +82,12 @@ void loop() { char buff[20]; static int seconds; - // Show A and @ swapped over on custom character set - // Compare the 7 segment display with the text shown on the serial monitor + // Show A and @ swapped over on custom character set + // Compare the 7 segment display with the text shown on the serial monitor sprintf(buff,"@-A%3d", seconds++%100 ); - myTM.displayPChar(buff); // send buffer to display and serial port + myTM.displayPChar(buff); // send buffer to display and serial port delay(1000); } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/TM1637_displayTime/TM1637_displayTime.ino b/examples/TM1637_displayTime/TM1637_displayTime.ino index 2a9b2bb..6ba784b 100644 --- a/examples/TM1637_displayTime/TM1637_displayTime.ino +++ b/examples/TM1637_displayTime/TM1637_displayTime.ino @@ -36,4 +36,4 @@ void loop() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/TM1637_displayTime2/TM1637_displayTime2.ino b/examples/TM1637_displayTime2/TM1637_displayTime2.ino index 55f555c..837ce9d 100644 --- a/examples/TM1637_displayTime2/TM1637_displayTime2.ino +++ b/examples/TM1637_displayTime2/TM1637_displayTime2.ino @@ -43,4 +43,4 @@ void loop() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/TM1637_float/TM1637_float.ino b/examples/TM1637_float/TM1637_float.ino index 8deba48..303c760 100644 --- a/examples/TM1637_float/TM1637_float.ino +++ b/examples/TM1637_float/TM1637_float.ino @@ -24,11 +24,11 @@ void setup() TM.displayFloat(1.42425); // TM.dumpCache(); delay(2000); - + TM.displayFloat(-1.42425); // TM.dumpCache(); delay(2000); - + TM.displayClear(); // TM.dumpCache(); delay(2000); @@ -47,7 +47,7 @@ void test() start = millis(); for (int i = 0; i < 1000; i++) { - TM.displayFloat(f); // there is loop overhead etc + TM.displayFloat(f); // there is loop overhead etc f += 1; } stop = millis(); @@ -57,5 +57,5 @@ void test() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/TM1637_hide_segment/TM1637_hide_segment.ino b/examples/TM1637_hide_segment/TM1637_hide_segment.ino index ecd99e7..fb0c149 100644 --- a/examples/TM1637_hide_segment/TM1637_hide_segment.ino +++ b/examples/TM1637_hide_segment/TM1637_hide_segment.ino @@ -57,4 +57,4 @@ void loop() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/TM1637_int/TM1637_int.ino b/examples/TM1637_int/TM1637_int.ino index 6ac7813..6195a17 100644 --- a/examples/TM1637_int/TM1637_int.ino +++ b/examples/TM1637_int/TM1637_int.ino @@ -55,5 +55,5 @@ void test() } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/TM1637_keyscan_cooked/TM1637_keyscan_cooked.ino b/examples/TM1637_keyscan_cooked/TM1637_keyscan_cooked.ino index ec260c0..0fc89b7 100644 --- a/examples/TM1637_keyscan_cooked/TM1637_keyscan_cooked.ino +++ b/examples/TM1637_keyscan_cooked/TM1637_keyscan_cooked.ino @@ -2,7 +2,7 @@ // FILE: TM1637_keypress_cooked.ino // AUTHOR: William F. Dudley Jr. // VERSION: 0.1.0 -// PURPOSE: demo TM1637 library - keyscan() cooked output +// PURPOSE: demo TM1637 library - keyScan() cooked output // DATE: 2021-10-26 // URL: https://github.com/RobTillaart/TM1637 @@ -12,9 +12,9 @@ TM1637 TM; -// Note: In my experience, the TM1637 boards need a pull up -// resistor from DIO to 3.3V for keyscan() to work. 1000 ohms -// seems to work well, but value isn't critical. +// Note: In my experience, the TM1637 boards need a pull up +// resistor from DIO to 3.3V for keyScan() to work. 1000 ohms +// seems to work well, but value isn't critical. char buff[8]; @@ -49,10 +49,11 @@ void setup() char button_poll(void) { char c; static unsigned long last_key_time; - uint8_t keypress = TM.keyscan(); + uint8_t keypress = TM.keyScan(); c = '\0'; - // TM.displayHex(keypress); // uncomment to see raw data on LED - // Serial.print("kp "); Serial.println(keypress, HEX); // uncomment to see raw + // TM.displayHex(keypress); // uncomment to see raw data on LED + // Serial.print("kp "); // uncomment to see raw + // Serial.println(keypress, HEX); // uncomment to see raw if(keypress < 0xfe) { if(last_keypress != keypress || (millis() - last_key_time) > 500) { last_keypress = keypress; @@ -97,10 +98,10 @@ void ascii_to_7segment(char *buff, uint8_t *data) { data[j--] = buff[i] - 'g' + 18; } else if(buff[i] == '.') { - data[j+1] |= 0x80; // decimal point on previous digit + data[j+1] |= 0x80; // decimal point on previous digit } else { - data[j--] = 0x10; // blank + data[j--] = 0x10; // blank } } } @@ -115,7 +116,7 @@ char c; buff[bptr++] = c; if(bptr > 5) { bptr = 0; } Serial.println(buff); - // convert ASCII chars in "buff" to 7 segment representations in "data" + // convert ASCII chars in "buff" to 7 segment representations in "data" ascii_to_7segment(buff, data); TM.displayRaw(data, -1); } @@ -123,5 +124,5 @@ char c; } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/TM1637_keyscan_raw/TM1637_keyscan_raw.ino b/examples/TM1637_keyscan_raw/TM1637_keyscan_raw.ino index a46e410..581a668 100644 --- a/examples/TM1637_keyscan_raw/TM1637_keyscan_raw.ino +++ b/examples/TM1637_keyscan_raw/TM1637_keyscan_raw.ino @@ -2,7 +2,7 @@ // FILE: TM1637_keypress_raw.ino // AUTHOR: William F. Dudley Jr. // VERSION: 0.1.0 -// PURPOSE: demo TM1637 library - keyscan() raw output +// PURPOSE: demo TM1637 library - keyScan() raw output // DATE: 2021-10-26 // URL: https://github.com/RobTillaart/TM1637 @@ -11,18 +11,18 @@ TM1637 TM; -// Note: In my experience, the TM1637 boards need a pull up -// resistor from DIO to 3.3V for keyscan() to work. 1000 ohms -// seems to work well, but value isn't critical. +// Note: In my experience, the TM1637 boards need a pull up +// resistor from DIO to 3.3V for keyScan() to work. 1000 ohms +// seems to work well, but value isn't critical. -// TRIGGER is scope trigger signal for development. -// Comment out the #define if you don't need it. -// or feel free to change to any unused pin. Hook your -// oscilloscope or logic analyzer trigger to it. -// This allows experimenting with the pullup resistor -// from DIO to 3.3V. Smaller values decrease rise time -// (a good thing) but too small and the microcontroller -// can't pull the line down (a bad thing). Try 1000 ohms. +// TRIGGER is scope trigger signal for development. +// Comment out the #define if you don't need it. +// or feel free to change to any unused pin. Hook your +// oscilloscope or logic analyzer trigger to it. +// This allows experimenting with the pullup resistor +// from DIO to 3.3V. Smaller values decrease rise time +// (a good thing) but too small and the microcontroller +// can't pull the line down (a bad thing). Try 1000 ohms. #define dispCLOCK 3 @@ -57,7 +57,7 @@ char button_poll(void) { delayMicroseconds(1); digitalWrite(TRIGGER, LOW); #endif - uint8_t keypress = TM.keyscan(); + uint8_t keypress = TM.keyScan(); TM.displayHex(keypress); if(keypress < 0xfe) { Serial.print(F("KEYPRESS ")); @@ -72,11 +72,11 @@ void loop() button_poll(); #ifndef TRIGGER - // for oscilloscope testing, don't delay for faster repetition rate + // for oscilloscope testing, don't delay for faster repetition rate delay(50); #endif } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/examples/TM1637_pchar/TM1637_pchar.ino b/examples/TM1637_pchar/TM1637_pchar.ino index f940fec..3da94ac 100644 --- a/examples/TM1637_pchar/TM1637_pchar.ino +++ b/examples/TM1637_pchar/TM1637_pchar.ino @@ -21,9 +21,9 @@ void setup() delay(1000); Serial.println(__FILE__); - // set clockpin, datapin to your own board pin names - // e.g. myTM.begin(PB8, PB9 , DISPLAY_DIGITS_6 ); - TM.begin( 14, 15 , DISPLAY_DIGITS_6 ); // clockpin, datapin, and digits + // set clockpin, datapin to your own board pin names + // e.g. myTM.begin(PB8, PB9 , DISPLAY_DIGITS_6 ); + TM.begin( 14, 15 , DISPLAY_DIGITS_6 ); // clockpin, datapin, and digits TM.setBrightness(2); @@ -35,10 +35,10 @@ void loop() char buff[20]; static int seconds; sprintf(buff,"Sec=%02x", seconds++&0xFF ); - TM.displayPChar(buff); // send buffer to display - Serial.println(buff); // and serial port. + TM.displayPChar(buff); // send buffer to display + Serial.println(buff); // and serial port. delay(1000); } -// -- END OF FILE -- +// -- END OF FILE -- diff --git a/keywords.txt b/keywords.txt index 018e07e..d3d7888 100644 --- a/keywords.txt +++ b/keywords.txt @@ -25,13 +25,19 @@ displayTwoInt KEYWORD2 displayCelsius KEYWORD2 displayFahrenheit KEYWORD2 +displayClear KEYWORD2 +displayRefresh KEYWORD2 + +hideSegment KEYWORD2 +hideMultiSegment KEYWORD2 + setBrightness KEYWORD2 getBrightness KEYWORD2 setBitDelay KEYWORD2 getBitDelay KEYWORD2 -keyscan KEYWORD2 +keyScan KEYWORD2 setDigitOrder KEYWORD2