Today, I focussed on another example from IQRF Startup package – Servo control. You will find this example inside Advanced examples of Startup package. You can use this user code together with ADC example described earlier and make automatic wireless control device.
What you need:
- CK-USB-04 (as communication part), 1pc
- DK-EVAL-04 (as driver), 1pc
- TR-52D (or another type of TR), 2pcs
- servo SG90 for example
- Breadboard Connection Test Cables or something similar.
Let’s move servo
- Make a new IQRF project
- Copy attached source file, header files folder and macro file into a common directory.
- Add source file to project.
- Build project and upload to TR.
- Make wiring (VCC of servo – probably red wire to DK-EVAL-04 pin 10, GND of servo – probably black or brown to DK-EVAL-04 pin 7, PWM input of servo to DK-EVAL-04 pin 5.)
- Insert TR module to DK-EVAL-04.
- Power-up DK-EVA-04 by wall adapter or from PC. This action is necessary!!!
- Import macro to IQRF IDE.
- Connect CK-USB-04 with inserted TR and uploaded SPI E03-TR example.
- Set “Use Numbers” inside Terminal to checked mode.
- User macros and send button to servo steering.
- Enjoy…
Wires color depends on servo type and manufacturer. Please refer documentation.