|
|
@ -15,12 +15,11 @@ void setup()
|
|
|
|
void loop()
|
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for(uint8_t i = 0; i < 3; i++) {
|
|
|
|
for(uint8_t i = 0; i < 3; i++) {
|
|
|
|
uint8_t val = (uint8_t)analogRead(i)/4;
|
|
|
|
int val = analogRead(i)/4;
|
|
|
|
|
|
|
|
|
|
|
|
if(val >= lastval[i]+3 || val <= lastval[i]-3){
|
|
|
|
if(val >= lastval[i]+3 || val <= lastval[i]-3){
|
|
|
|
uint8_t msg[2] = { val, i };
|
|
|
|
uint8_t msg[2] = { val, i };
|
|
|
|
|
|
|
|
|
|
|
|
Serial.println(msg);
|
|
|
|
|
|
|
|
driver.send((uint8_t *)msg, 2);
|
|
|
|
driver.send((uint8_t *)msg, 2);
|
|
|
|
driver.waitPacketSent();
|
|
|
|
driver.waitPacketSent();
|
|
|
|
|
|
|
|
|
|
|
|