CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 15:33:01 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=3675f73205a31fedab860ac06fbc84998e78b332602a097f2b232ec012457b94a%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22F1Hg1NvHNUDTbMwovm1t6kXClDYxu6Yz%22%3B%7D; HttpOnly; Path=/
cf-ray: 98cf69d6fd4ec46e-BLR
Serial_Python_LED_on_off - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Подключение к Arduino
- arduino = serial.Serial(port='COM12', baudrate=9600, timeout=1)
- # Для Linux/Mac: port='/dev/ttyUSB0' или '/dev/ttyACM0'
- def write_read(x):
- arduino.write(bytes(x, 'utf-8'))
- time.sleep(0.05)
- data = arduino.readline()
- return data #что-то возвращаем...
- try:
- while True:
- # Чтение данных с Arduino
- if arduino.in_waiting > 0:
- data = arduino.readline().decode('utf-8').rstrip()
- print(f"Arduino: {data}")
- # Отправка данных на Arduino
- user_input = input("Enter command (or 'quit' to exit): ")
- if user_input.lower() == 'quit':
- break
- #arduino.write(f"{user_input}\n".encode('utf-8'))
- if user_input.lower() == 'on':
- arduino.write("on".encode('utf-8'))
- if user_input.lower() == 'off':
- arduino.write("off".encode('utf-8'))
- time.sleep(0.1)
- except KeyboardInterrupt:
- print("Программа завершена пользователем")
- finally:
- arduino.close()
- print("Соединение закрыто")
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐ ✅ Free Products Method ✅ ✅ NEVER SEEN BEFOR...
JavaScript | 1 sec ago | 0.24 KB
-
⭐⭐⭐Profit Method⭐⭐
Java | 7 sec ago | 0.10 KB
-
⭐ G2A Bug ⭐ (Get more on BTC swaps) ✅ NEVER S...
JavaScript | 11 sec ago | 0.24 KB
-
⭐⭐⭐Exploit 500$ in 15 Minutes⭐⭐
Java | 19 sec ago | 0.10 KB
-
⭐✅ Jack's Profit Method ✅ NEVER SEEN BEF...
JavaScript | 22 sec ago | 0.24 KB
-
Free Crypto Method (NEVER SEEN BEFORE)⭐⭐ 0
JavaScript | 26 sec ago | 0.24 KB
-
⭐⭐⭐Profit Method⭐⭐
Java | 30 sec ago | 0.10 KB
-
⭐✅ Online Marketplace Exploit ✅ NEVER SEEN BE...
JavaScript | 31 sec ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand