Created
June 28, 2015 08:14
-
-
Save anthonyeden/0a4becbde55bf565803f to your computer and use it in GitHub Desktop.
2wcom RDS Commands via Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
def updateRDS(comPort, title, artist, duration): | |
serialConnection = serial.Serial(comPort) | |
serialConnection.write("DURATION=" + str(int(duration)) + "\n") | |
serialConnection.write("STRING1=Now: \n") | |
serialConnection.write("STRING2= by \n") | |
serialConnection.write("FORMAT_RT=STRING1+TITLE+STRING2+ARTIST\n") | |
serialConnection.write("AUTO_RT=Y\n") | |
serialConnection.write("AUTO_RTPLUS=Y\n") | |
serialConnection.write("RT_DELAY=3\n") | |
serialConnection.write("TITLE=" + str(title) + "\n") | |
serialConnection.write("ARTIST=" + str(artist) + "\n") | |
serialConnection.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment