I'm new to Roomba Create2.
I just want the program to send and receive data of the bumper sensor only.
I tried this code on an Arduino Uno:
#include <SoftwareSerial.h>
#include "roombaDefines.h"
int rxPin = 10;
int txPin = 11;
int sensorbytes;
SoftwareSerial Roomba(rxPin, txPin);
void setup()
{
Roomba.begin(19200);
Serial.begin(9600);
pinMode(ddPin, OUTPUT);
wakeUp (); // Wake-up Roomba
startSafe(); // Start Roomba in Safe Mode
setPowerLED(128, 255);
delay(1000);
setPowerLED(128, 0);
delay(1000);
}
void loop()
{
Roomba.write(142);
Roomba.write(7);
delay(100);
sensorbytes = Roomba.read();
if (sensorbytes!=0 )
{
setPowerLED(255,255);
Serial.println(sensorbytes);
}
else
{
setPowerLED(255,0);
Serial.println("not_Press");
}
delay(100);
}
The robot code works fine for a period of time but after about two minutes I got some weird data from the robot (it shows in my serial monitor) and it makes my program seem to delay and crash.
So I tried to check where it comes from
void loop()
{
int i = 0;
while(Roomba.available() ) {
byte c = Roomba.read();
sensorbytes = c;
Serial.println(sensorbytes);
i++;
}
delay(150);
}
to check that the robot sends data via the serial port or not. Even if I don't command it, I get a packet of data, maybe every two minutes:
32
32
32
32
70
108
97
115
104
32
67
82
67
32
115
117
99
148
205
205
233
32
48
120
48
32
40
48
120
48
41
10
13
and it is the same. So I think that the Roomba Create2 will send data via the serial port every two minutes.
Can I avoid that data?
can i avoid that data ??
... it is unclear what you are asking ..... are you asking how to stop roomba from sending it? $\endgroup$32
is asciispace
and decimal10
and13
is asciinewline
andcarriage return
............. put the values into a single string32 32 32 32 70 108 97 115 104 32 67 82 67 32 115 117 99 148 205 205 233 32 48 120 48 32 40 48 120 48 41 10 13
............... then convert to ASCII at a site like this on branah.com/ascii-converter ............. the result is this. Flash CRC suc ÍÍé 0x0 (0x0)
...... it looks like a part of a response to a command $\endgroup$