stronk_8s

UART RPI DIRECT

Nov 24th, 2025 (edited)
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | Source Code | 0 0
  1. import serial
  2. if name=='main':
  3. ser=serial.Serial('/dev/ttyACM0',9600,timeout=1)
  4. ser.flush()
  5. while True:
  6. if ser.in_waiting>0:
  7. line=ser.readline().decode('utf-8').rstrip()
  8. print(line)
  9.  
  10.  
  11.  
  12. //ARDUINO
  13.  
  14. void setup()
  15. {
  16. Serial.begin(9600);
  17. }
  18. void loop()
  19. {
  20. Serial.println("Hello From Arduino!");
  21. delay(1000);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment