|
|
@@ -6,269 +6,4 @@ Queue<int> _LCD_print_queue = Queue<int>(5);
|
|
|
_LCD_print_bufforT _LCD_print_buffors[1];
|
|
|
_LCD_print_screensT _LCD_print_screens[10];
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-void LCD_print_background_add(_LCD_print_bufforT* _LCD_print_buffors, int screenID, int cursor1, int cursor2, char character ,long time_seq_id, long time_min_run ) {
|
|
|
- //time_seq_id - used to maintain single display context
|
|
|
- //time_max - used to how much time to keep in displayed text
|
|
|
- // Serial.println(" runned LCD_print_background_screen_add bbuf: ");
|
|
|
- // Serial.print(sizeof(_LCD_print_buffors));
|
|
|
- Serial.print("CB:");
|
|
|
- int curr_buf_ind;
|
|
|
- int i ;
|
|
|
- for(i=1;i<=100;i++) {
|
|
|
- if(_LCD_print_buffors[i].screenID<=0) {
|
|
|
- Serial.print("i<=0["); Serial.print(i); Serial.print("]");
|
|
|
- curr_buf_ind = i;
|
|
|
- //if(_LCD_print_buffors[i + 1].screenID<=0)
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- Serial.print(curr_buf_ind); Serial.print(". ");
|
|
|
-//char b = character.charAt(0);
|
|
|
- Serial.print(" added lcd buf at ind "); Serial.println(curr_buf_ind );
|
|
|
- int b_ascii_value = character;
|
|
|
-_LCD_print_buffors[curr_buf_ind] = { screenID , cursor1 , cursor2, b_ascii_value, time_seq_id , time_min_run} ;
|
|
|
-/*
|
|
|
- _LCD_print_buffors[screenID].screenID=screenID ;
|
|
|
- _LCD_print_buffors[screenID].cursor1=cursor1 ;
|
|
|
- _LCD_print_buffors[screenID].cursor2=cursor2 ;
|
|
|
- _LCD_print_buffors[screenID].character=b_ascii_value ;
|
|
|
- _LCD_print_buffors[screenID].time_seq_id=time_seq_id ;
|
|
|
- _LCD_print_buffors[screenID].time_min_run=time_min_run ;
|
|
|
- */
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-void LCD_print_background_screen_add(_LCD_print_screensT* _LCD_print_screens, int screenID,long time_seq_id, long time_min_run, char LCDarray1, char LCDarray2 ) {
|
|
|
- //time_seq_id - used to maintain single display context
|
|
|
- //time_max - used to how much time to keep in displayed text
|
|
|
-
|
|
|
- _LCD_print_screens[screenID].screenID=screenID ;
|
|
|
- _LCD_print_screens[screenID].time_seq_id=time_seq_id ;
|
|
|
- _LCD_print_screens[screenID].time_min_run=time_min_run ;
|
|
|
- _LCD_print_screens[screenID].LCDarray1=LCDarray1 ;
|
|
|
- _LCD_print_screens[screenID].LCDarray2=LCDarray2 ;
|
|
|
- Serial.print(" added to screen a1 "); Serial.println(String(LCDarray1) );
|
|
|
-
|
|
|
- // unsigned char LCDarray2buf[16];
|
|
|
- // LCDarray2.toCharArray(LCDarray2buf, 15);
|
|
|
- /*
|
|
|
- for ( int positionCounter1 = 0;
|
|
|
- positionCounter1 < 24; positionCounter1++)
|
|
|
- {
|
|
|
- LCD_print_background_add( _LCD_print_buffors, screenID, positionCounter1, 0, LCDarray1[positionCounter1], time_seq_id, time_min_run);
|
|
|
- Serial.print("A.");
|
|
|
- }
|
|
|
-
|
|
|
- for ( int positionCounter2 = 0;
|
|
|
- positionCounter2 < 24; positionCounter2++)
|
|
|
- {
|
|
|
- LCD_print_background_add( _LCD_print_buffors, screenID, positionCounter2, 1, LCDarray2[positionCounter2], time_seq_id, time_min_run);
|
|
|
- }
|
|
|
- Serial.print(" :");
|
|
|
- Serial.print(sizeof(_LCD_print_buffors));
|
|
|
- Serial.print(" :");
|
|
|
- */
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-// _LCD_print_bufforT _LCD_print_bufforss[] = { 0 , 0, "T", 10000, 50000 } ;
|
|
|
-
|
|
|
-
|
|
|
-void LCD_print_background(int cursor1, int cursor2, int character ,long time_seq_id, long time_min_run ) {
|
|
|
- //time_seq_id - used to maintain single display context
|
|
|
- //time_max - used to how much time to keep in displayed text
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-void _LCD_print_screens_list(_LCD_print_screensT* _LCD_print_screens ) {
|
|
|
- int i;
|
|
|
-
|
|
|
-
|
|
|
- Serial.print("sizeof(_LCD_print_screens): ");
|
|
|
- Serial.println(sizeof(_LCD_print_screens));
|
|
|
- for(i=0;i<=10;i++) { //sizeof(_LCD_print_buffors)
|
|
|
- Serial.print(" $i[");
|
|
|
- Serial.print(i);
|
|
|
-
|
|
|
- Serial.print("] screenID: ");
|
|
|
- Serial.print(_LCD_print_screens[i].screenID);
|
|
|
-
|
|
|
-
|
|
|
- String str((char*) _LCD_print_screens[i].LCDarray1);
|
|
|
-
|
|
|
- Serial.print(" LCDarray1 ph: ");
|
|
|
- Serial.println( str);
|
|
|
-
|
|
|
-
|
|
|
- Serial.print(" LCDarray1 len: ");
|
|
|
- Serial.println( sizeof(str));
|
|
|
-
|
|
|
-
|
|
|
- Serial.print(" LCDarray1: ");
|
|
|
- Serial.println( Serial.println((char*) _LCD_print_screens[i].LCDarray1) );
|
|
|
-
|
|
|
- Serial.print(" LCDarray2: ");
|
|
|
- Serial.write(_LCD_print_screens[i].LCDarray2);
|
|
|
-
|
|
|
- Serial.print(" time_seq_id: ");
|
|
|
-
|
|
|
- Serial.write( _LCD_print_screens[i].time_seq_id );
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- Serial.print(" time_seq_id: ");
|
|
|
- Serial.println(_LCD_print_screens[i].time_seq_id);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-void _LCD_print_buffors_list(_LCD_print_bufforT* _LCD_print_buffors, int LCDtim ) {
|
|
|
- int i;
|
|
|
- Serial.print("sizeof(_LCD_print_buffors): ");
|
|
|
- Serial.println(sizeof(_LCD_print_buffors));
|
|
|
- for(i=0;i<=100;i++) { //sizeof(_LCD_print_buffors)
|
|
|
- Serial.print(" $i[");
|
|
|
- Serial.print(i);
|
|
|
-
|
|
|
- Serial.print("] _LCD_print_buffors screenID: ");
|
|
|
- Serial.print(_LCD_print_buffors[i].screenID);
|
|
|
-
|
|
|
- Serial.print(" cursor1: ");
|
|
|
- Serial.print(_LCD_print_buffors[i].cursor1);
|
|
|
- Serial.print(" cursor2: ");
|
|
|
- Serial.print(_LCD_print_buffors[i].cursor2);
|
|
|
-
|
|
|
- Serial.print(" character: ");
|
|
|
-
|
|
|
- Serial.write( _LCD_print_buffors[i].character );
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- Serial.print(" time_seq_id: ");
|
|
|
- Serial.print(_LCD_print_buffors[i].time_seq_id);
|
|
|
-
|
|
|
- Serial.print(" time_min_run: ");
|
|
|
- Serial.println(_LCD_print_buffors[i].time_min_run);
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- lcd.setCursor(0,0);
|
|
|
- lcd.print("print_buffors"); // Print a message to the LCD.
|
|
|
- lcd.setCursor(0,1);
|
|
|
- lcd.print(String( _LCD_print_buffors[0].character));
|
|
|
- lcd.print(" , ");
|
|
|
- lcd.print(String( _LCD_print_buffors[1].character));
|
|
|
- delay(LCDtim * 5);
|
|
|
-}
|
|
|
-
|
|
|
-void LCD_print(String LCDarray1, String LCDarray2 ,int LCDtim) {
|
|
|
-
|
|
|
- delay(LCDtim);
|
|
|
- unsigned char LCDarray1buf[16];
|
|
|
- LCDarray1.toCharArray(LCDarray1buf, 16);
|
|
|
-
|
|
|
- unsigned char LCDarray2buf[16];
|
|
|
- LCDarray2.toCharArray(LCDarray2buf, 16);
|
|
|
-
|
|
|
- // lcd.setCursor(0,0);
|
|
|
- // lcd.print(LCDarray1);
|
|
|
- // lcd.setCursor(0,1);
|
|
|
- // lcd.print(LCDarray1);
|
|
|
-
|
|
|
- lcd.setCursor(16,0);
|
|
|
-
|
|
|
- for ( int positionCounter1 = 0;
|
|
|
- positionCounter1 <= 24 ;//LCDarray1.length(); // 24;
|
|
|
- positionCounter1++)
|
|
|
- {
|
|
|
- lcd.scrollDisplayLeft(); //Scrolls the contents of the display one space to the left.
|
|
|
- if(positionCounter1 >= LCDarray1.length()) lcd.print(" ");
|
|
|
- else lcd.print(LCDarray1[positionCounter1]); // Print a message to the LCD.
|
|
|
- delay(LCDtim); //wait for 250 microseconds
|
|
|
- if(positionCounter1==10) delay(LCDtim *7 );
|
|
|
- }
|
|
|
- // lcd.clear(); //Clears the LCD screen and positions the cursor in the upper-left corner.
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- lcd.setCursor(16,1);
|
|
|
- for ( int positionCounter2 = 0;
|
|
|
- positionCounter2 <= 24;//LCDarray2.length();//24;
|
|
|
- positionCounter2++)
|
|
|
- {
|
|
|
- lcd.scrollDisplayLeft(); //Scrolls the contents of the display one space to the left.
|
|
|
- if(positionCounter2 >= LCDarray2.length()) lcd.print(" ");
|
|
|
- else lcd.print(LCDarray2[positionCounter2]); // Print a message to the LCD.
|
|
|
- delay(LCDtim); //wait for 250 microseconds
|
|
|
- if(positionCounter2==10) delay(LCDtim *7 );
|
|
|
- }
|
|
|
- delay(LCDtim * 5); //wait for 250 microseconds
|
|
|
- // lcd.clear(); //Clears the LCD screen and positions the cursor in the upper-left corner.
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- delay(LCDtim);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-/*
|
|
|
-
|
|
|
-struct record
|
|
|
-{
|
|
|
- int bookId;
|
|
|
- int qtyInStock;
|
|
|
-
|
|
|
-};
|
|
|
-typedef struct record Record;
|
|
|
-
|
|
|
-void sold(int id, Record* records) {
|
|
|
- int i;
|
|
|
- for(i=0;i<3;i++) {
|
|
|
- if(records[i].bookId == id) {
|
|
|
- records[i].qtyInStock--;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-*/
|
|
|
-/*
|
|
|
-void updateId(int id, int new_id, Record* records) {
|
|
|
- int i;
|
|
|
- for(i=0;i<3;i++) {
|
|
|
- if(records[i].bookId == id) {
|
|
|
- records[i].bookid = new_id;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-*/
|
|
|
-/*
|
|
|
-void updateQty(int id, int new_qty, Record* records) {
|
|
|
- int i;
|
|
|
- for(i=0;i<3;i++) {
|
|
|
- if(records[i].bookId == id) {
|
|
|
- records[i].qtyInStock = new_qty;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-*/
|
|
|
-
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-String make_str16(String str){
|
|
|
- for(int i = 0; i < (16 - str.length()); i++)
|
|
|
- str += ' ';
|
|
|
- return str;
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
+
|