Total noob here so please excuse my ignorance.
I have spent a couple weeks trying to understand how Virtual Wire works and use it to:
1) Control a servo attached to an Arduino (rx) via a pot attached to an Arduino nano (tx).
2) Toggle a pin between high and low on the rx side via a momentary push button on the tx side.
I have written and thrown away so many sketches that attempting to show what I've tried already would be impossible and probably annoying.
As I tend to learn best in reverse, I'm hoping that there is an existing sketch/example out there that I can analyze and easily modify to work for me. I have searched both the Arduino forums and Google extensively but no luck.
I'm using the 315mhz 2400bps transmitter and receiver from SparkFun.
Any help or just general (dumbed down) knowledge about how to code for rf links would be greatly appreciated.
Have you seen this tutorial from a member on Let's Make Robots?
It looks like it might be helpful, shows some hardware and software.
Hey, thanks for the reply.
I hadn't seen that yet but it looks like a modified version of the examples that are included w/the Virtual Wire library.
I used those examples to verify that I have everything wired correctly and they did the job but they are set up to send/receive character messages. While this was useful, it doesn't quite solve my problem.
I guess what I'm looking for is an explanation on how to write a pwm'd value (read from the pot via an analog pin) to the rf transmitter instead of writing a constant char msg from memory and vice-versa for the receiver.
I guess what I'm looking for is an explanation on how to write a pwm'd value (read from the pot via an analog pin) to the rf transmitter instead of writing a constant char msg
If you're reading from an analog pin, you're not getting a pwm'd value.
You might be using that value to do PWM, but what you read from an analog pin is a ratio of the voltage on the pin vs Vref, scaled to a range of 0 to 1023.
You could convert that value to a character string, using sprintf, and then transmit it, couldn't you?