this does *not* work
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
Serial.println(F("This is ReceiveDemo, version 0.1"));
|
||||
|
||||
init485(2,3,4,5); // library initialization:
|
||||
// connect pin 2 to RO of Max485
|
||||
@@ -17,8 +18,5 @@ void setup() {
|
||||
}
|
||||
|
||||
void loop(){
|
||||
if (available485()){ // check if we have received anything
|
||||
Serial.print("messageReceived: ");
|
||||
Serial.println(get485Message()); // read the received message
|
||||
}
|
||||
if (available485()) Serial.println("Received: "+get485message());
|
||||
}
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
init485(2,3,4,5);
|
||||
speed485(8000);
|
||||
boolean sent = false;
|
||||
while (!sent) {
|
||||
sent = send485("This message is sent and received!");
|
||||
}
|
||||
Serial.println("This is SendAndReceive 0.1");
|
||||
init485(2,3,4,5); // library initialization:
|
||||
// connect pin 2 to RO of Max485
|
||||
// connect pin 3 to ^RE of Max485
|
||||
// connect pin 4 to DE of Max485
|
||||
// connect pin 5 to DI of Max485
|
||||
|
||||
while (send485("Hello World!")) {}
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// put your main code here, to run repeatedly:
|
||||
if (available485()){
|
||||
Serial.println("Received "+get485message());
|
||||
}
|
||||
if (available485()) Serial.println("Received "+get485message());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user