Welcome to Raspbot V2 repository
当製品の日本語版マニュアル資料は、こちらからご取得ください。
8.IR control key value printing
8.IR control key value printing
8.IR control key value printing1. Learning objectives2. Experimental preparation3. Core code analysis4. Experimental phenomenon
1. Learning objectives
Read the key values of the infrared remote control and print them out.
2. Experimental preparation
As shown in the figure below, the infrared receiver module is an onboard component and does not require external connection.

Infrared remote control and its key values

3. Core code analysis
Raspbot_Lib library functions required to control the infrared function:
xCtrl_IR_Switch(state)
Parameter explanation: state=0: turn off the infrared function, state=1: turn on the infrared function.
Return value: None.
Source code path: project_demo\03.Basic_car_course
4. Experimental phenomenon
Turn on the robot, open the computer browser to enter the Jupyter lab editor
Enter the source code path, double-click the code to be run

Restart the kernel and clear all outputs

Click the first code block, then click the run button to start running one by one

After the program runs, as the code block runs, we press the infrared remote control button and the corresponding key value will be printed below the program, and the key value of the button can also be seen on the oled screen.