Let me first apologize for this thread, I know someone is going to tell me I should just use the search function or something similar...but i seriously seem to be not smart enough to figure this out by myself.
Also I am a total noob when it comes to programming (i'm looking to change that.)
All i want to do is control a 4 relay array via 2 arduino unos (one as the transmitter controlled by the serial monitor the other connected to the relay array) Both arduinos connected to an nRF24L01-module. I've used the libraries succesfully to ping a "Hello world"-programm, also i added some 47 µF caps to the rf module, all this worked fine.
However I seem too be too slow and/or frustration intolerant to come up with the solution. Obviously there are a lot of examples out there using hardware switches etc to turn the relays on/off.
All i really want to do is e.g. type: "1" or "2" or whatever to adress one of the relays and turn it on and maybe something like "-1" or "-2" to turn it off.
I know anyone who knows their stuff will be able to get this working within an hour tops, however...i dont seem to know my stuff.
So my question really is: What tutorials do i need to read to get this working or can any of you help me with a code i can modify to achieve this?
I know my problem is the result of a lack on basic understanding of programming and too little training to really know what im doing.
A simple way to control four relays is to send "1111" if you want them all on or "0000" if you want them all off. Or any combination like "0101" if you want some on and some off. The position of the 1 (or 0) identifies which relay it refers to.
Alright, I had a little help and we came up with this code.
I know its not perfect because it should be using an array but it does the Job. Still need some modifications though.
Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.