Hi all,
I'm building a system that has to wait for a pin to change to read data from a chip (see code).
My arduino blocks after a few "loop" string prints.
If I comment the while loop it works fine but the data I get from the chip is wrong
Can anyone please help?
int getData(void) {
(...)
while(digitalRead(SDAT) == HIGH) {};
(...)
}
loop (){
data = getData()
if (softserial.available() > 0){
index = softserial.readBytesUntil('\r', inData, 5);
inData[index] = '\0';
Serial.println(inData);
}
Serial.println("loop");
}
Thanks for the comments, but just realized that there is something wrong between my chip communication and arduino.
Sofware serial just triggers it. Since the chip and its communication protocol are not opensource can't show anything else.