![]() Then we wait for a response from the slave to confirm it got the message. This gives an analog reading which is then sent to the slave. It reads a potentiometer connected to pin A0 (with the other sides of the pot connected to +5V and Gnd). This example demonstates how you might command a light in some other part of the house to dim up/down. ![]() PinMode (LED_PIN, OUTPUT) // built-in LEDĭigitalWrite (ENABLE_PIN, HIGH) // enable sendingĭigitalWrite (ENABLE_PIN, LOW) // disable sendingīyte received = recvMsg (fAvailable, fRead, buf, sizeof buf) ĭigitalWrite (LED_PIN, received = 0) // turn on LED if error ![]() PinMode (ENABLE_PIN, OUTPUT) // driver output enable SoftwareSerial rs485 (2, 3) // receive pin, transmit pin
0 Comments
Leave a Reply. |