Skip to content

Instantly share code, notes, and snippets.

@omiq
Created March 27, 2018 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omiq/acc7c7db89bba6251e9beb40cbe1f5c7 to your computer and use it in GitHub Desktop.
Save omiq/acc7c7db89bba6251e9beb40cbe1f5c7 to your computer and use it in GitHub Desktop.
Example of sending strings to Arduino over USB
import serial
import time
from datetime import datetime
print("Starting ...")
# change the port to whichever shows in Arduino
tardis = serial.Serial('/dev/ttyACM0', baudrate=9600)
while(1):
tardis.write(str(datetime.now()).encode())
time.sleep(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment