Quick reference for the openmvcam - MicroPython 1.13 documentation
PWM Reference
class Signal - control and sense external I/O devices - MicroPython 1.13 documentation
Controlling and sensing external I/O devices Reference
Lab: DC Motor Control Using an H-Bridge
Always a great resource for all things PComp.
Started by setting up circuit with 1 LED to make sure the code was correct. I used the example code provided by Pedro to get started then, using the above I/O reference, I had the LED on P9 go HIGH when a face was detected.
Next I added once 3v 85mA DC vibration motors, a 2N3905, 1KΩ resistor and 50V 1mA diode (flyback diode) to the board. I was successfully able to activate the motor when a face was detected. I also powered the board through the 3.3V pin (250mA max).
https://s3-us-west-2.amazonaws.com/secure.notion-static.com/eff9855b-000b-44b8-8e6e-9c5f68635f47/IMG_2188.mp4
I plan to power the 5V supply from the Raspberry Pi once I get the full circuit running because I want to use 4, possibly 8, motors in total.
Could I map to the screen? Could I have the left motors vibrate when someone is on the left side of the Frame Buffer? Is that possible?
Motor and LED/Button:
Since I am using the Button connection in the AIY Kit within my project, I need to add those two together. Originally I was using P6 for this action but since it is an ADC (analogue to digital) pin, I will use a different pin.
What digital sensor could I use with this project? Using P6
If a face is detected, the motor pin will be HIGH and the LED pin will be LOW.
If no face is detected, the motor pin will be LOW and the LED pin will be HIGH.
https://s3-us-west-2.amazonaws.com/secure.notion-static.com/16fca3da-98bb-4c93-8626-ebe04cccbb69/IMG_2190.mp4