Hmmm, I'm pretty sure I already posted this, but...
How would I write my code to see if a value has been updated?
Here's my setup:
PHP Webpage with a form with either a ON or an OFF option(1 or 0 sent)
Visual Basic backend that simply grabs said bits and forwards them.
Arduino sketch that sees if the Serial port has been updated, then updates values.
64-bit shift register that controls a NightRider style bar(came stock, might pull it apart later)
I'm trying to find some code that'll check if a new bit has been written and update it on the bar.
The problem I see is that if the current bit is a 0,and the new one is also a 0, it wouldn;t be feasible to detect a "change" in the variable.
Past this point is all my current code(It's written to run a RGB LED, but I want to modify it to allow KBar data sending without specifying RGB Bits.
BACKEND Half of PHP
<?php
if(isset($_REQUEST['r']) && is_numeric($_REQUEST['r']) && isset($_REQUEST['g']) && is_numeric($_REQUEST['g']) && isset($_REQUEST['b']) && is_numeric($_REQUEST['b']))
{
$fp = @fsockopen('127.0.0.1', 1000, $errno, $errstr, 3);
if($fp)
{
fputs($fp, chr($_REQUEST['r']).chr($_REQUEST['g']).chr($_REQUEST['b']));
}
else
{
die('<b>Error('.$errno.'):</b>'.$errstr);
}
}
header('Location: ../LEDToy');
?>