Más contenido relacionado La actualidad más candente (20) Similar a 無線聲控遙控車 Wireless Voice control Car (20) Más de IttrainingIttraining (20) 無線聲控遙控車 Wireless Voice control Car6. 車子 Pi
Wi-Fi
Control System
Input command queue
Xbox driver
UDP Server
Thread
LIRC
pthread
Motor Control
{start, stop, right, left}
轉速: PWMx2
Socket
IR
軟體架構
IR Thread
Main Thread
12. Userspace Xbox Gamepad Driver
Joystick toolset
Bluetooth Xbox Controller
Raspberry Pi
Bluetooth Xbox Controller
14. 紅外線遙控
●硬體:
●一. Raspberry Pi 3 B+板
●二.艾鍗Ras Pi V3.0擴充板(IR接收器)
●三.紅外線遙控器 一隻
●軟體:
●一. LIRC套件(參考http://www.lirc.org/ )
●二. 使用語言( C 語言 )
IR接收器
(GPIO17)
17. PWM 0
ENA
GPIO 6
L298N (GPIO & PWM)
正轉
逆轉
IN1
IN2
轉速
GPIO 5
IN1
(GPIO5)
IN2
(GPIO5)
ENA
(PWM0)
1 0 800
1 0 500
左 輪
IN3
(GPIO13)
IN4
(GPIO26)
ENB
(PWM1)
1 0 500
1 0 800
右 輪
Car
Direction
右轉
左轉
28. 紅外線遙控 : LIRC安裝
●sudo apt-get install lirc
●修改/etc/modules
● sudo nano /etc/modules
● lirc_dev
● lirc_rpi gpio_in_pin=17
31. 紅外線遙控 : IR 接收測試紅外線遙控 : LIRC安裝(4)
讓Raspberry Pi重新開機
reboot
載入lirc模組
sudo modprobe lirc_rpi
檢查lirc是否有載入成功
sudo /etc/init.d/lircd status
測試接收
mode2 -d /dev/lirc0
按遙控器看是否有接收到
32. 紅外線遙控 : IR 資料錄製
●
錄製IR key
sudo irrecord -n -f -d /dev/lirc0 ~/lircd.conf
參閱https://blog.csdn.net/waterseason/article/details/84916642
將錄好的資料搬至 /etc/lirc
sudo cp ~/xx.lircd.conf /etc/lirc/lircd.conf
使用irw測試是否正常