Hello!
I am working with CWNano. I am having trouble to figure out how to receive two messages from the microcontroller into Python.
A simple example code snippet I am trying to implement is the following:
uint8_t mytest[4];
mytest[0]=1;
mytest[1]=2;
mytest[2]=3;
mytest[3]=4;
simpleserial_put('q', 4, (uint8_t*)mytest);
mytest[0]=4;
mytest[1]=5;
mytest[2]=6;
mytest[3]=7;
simpleserial_put('x', 4, (uint8_t*)mytest);
It goes without saying that this is just a snippet of C code from the microcontroller.
I would expect to receive “q 1 2 3 4” on the client side (jupyter) and then through a second read_with_errors “x 4 5 6 7”.
val = target.simpleserial_read_witherrors('q', 4, glitch_timeout=20)
print(val)
val2 = target.simpleserial_read_witherrors('x', 4, glitch_timeout=20)#For loop check
print(val2)
However, what actually happens is that I do receive the following:
I have tried adding a delay on the microcontroller side, but it did not fix the issue.
I would really appreciate any possible suggestion in order to fix this.
Thank you in advance for your help -and I apologize if this something very easy that I should have figured out through reading the documentation.