I have just started working with my first library (VirtualWire) I have watched several tutorials on youtube and googled various blogs to follow simple projects to simply make one arduino send a code to make another arduinos led blink once every second or two.
But for some strange reason no matter what code I use I get the same error when trying to upload the code to my arduino uno
"Arduino: 1.6.11 (Windows 10), Board: "Arduino/Genuino Uno"
Build options changed, rebuilding all
In file included from C:\Users\Medic873\Desktop\sketch_aug17a\sketch_aug17a.ino:1:0:
C:\Program Files (x86)\Arduino\libraries\VirtualWire/VirtualWire.h:14:20: fatal error: wiring.h: No such file or directory
#include <wiring.h>
^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
"
It seems that for some reason a file is missing from the library but I don't understand how or why since I just downloaded this library.
My code is below should simply send one byte from one board to another
#include<VirtualWire.h>
void setup()
{
Serial.begin(9600);
vw_setup(2000);
vw_set_tx_pin(7);
}
void loop()
{
if(Serial.available())
{
char c = Serial.read();
if(c == '1')
{
vw_send((uint8_t *)c, 1);
}
else if(c == '0')
{
vw_send((uint8_t *)c, 1);
}
}
}