Timeline for Sending binary data to Matlab via serial
Current License: CC BY-SA 4.0
17 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 31, 2021 at 15:00 | history | tweeted | twitter.com/StackArduino/status/1421485804640247814 | ||
| May 17, 2019 at 7:48 | history | edited | VE7JRO | CC BY-SA 4.0 |
Fixed syntax highlighting.
|
| Nov 11, 2014 at 7:57 | comment | added | Martynas | narutov6 please clear your question and problem. From now it is hard to unerstand what is wrong. Be more detail and eliminate all unnecessary parts | |
| Nov 10, 2014 at 20:33 | comment | added | BrettFolkins | if you can read "17" in the serial monitor you sent the characters "1" and then "7", not the binary number 17. | |
| Nov 10, 2014 at 15:14 | history | edited | UserK | CC BY-SA 3.0 |
edited body
|
| Nov 10, 2014 at 15:01 | comment | added | UserK |
Ok, now it works. It was because of a previous sketch uploaded. There were bytes stored in the buffer. The values I was receiving belonged to an old buffer. Maybe xbee.flush() should do the job
|
|
| Nov 10, 2014 at 14:54 | comment | added | UserK | The value displayed on the serial monitor is 16 | |
| Nov 10, 2014 at 14:51 | history | edited | UserK | CC BY-SA 3.0 |
added 459 characters in body
|
| Nov 10, 2014 at 14:36 | comment | added | Martynas |
Add Serial.println(getData,HEX); after getData = xbee.read(); and say what you get
|
|
| Nov 10, 2014 at 14:32 | comment | added | UserK | Yes exactly. Every time I click a button in MATLAB, it sends 16. Arduino receives it and responds with 17 twice. The values sent are completely different from each other. It doesn't make sense... Is the software serial library the problem? | |
| Nov 10, 2014 at 14:28 | comment | added | Martynas |
xbee.write(message, sizeof(message)); this shows in MatLab as 75,70??? Not sure but try to check baud rates or so. I just can't see what is wrong..
|
|
| Nov 10, 2014 at 14:25 | comment | added | UserK | The range is +/- 5000. I am able to receive data from Matlab. I've done the test with XC-TU to see the hex values sent from Arduino and as you can see, the boards sends every time different values. (Red ones) XC-TU and matlab receive the same data. | |
| Nov 10, 2014 at 7:55 | comment | added | Martynas |
I think the problem is in Matlab. You send data from string so String a = "1"; is byte 31. Make a debug, add Serial.println(getData,HEX); and see what are you getting
|
|
| Nov 10, 2014 at 7:25 | comment | added | Martynas | what is the range of your number? | |
| Nov 9, 2014 at 22:15 | history | edited | UserK | CC BY-SA 3.0 |
deleted 39 characters in body
|
| Nov 9, 2014 at 21:19 | review | First posts | |||
| Nov 9, 2014 at 21:20 | |||||
| Nov 9, 2014 at 21:14 | history | asked | UserK | CC BY-SA 3.0 |