This guide shows you how to use a Motor Driver and IR blocks to drive an RC car. Before starting, make sure you have an IR and Motor Driver blocks attached to your radio and they appear online.
- Add a Car Controller and an IR to your workspace:
- Click on the gear icon of the Car Controller to access the Properties Panel and select the ports of your MotorDriver where you have connected your DC Motors.
- Enter the properties panel of the Infrared block. Add 4 items by clicking on the ‘Add Item’ button 4 times.
- Click on the red record button of each code, when you see the popup window "Waiting an IR code” press one key in your remote control, the icon should then stop flashing and its colour change to green. This indicates that the code has been recognized and stored.
NOTE: You might see a message popup indicating that the IR code hasn’t been decoded properly. This means the virtual block failed to understand the protocol of your remote control. Kitsunei Creator is still able to recognise your IR command but the performance will not be optimal and you may experience scenarios where the system doesn’t react after pressing the same remote control key. As a workaround, try recording multiple items for the same command or alternatively use a different remote control. If you experience this issue, let us know the brand and type of remote control and we will try to add it in a future software update.
- After recording all 4 IR codes, they should appear as green icons. Type the desired name for your IR commands; these names will become inputs in the Logic Maker. Press ‘Save’ to store the changes and close the properties panel.
- Connect the Car Controller as a ‘child’ of the IR. Do this by dragging a connection from the IR’s right output port to the Car Controller’s left input port.
- Enter the Logic Maker of the Infrared Block by double clicking on the red canvas block or clicking on its middle icon.
- Add 4 INPUT and 4 ACTION Gates.
- From the INPUT Gates, select each IR code you previously recorded. And from the ACTION Gates, select the actions of the Car Controller you want to trigger.
- Connect each input to its corresponding action. Click on ‘Apply’ to save your changes.
- You should now be able to press the recorded keys on your remote control to trigger the Car Controller’s actions. If you have DC motors attached to your MotorDriver, they should start rotating as you press the remote control keys.
You might noticed that when turning left or right that the DC motor rotate for an extended period of time. This is due to the timeout period for the Motor Driver Block being by default 400ms. This means for every left or right signal, the motors will rotate the DC Motors for that period. It also mean that small turns left or right are only possible by lowering the timeout period. To do this, please refer to the DC Motor Timeout Period page.