Hey im new to this forum and to php. im look for some help as i cant seem to get my lights to light up on my Arduino Uno board using 'Serial Comunication'
This is my code on the server...
$serial->deviceOpen();
if ($_GET['action'] == "on") {
$serial->sendMessage("N\r\n");
$file = fopen("testFile.txt","w");
fwrite($file, "1");
fclose($file);
} else if ($_GET['action'] == "off") {
$serial->sendMessage("0\r\n");
$file = fopen("testFile.txt","w");
fwrite($file, "0");
fclose($file);
}
And my code on the Arduino is listening to the serial port and is waiting for N. I know this is correct as i can test it by manually sending it an N...
If you know what is wrong with my code please help me and if you need more code snippets then i will gladly post them.
Thanks!
Chris