Skip to content

Commit e2aaa4b

Browse files
committed
Renamed project
1 parent a0ed56a commit e2aaa4b

File tree

5 files changed

+12
-155
lines changed

5 files changed

+12
-155
lines changed

DisplayLib/Display.cpp

Lines changed: 0 additions & 54 deletions
This file was deleted.

DisplayLib/Display.h

Lines changed: 0 additions & 64 deletions
This file was deleted.

DisplayLib/DisplayLib.pde

Lines changed: 0 additions & 30 deletions
This file was deleted.

SerialText/SerialText.pde

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
int ROWS = 4;
55
int COLS = 20;
6-
boolean flag = false;
6+
boolean COMMAND_MODE = false;
77
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
88
Display screen(lcd);
99

@@ -20,22 +20,23 @@ void loop()
2020
}
2121

2222
void handleCommands(){
23-
if(flag){
23+
if(COMMAND_MODE){
2424
Serial.println("You can scroll up or down with arrow now.");
2525
while(true){
2626
while (Serial.available() > 0) {
2727
int command = Serial.read();
2828
switch(command){
29-
case 106:
29+
case 106: // Scroll up
3030
Serial.println("Scrolling up");
3131
screen.scrollUp();
3232
break;
33-
case 107:
33+
case 107: // Scroll down
3434
Serial.println("Scrolling down");
3535
screen.scrollDown();
3636
break;
3737
default:
38-
Serial.println("Unknown command");
38+
Serial.print("Unknown command: ");
39+
Serial.println(command);
3940
}
4041
}
4142
}
@@ -47,7 +48,7 @@ void loadText(){
4748
if (Serial.available()) {
4849
int received_chars = 0;
4950
// wait a bit for the entire message to arrive
50-
delay(100);
51+
delay(500);
5152
screen.erase();
5253
// read all the available characters
5354
while (Serial.available() > 0) {
@@ -57,7 +58,7 @@ void loadText(){
5758
screen.save('#');
5859
screen.clear();
5960
screen.paint();
60-
flag = true;
61+
COMMAND_MODE = true;
6162
}
6263
}
6364

@@ -69,3 +70,4 @@ void loadText(){
6970

7071

7172

73+

libraries/Display/Display.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ void Display::erase(){
3232
screen[r][c] = ' ';
3333
}
3434
}
35+
for(int c = 0; c < 512; c++){
36+
buffer[c] = ' ';
37+
}
3538
paint();
3639
}
3740

0 commit comments

Comments
 (0)