Hi
I use a HC-SR04 ultrasonic-sensor with a arduino nano and send a range between 0-25 via Serial to my axoloti.
in my axoloti I have this script/script2-object connected to a disp/i .. and a disp/chart_b
this is my code:
void setup(void) {
}
void loop(void) {
// send a single byte, value from in1
sdPut(&SD2, 220);
// read all pending bytes, value to out1
while(!sdGetWouldBlock(&SD2)) {
out1 = sdGet(&SD2)<<21;
}
chThdSleepMilliseconds(3);
}
somehow the recieved values are wierd.. the disp/i only goes from 53-47 and jumps every time up to 53.
why is that? do I hae to terminate the values I am sending somehow?