-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDebugPrinting.hpp
More file actions
49 lines (39 loc) · 1.02 KB
/
DebugPrinting.hpp
File metadata and controls
49 lines (39 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef DebugPrinting_HPP
#define DebugPrinting_HPP
#include "RoombaAI.hpp"
#include "RoombaProperties.hpp"
namespace Debug
{
using namespace RoombaAI;
// Print out the chunks.
void PrintAllChunks( Roomba& roomba )
{
for ( unsigned int i = 0; i < roomba.GetAmountOfChunks(); i++ )
{
RoombaAI::RoombaChunk* rc = roomba.GetAnyChunkAt( i );
Serial.print( F("Chunk at: ") );
Serial.print( rc->posX );
Serial.print( F(", ") );
Serial.println( rc->posY );
}
Serial.println( roomba.GetAmountOfChunks() );
}
// Position of the roomba
void PrintRoombaPos( Roomba& roomba )
{
Serial.print( F("Roomba at: ") );
Serial.println( roomba.GetPosition() );
}
// Pause execution for input in serial
void PauseForInput()
{
while ( true )
{
String d = Serial.readString();
if ( d != "" )
break;
delay( 100 );
}
}
}
#endif