Merge branch 'nano-revision-2.0'
This commit is contained in:
@@ -9,18 +9,19 @@
|
||||
#include <LiquidCrystal.h>
|
||||
#include <SoftRS485.h>
|
||||
|
||||
#define Max485_RO 3 // read-output of Max485
|
||||
#define Max485_RE 5 // not-read-enable of Max485
|
||||
#define Max485_DE 9 // data enable of Max485
|
||||
#define Max485_DI 8 // data input of Max485
|
||||
#define Max485_RO 2 // read-output of Max485
|
||||
#define Max485_RE 3 // not-read-enable of Max485
|
||||
#define Max485_DE 8 // data enable of Max485
|
||||
#define Max485_DI 9 // data input of Max485
|
||||
|
||||
#define LCD_RS 4
|
||||
#define LCD_EN 6
|
||||
#define LCD_D4 7
|
||||
#define LCD_D5 11
|
||||
#define LCD_D6 12
|
||||
#define LCD_D7 13
|
||||
#define LCD_RS 10
|
||||
#define LCD_EN 11
|
||||
#define LCD_D4 4
|
||||
#define LCD_D5 5
|
||||
#define LCD_D6 6
|
||||
#define LCD_D7 7
|
||||
|
||||
#define PROGRAM "RS485-Nano 2.1 / LCDReceive 1.2"
|
||||
|
||||
|
||||
// initialize the library by associating any needed LCD interface pin with the arduino pin number it is connected to
|
||||
@@ -34,14 +35,11 @@ void setup() {
|
||||
// set up the LCD's number of columns and rows:
|
||||
lcd.begin(16, 2);
|
||||
// Print a message to the LCD.
|
||||
Serial.println("LCDReceive 1.2");
|
||||
lcd.print("LCDReceive 1.2");
|
||||
printMessage(PROGRAM);
|
||||
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (available485()) {
|
||||
String s = get485message();
|
||||
void printMessage(String s){
|
||||
Serial.println(s);
|
||||
lcd.clear();
|
||||
lcd.setCursor(0, 0);
|
||||
@@ -51,6 +49,11 @@ void loop() {
|
||||
s=s.substring(16);
|
||||
s.trim();
|
||||
lcd.print(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (available485()) {
|
||||
printMessage(get485message());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user