Hi,
I've got an Arduino sending and a 2nd receiving using Mike McAuley's Virtualwire demo programs and the sparkfun 434 MHz Tx/Rx modules (the 4800 units). Unfortunately, I'm really a hardware guy and haven't programmed much in ages, so I'm struggling with some of the more complex coding.
I can't figure out how to mod these 2 lines in the TX program to send out the value out the value of "key" from the matriz keypad program:
const char *msg = "hello";
vw_send((uint8_t *)msg, strlen(msg));
"key" will be from 0-F, with just 1 button push at a time sending out 1 character.
Doing some lunchtime forum browsing at work, I see that
char *msg
defines a pointer to a char character.
So if I change to this, will that do it for me?
:
:
// all the other stuff from the keypad tutorial and setup stuff for the
// wireless goes here
:
:
void loop()
{
char key = keypad.getKey();
if(key) // same as if(key != NO_KEY)
{
char msg;
msg = &message;
// send the keypress out over wireless
char message = key
vw_send((uint8_t *)&message
(plus the wait for end of transmit line that goes here)
} // end of if(key)
} // go back to waitng for next keypress
I realize this keeps the Arduino spinning its wheels waiting for that rare keypress, I plan to improve after this to do the wake on keypress described by Atmel here:
Thanks,
Robert