FireFly 2012: behaviour rewrite now uses the hexapod library
From Electronics\Hexapod\Arduino sketches 2011-2012\FireFly. Data.h, Def.h and SerD.h moved into the library.
This commit is contained in:
1 parent
304367a769
commit
6e50819e01
9 files changed
+84
-465
No files matched your search
@@ -0,0 +1,37 @@
|
||||
// Watchdog.cpp
|
||||
|
||||
#include "Watchdog.h"
|
||||
|
||||
void Watchdog::CheckTime(Data *DataLine)
|
||||
{
|
||||
if ((millis() >= (DataLine->LastSendTime + DataLine->WalkTime)) & (DataLine->ReadyToSend = true ))
|
||||
{
|
||||
DataLine->Send = 1;
|
||||
|
||||
DataLine->LastSendTime = millis();
|
||||
#ifdef DEBUGW
|
||||
Serial.println("### WatchDog->Watchdog ###");
|
||||
Serial.print("### ");
|
||||
Serial.print( millis());
|
||||
Serial.println(" WatchDog->DataLine.Send = True");
|
||||
Serial.print("### WatchDog->Watchdog Walktime: ");
|
||||
Serial.println(DataLine->WalkTime);
|
||||
#endif
|
||||
}
|
||||
else if ((DataLine->LastSendTime == 0 ) & (DataLine->ReadyToSend = true))
|
||||
{
|
||||
DataLine->Send = 1;
|
||||
|
||||
DataLine->LastSendTime = millis();
|
||||
#ifdef DEBUGW
|
||||
Serial.println("### WatchDog->Watchdog Startup ###");
|
||||
Serial.print("### ");
|
||||
Serial.print( millis());
|
||||
Serial.println(" WatchDog->DataLine.Send = True");
|
||||
Serial.print("### WatchDog->Watchdog Walktime: ");
|
||||
Serial.println(DataLine->WalkTime);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// Watchdog.h
|
||||
// V3.0
|
||||
|
||||
#ifndef WATCHDOG_H
|
||||
#define WATCHDOG_H
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "Data.h"
|
||||
|
||||
class Watchdog
|
||||
{
|
||||
public:
|
||||
void CheckTime(Data *DataLine);
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user