Skip to content

Commit

Permalink
Turns out SPI wasn't freezing, its just that the nrf board is always …
Browse files Browse the repository at this point in the history
…returning data available, even with no server running
  • Loading branch information
brandonagr committed Aug 14, 2014
1 parent bdba0d2 commit 6aa32ce
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions arduino/wireless_gondola/src/client.ino
Expand Up @@ -83,30 +83,26 @@ void loop(){
long receiveData;
if (radio.available()) {

readDataFromMirf = 1;
bool result = radio.read(&receiveData, sizeof(long));
// while(radio.read(&receiveData, sizeof(long))) {
radio.read(&receiveData, sizeof(long));

if (result) {
// Serial.print("Got data: ");
// Serial.println(receiveData);

if (receiveData) {
penUpServo.write(150);
// penUpServo.write(150);

currentLedStatus = 1;
digitalWrite(STATUS_LED_PIN, 1);
currentLedStatus = !currentLedStatus;
digitalWrite(STATUS_LED_PIN, currentLedStatus);
blinkDelayMillis = 1000;
} else {
penUpServo.write(0);
// penUpServo.write(0);

currentLedStatus = 1;
digitalWrite(STATUS_LED_PIN, 1);
currentLedStatus = !currentLedStatus;
digitalWrite(STATUS_LED_PIN, currentLedStatus);
blinkDelayMillis = 2000;
}
} else {
// Serial.println("Failed to read");
digitalWrite(STATUS_LED_PIN, 0);
}
// }
}
}

0 comments on commit 6aa32ce

Please sign in to comment.