Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char dataString[50] = {0};
- int a =0;
- void setup() {
- Serial.begin(9600); //Starting serial communication
- }
- void loop() {
- a++; // a value increase every loop
- sprintf(dataString,"%02X",a); // convert a value to hexa
- Serial.println(dataString); // send the data
- delay(1000); // give the loop some break
- }
- import serial
- ser = serial.Serial('/dev/ttyUSB1',9600)
- s = [0,1]
- while True:
- read_serial=ser.readline()
- s = str(int (ser.readline(),16))
- print(s)
- print(read_serial)
Add Comment
Please, Sign In to add comment