Working on reading serial, RX- on pin 1 of rs422 header.
This commit is contained in:
@@ -80,6 +80,9 @@ void setup() { // BEGIN SETUP ------------------------------------
|
|||||||
// set the data rate for the SoftwareSerial port
|
// set the data rate for the SoftwareSerial port
|
||||||
mySerial.begin(4800);
|
mySerial.begin(4800);
|
||||||
|
|
||||||
|
// set the data rate for the Serial port
|
||||||
|
Serial.begin(4800);
|
||||||
|
|
||||||
// by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
|
// by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
|
||||||
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 128x32)
|
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 128x32)
|
||||||
// init done
|
// init done
|
||||||
@@ -333,6 +336,8 @@ void read_serial (void) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Read text from the serial window
|
// Read text from the serial window
|
||||||
incomingByte = mySerial.read();
|
incomingByte = mySerial.read();
|
||||||
|
|
||||||
@@ -343,7 +348,7 @@ void read_serial (void) {
|
|||||||
lines++;
|
lines++;
|
||||||
chars = 0;
|
chars = 0;
|
||||||
}
|
}
|
||||||
display.print(incomingByte);
|
display.print((char)incomingByte);
|
||||||
display.display();
|
display.display();
|
||||||
delay(10);
|
delay(10);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user