Hi, I’m trying to use jetson as companion computer on Drone.
I have to use all of USB ports eventhough UART pin headers.
My problem came with arduino. When I tried to communicate with Arduino by using pyserial.
These are my code.
Arduino
int LED = 3;
void setup() {
Serial.begin(9600);
pinMode(LED, OUTPUT);
}
void loop() {
while(Serial.available()>0){
int integer = Serial.parseInt();
if(integer==1){
digitalWrite(3, HIGH);
delay(1000);
}
digitalWrite(3,LOW);
}
python3 serial_test.py
import serial
ser = serial.Serial(‘/dev/ttyACM0’, 9600)
ser.write(b’1’)
As you know there is no problem, but I couldn’t see blinked LED but RX light was blinked when I wrote ‘1’.
So I tried with console like
then It worked well…Is there any reason about it? I wanna know specific reasons. and I have to command from script not console.
Thank you