Hello everybody,
I'm having a lot of issues trying to send to the serial monitor the output from the Mitutoyo Protractor PRO-3600.
According to the manual, the PRO-3600 has a 5V serial output, 9600 bps 8N1 with ASCII format. However, I'm not getting the right values. Some values are higher than 127.
The manual is here
The output format: XXX.XX , 9 bytes as I understand.
I wrote a simple sketch in a MEGA2560:
#define REQ 5
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial3.begin(9600);
pinMode(REQ, OUTPUT);
digitalWrite(REQ, LOW);
delay(100);
Serial.println("Ready!");
digitalWrite(REQ, HIGH);
}
int count = 0;
void loop() {
// put your main code here, to run repeatedly:
while(Serial3.available() > 0)
{
byte c = Serial3.read();
Serial.print(c, DEC);
Serial.print(" ");
if (count++ == 8)
{
Serial.println();
count = 0;
}
}
}
The serial monitor shows:
Output:
105 235 159 163 151 151 229 235 0
105 251 171 163 159 145 229 235 0
106 203 153 163 151 153 229 235 0
106 139 159 163 153 147 229 235 0
106 219 153 163 149 145 229 235 0
105 219 159 163 153 149 229 235 0
106 251 155 163 151 155 229 235 0
Byte number:
0 1 2 3 4 5 6 7 8
Byte 0, sometimes change while moving the PRO-3600 between 105 and 106, I'm guessing that byte represents the sign.
Bytes 4, 6, 7 and 8, never change. So, according to the format, I'm guessing that they represent the decimal point, carriage return and line feed. The '0' I don't know.
The maximum value showed in the PRO-3600 display is 90.0° and the minimum is 0.00°
Do you guys have any idea of what I'm doing wrong?
Thanks in advance!
Efel