Permalink
Browse files

debugging

  • Loading branch information...
1 parent 5571db7 commit f9bba9a733def89d2c922456761d96dff631cc73 @mmastria committed Feb 18, 2012
@@ -1,21 +1,30 @@
#include "LabDome.h"
+///////////////////////////////////
+// REMOVER -- APENAS PARA TESTES
+//#include "LabBeep.h"
+//#define BEEPER 10
+//LabBeep beepx(BEEPER);
+///////////////////////////////////
+
+
LabDome::LabDome() {
}
void LabDome::doEvent() {
bool tx, fail, rx;
_radioPtr->whatHappened(tx, fail, rx);
if (tx) {
- printf("<tx> Data Sent OK\n\r");
+ printf("<tx> Data Sent OK: %s\n\r", command.getName());
}
if (fail) {
- printf("<fail> Data Failed to Sent\n\r");
+ printf("<fail> Data Failed to Sent: %s\n\r", command.getName());
}
if (tx || fail) {
- _radioPtr->powerDown();
+ //_radioPtr->powerDown();
}
if (rx) {
+ printf("<rx> ...");
unsigned long started_waiting_at = millis();
bool timeout = false;
bool done = false;
@@ -56,26 +65,32 @@ void LabDome::doTest() {
command.cmd=SHUTTER_EVENT_OPEN;
printf("\n\r> Call: %s\n\r", command.getName());
_radioPtr->startWrite(&command, sizeof(command));
+ //beepx.play();
delay_ms(4000);
command.cmd=SHUTTER_EVENT_STOP;
printf("\n\r> Call: %s\n\r", command.getName());
_radioPtr->startWrite(&command, sizeof(command));
+ //beepx.play();
delay_ms(4000);
command.cmd=SHUTTER_EVENT_CLOSE;
printf("\n\r> Call: %s\n\r", command.getName());
_radioPtr->startWrite(&command, sizeof(command));
+ //beepx.play();
delay_ms(4000);
command.cmd=SHUTTER_STATE;
printf("\n\r> Call: %s\n\r", command.getName());
_radioPtr->startWrite(&command, sizeof(command));
+ //beepx.play();
delay_ms(4000);
command.cmd=SHUTTER_EVENT_STOP;
printf("\n\r> Call: %s\n\r", command.getName());
_radioPtr->startWrite(&command, sizeof(command));
+ //beepx.play();
+ //beepx.play();
delay_ms(4000);
}
@@ -54,7 +54,7 @@ void encoderEvent() {
}
void domeEvent() {
- beep.play();
+ //beep.play();
dome.callEvent();
}
@@ -71,7 +71,7 @@ void setup()
printf("\n\rLabDomeApp\n\r");
printf("release 0.1 - 2012-feb-11\n\r");
printf("serial log 57600,n,8,1,p\n\r\n\r");
- beep.play();
+ //beep.play();
switchHome.setComponent(&encoder);
irReceiver.setComponent(&dome);
@@ -88,9 +88,9 @@ void setup()
}
void loop() {
- irReceiver.decode();
+ //irReceiver.decode();
dome.doTest();
- printf("\n\r");
+ printf("\n\r--------------------\r\n");
delay(5000);
}
@@ -52,7 +52,8 @@ void switchClosedEvent() {
}
void shutterEvent() {
- beep.play();
+ //beep.play();
+ printf("> shutterEvent\n\r");
shutter.callEvent();
}
@@ -68,7 +69,7 @@ void setup() {
printf("\n\rLabShutterApp\n\r");
printf("release 0.1 - 2012-feb-11\n\r");
printf("serial log 57600,n,8,1,p\n\r\n\r");
- beep.play();
+ //beep.play();
switchOpened.setComponent(&relayOpen);
switchClosed.setComponent(&relayClose);
@@ -10,7 +10,7 @@ do
mv $j ..
ln -s ../$j
done
- ls -lah
+ #ls -lah
echo .
echo . ...............................
echo .

0 comments on commit f9bba9a

Please sign in to comment.