Ive been fighting this allot… built this awesome program to control 8 ch light dimmer… now I want to network 8 arduino nanos around the hous with motion sensors that simply energize 1 input on digital 2 pin. when the pin is HIGH, I want it to satisfy an if statement,… to then “RSserial.write” a specific character that is linked to a specific channel back at the main controller to dim that light on, and then when channel goes LOW, another character will instruct the main to dim that specific light off.
attached image of main controller and video link of what it does with remote, and code.
the communication is going across pair in cat5 cable. but the if statement seems to not matter at all in the program… tried a regular if statement, and trying to nest an if, else, statement within an if statement.
if there’s anybody out there with the know how. please help… I’ve accomplished some awesome things on this project but this one has my brain racked.
Master NANO sends out an A… which will be recognized by one SLAVE in the line up… which will then return either an L or a H to inform the master whether its motion sensor is HIGH, or LOW… just a tester. the master will send a B for next slave… an so on… and so on… this will help keep traffic down as only one is able to talk when instructed to. plus the high low letters that are returned will all have to be different letters so each one is assigned to specific channel on dimmer module.
RS485_MASTER_modified.ino (2.71 KB)
RS485_SLAVE_modified.ino (2.13 KB)
FINAL_MEGA_PROGRAM_v1.ino (9.62 KB)