Hi
I'm playing with the API version of the sketch.
While it seems FromHS works fine, it seems I'm doing something wrong with SendToHS.
I've created a simple circuit with one button and a LED.
RX from HS is tested reading a variable and if true, printing to Serial.
TX to HS is tested sending to HS the status of the LED (1/0).
While this value is correctly printed on the Serial, HS instead always shows 0
(Board 2, Device Ref = 149, API Input 1, Value = 0)
I'm using Available Sketch Version = 1.0.0.127, API Version = API1.0.0.118
and IDE 1.6.8 for MacOSX
Any idea what I am doing wrong?
I'm playing with the API version of the sketch.
While it seems FromHS works fine, it seems I'm doing something wrong with SendToHS.
I've created a simple circuit with one button and a LED.
RX from HS is tested reading a variable and if true, printing to Serial.
TX to HS is tested sending to HS the status of the LED (1/0).
While this value is correctly printed on the Serial, HS instead always shows 0
(Board 2, Device Ref = 149, API Input 1, Value = 0)
I'm using Available Sketch Version = 1.0.0.127, API Version = API1.0.0.118
and IDE 1.6.8 for MacOSX
Any idea what I am doing wrong?
Code:
/*Execute regardless of connection status*/ if (alert=FromHS[0]){ //test RX from HS Serial.println("ALERT"); } val = digitalRead(BUTTON); // read button // check if something has changed if ((val == HIGH) && (old_val == LOW)){ status = 1 - status; } old_val = val; // update old_val if (status == 1) { digitalWrite(LED, HIGH); // led ON } else { digitalWrite(LED, LOW); // led OFF } Serial.println(status); SendToHS(1,status);
Comment