| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- // DISPLAY_DEV.setCursor(0,60);
- // DISPLAY_DEV.print(LCDarray1); DISPLAY_DEV.print(" "); DISPLAY_DEV.print(LCDarray2);
- TFT_ILI9163C DISPLAY_DEV = TFT_ILI9163C(TFT_ILI9163C_CSpin, TFT_ILI9163C_DCpin, TFT_ILI9163C__RSTpin);
- //defineScrollArea
- //scroll
- //startPushData(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);
- // void pushData(uint16_t color);
- // void endPushData();
- //fillRect(int16_t x, int16_t y, int16_t w, int16_t h,uint16_t color),
- // setRotation(uint8_t r),
- //drawPixel(int16_t x, int16_t y, uint16_t color),
- // drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color),
- // drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color),
- /*
-
- void TFT_ILI9163C_BASE::defineScrollArea(uint16_t tfa, uint16_t bfa){
- tfa += __OFFSET ;
- int16_t vsa = _GRAMHEIGH - tfa - bfa;
- if (vsa >= 0) {
- writecommand(CMD_VSCLLDEF);
- writedata16(tfa);
- writedata16(vsa);
- writedata16(bfa);
- }
- }
-
- void TFT_ILI9163C_BASE::scroll(uint16_t ssa) {
- if (ssa <= _TFTHEIGHT) {
- writecommand(CMD_VSSTADRS);
- writedata16(ssa + __OFFSET);
- }
- }
-
-
- int16_t getCursorX(void) const { return cursor_x; }
- @brief Get text cursor Y location
- @returns Y coordinate in pixels
- int16_t getCursorY(void) const { return cursor_y; };
-
-
- write -
- tft.fillScreen();
- unsigned long start = micros();
- tft.setCursor(0, 0);
- tft.setTextColor(WHITE);
- tft.setTextSize(1);
- tft.println("Hello World!");
- tft.setTextColor(YELLOW);
- tft.setTextSize(2);
- tft.println(1234.56);
- tft.setTextColor(RED);
- tft.setTextSize(3);
- tft.println(0xDEAD, HEX);
- tft.println();
- tft.setTextColor(GREEN);
- tft.setTextSize(4);
- tft.println("Hello");
- return micros() - start;
- */
- void DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A) {
- if(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A + 1 >= DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_Y_CHARS_A) {//[ARDUINO_ATTR_ARRAY_S_INDEX]
- DISPLAY_DEV.setCursor(0,0);
- //DISPLAY_DEV.clearScreen();
- DISPLAY_DEV.fillRect(0, 0, DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_PX_A , DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A ,BLUE),
- DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A = 0 ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
- DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_X_CHARS_A = 0 ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
- } else {
-
- DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A ++ ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
- DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_X_CHARS_A = 0 ; //[ARDUINO_ATTR_ARRAY_S_INDEX]
-
- DISPLAY_DEV.setCursor(0,DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A * DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
- DISPLAY_DEV.fillRect(0, DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A * DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A, DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_PX_A , DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A ,BLUE);
- }
-
- #if defined(DEBUG)
- if(DEBUG > 6) {
- Serial.print("#83 Dspl Y:["); Serial.print(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
- Serial.print("] #MaxY:["); Serial.print(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_Y_CHARS_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
- Serial.print("] maxX:["); Serial.print(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
- Serial.print("] x_A:["); Serial.print(DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_x_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
-
- //Serial.print("] #YxF:["); Serial.print(&DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A * DISPLAY_PHYSICAL_CHAR_A.DISPLAY_textsize_y_A); //[ARDUINO_ATTR_ARRAY_S_INDEX]
- Serial.println("] ");
- }
- #endif
- }
- void DISPLAY_DEV_CTRL__println(DISPLAY_PHYSICAL_CHAR_T &DISPLAY_PHYSICAL_CHAR_A,
- DISPLAY_array16_T DISPLAY_array16_A) {
- DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ;
- // DISPLAY_DEV.print(DISPLAY_array16_A);
- // unsigned char LCDarray1buf[16];
- // DISPLAY_array16_A.toCharArray(LCDarray1buf, 16);
-
- String message(DISPLAY_array16_A);
-
-
-
- int parts = floor(message.length()/ DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A ) ; //( message.length() + 100)
- if(message.length() >= DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A and parts == 1) parts ++;
- else if(parts == 0) parts = 1;
- int substr_begin = 0 ;
- int substr_end = 0 ;
- int i;
-
- #if defined(DEBUG)
- if(DEBUG > 6) {
- Serial.print("#34 arr16"); Serial.print(DISPLAY_array16_A);
- Serial.print("] #34 sizeof["); Serial.print(message.length());
- Serial.print("] #34 String["); Serial.print(message);
- Serial.print("] #34 frag"); Serial.print( message.substring(2, 5));
- Serial.print("] parts["); Serial.print( parts);
- Serial.print("] yC["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_CURSOR_Y_CHARS_A);
- Serial.println("] ");
- }
- #endif
-
-
-
- for(i = 1 ; i<= parts; i++) {
- //myString.substring(from, to)
- substr_end = substr_begin + DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A ;
- DISPLAY_DEV.print(message.substring(substr_begin, substr_end));
- /*BUG TODO ERROR IF UNCOMMENTED*/
- #if defined(DEBUG)
- if(DEBUG > 6) {
- Serial.print("#112 msg part["); Serial.print(i);
- Serial.print("] beg["); Serial.print(substr_begin);
- Serial.print("] end["); Serial.print(substr_end);
- Serial.print("] frag["); Serial.print(message.substring(substr_begin, substr_end));
- Serial.print("] yC["); Serial.print( DISPLAY_PHYSICAL_CHAR_A.DISPLAY_PHYSICAL_X_CHARS_A);
- Serial.println("] ");
- }
- #endif
-
- substr_begin = substr_end + 1;
- if( parts >= 1 and not(parts == i)) {
-
- DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ;
- } //else if(i == parts) {
- // DISPLAY_DEV__CURSOR__NEWLINE(DISPLAY_PHYSICAL_CHAR_A) ;
- // }
- }
- /*BUG TODO ERROR IF UNCOMMENTED
- // Serial.end(); // Ends the serial communication once all data is received
- //Serial.begin(115200);
- // delay(400);
- // if (Serial.available()) Serial.write("aaaa49 ");
- //delay(100);
- // if (Serial.available()) Serial.println("bbbb49 ");
- // else Serial.println("cccc49 ");
- */
- }
-
-
-
|