Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define INCLUDE_ASYNC_ACK true
- #include <PJON.h>
- // <Strategy name> bus(selected device id)
- PJON<ThroughSerial> bus(11);
- long counter=0;
- void setup() {
- pinModeFast(13, OUTPUT);
- digitalWriteFast(13, LOW); // Initialize LED 13 to be off
- bus.begin();
- Serial.begin(9600);
- bus.strategy.set_serial(&Serial); // Pass the Serial object you want to use for communication
- bus.strategy.set_enable_RS485_pin(2);
- //bus.send_repeatedly(44, "A", 1, 5000000); // Send B to device 44 every second
- }
- void loop() {
- bus.update();
- if (counter==50000){
- digitalWrite(13, HIGH);
- delay(30);
- digitalWrite(13, LOW);
- bus.send(44, "B", 1);
- counter=0;
- } else {
- counter++;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement