This project is an auto shoot cannon based on direnjie kit and MoonBot structure parts. MU vision sensor 3 is fixed on top of the cannon that can recognize the coordinates of the target. So that the controller can control the servos and water gun to aim and shoot the target until clear.
A water gun
MU vision sensor 3
Lipo battery + 18650 Power Li battery
Target with MU number cards
This is the auto cannon. The hardware is from direnjie kit and structure is from MoonBot Kit. Other bracket parts can be 3d printed. Number cards are sticked to the original electric target so that the target can be recognized by MU.
Firstly the peripherals should be set, including servos and MU.
Move servos in horizontal direction to search card in the vision sight.
When MU find a card, the program turns into aim function. Move servos slowly to adjust the position between cannon and card.
Simply control the P7 pin to shoot for 0.5 seconds. Time can be modified to save the bullet.
Combine the above functions and make the program repeatly.
Cannon can be settled by Blynk app through BLE. Put the loop program to blynk blocks. When touch the button on the phone, auto shoot program can be launched.
Firstly, servos move to central position. The cannon moves from left to right and scan the target in the mean time. When meeting the number card, program turns into aim function. When verify the target position is within 48 to 52 position, shoot for 2 seconds and return to search function again.