Last active
October 15, 2016 11:56
-
-
Save abhijithanilkumar/12721fb81fbbc3e7d8b3aad4039d0c71 to your computer and use it in GitHub Desktop.
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 pyserial package | |
import serial | |
#open the serial port | |
s = serial.Serial("/dev/ttyACM0") #change port after checking the port in which device is connected | |
#send probe | |
s.write('S') | |
#read ack | |
s.read() | |
#create the bytearray | |
b = bytearray(5) #bytearray of 5 bytes | |
#manipulate bytes as required | |
b[1] = 255 | |
b[2] = 0 | |
#send the data to the port | |
s.write(b[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment