I am new to the Arduino but have several plans involving serial communication. I have been going through some of the tutorials and modifying them a bit to learn a little more specifics but am running into some problems with it.
I have the arduino just turning on and off an led when when it gets a 'y' or 'n' from the serial connection. When I start the python interpreter I can open the connection using s = serial.Serial('/dev/ttyUSB', 9600) and then turn the light off and on using s.write() but this wont work at all when the commands are put into a python script run from the command line. However, if I open the connection in the interpreter in one terminal then open another terminal everything works, the script and even redirecting the standard output to the device. Anyone know why this is? Another thing is that when I run the script without the connection open in another terminal the TX and RX lights light up and the 'L' led also blinks twice but the led im trying to turn on and off does not do anything.
#! /usr/bin/env python
ser = serial.Serial('/dev/ttyACM0', 9600)
I run this with a command line argument of either 'y' or 'n' which works only if the connection is open in a second terminal.
Hopefully this isnt too stupid of a question.