Änderungen

Aus Hackerspace Ffm
Wechseln zu: Navigation, Suche

Arduino IDE like serial monitor in the Raspberry Pi shell

399 Byte hinzugefügt, 18:01, 8. Apr. 2014
For serial communication with an Arduino I wanted a an Arduino IDE like serial monitor in the Raspberry Pi shell. Since I could not a find a terminal that did support “line mode” I found another workaround. It’s a quite simplistic approach.'''Don't forget the levelshifter when your Arduino runs on 5V!!!'''
Reboot the system.
'''Source:'''[https://github.com/watterott/RPi-ShieldBridge/blob/master/docu/Arduino.mdgithub.com/watterott/RPi-ShieldBridge]
Then I run the serial.sh script (you need all three for this to work)
Explenation:==Explanation==
<pre>stty -F /dev/ttyAMA0 cs8 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts</pre>
'''Source:'''[http://playground.arduino.cc/Interfacing/LinuxTTY playground.arduino.cc/Interfacing/LinuxTTY]This one i basicaly copy and pasted it, without understanding it. It gets the serial interface in the right mode to talk to an Arduino (with 115200 baud)
I use :
<pre>cat -A /dev/ttyAMA0</pre>
to listen to the serial port.
Unfortunately there are some unwanted characters at the end of a line. I’m not sure why, but I just replaced them with a space. (That way they just do not any me anymore)
 
To get data to the Serial port I use:
<pre>echo "$a" > /dev/ttyAMA0</pre>
 
I use tmux split screen to be able to see both at the same time.
 
 
All of this is probably not a clean or nice solution, but it does what I wanted it to do.
 
[[Kategorie:Projekte]]
1.955
Bearbeitungen