vivavilla.blogg.se

Arduino idea
Arduino idea




arduino idea

arduino idea

ARDUINO IDEA SERIAL

This is the part of serial communication, I defined “ser” variable to store data from serial communication, and set for com 7, and 96oo as a com port and baud rate speed respectively. def quit(): global tkTop ser.write(bytes('L', 'UTF-8')) stroy() def set_button1_state(): b += 1 t("LED ON ") ser.write(bytes('H', 'UTF-8')) t(b) print(b) def set_button2_state(): t("LED OFF") ser.write(bytes('L', 'UTF-8') Set_button2_state (OFF Button)> To send character “L” to arduino, perhaps turn off an LED. Set_button1_state (ON Button)> To send character “H” to arduino, perhaps turn on an LED. Quit (Quit Button) > To exit the app whenever we want

arduino idea

Serial > To communicate between arduino and python. Let’s see in python code, I’ve imported 3 modules serial, time, tkinter






Arduino idea