Case 11: Feed at Fixed Time
Contents
13. Case 11: Feed at Fixed Time#
13.1. Introduction#
Feeding animals in manual is not convenient, we can make a device that could feed them at fixed time.
13.2. Function#
Make the timing with RTC module and program to drive the servo for feeding at the fixed time.
13.3. Products Link#
13.4. Picture#
13.5. Hardware Connection#
Connect the servo to P1, and the OLED to IIC on IoT:bit.
13.6. Software Programming#
Click “Advanced” in the MakeCode to see more choices.
For programming, we need to add a package: click “Extensions” at the bottom of the MakeCode drawer and search with “iot-environment-kit” in the dialogue box to download it.
For programming, we need to add a package: click “Extensions” at the bottom of the MakeCode drawer and search with “neopixel” in the dialogue box to download it.
Notice: If you met a tip indicating that some codebases would be deleted due to incompatibility, you may continue as the tips say or create a new project in the menu.
13.7. Program#
Initialize the OLED display as 128×64m and the time settings of RTC module, set the sevo to drive to 0°.
Display the current seconds on OLED screen.
If the second is 1, set the servo to drive to 90°, pause 5000ms and then set the servo to drive to 0°.
13.8. Result#
The device makes the feeding every 1 minute.