Saturday, 27 April 2019

Motors

Motors with the Circuit Playground Express

You can use a crickit

Useful board information:

https://www.electrokit.com/uploads/productfile/41016/adafruit-circuit-playground-express.pdf


Or for one or two:

https://blog.adafruit.com/2012/05/30/ask-an-educator-how-can-i-control-a-solenoid-or-motor-with-an-h-bridge/

You need a 5 v power supply for the dc motor with h-bridge chip.

You will use two outputs on the circuit playground for one DC motor.  In Makecode under "pins", you will find "analog write pin <A0> to".  Use that to set the output you've chosen as an analog output.  Then use "analog set period pin <A0> to" to set the period (how long each pulse is) in microseconds - invert that to get the frequency eg 5000 usec happens 1/5000usec or

All Grounds Connected

You MUST connect the ground for the h-bridge chip to the ground for the circuit playground express.  Floating grounds or grounds at different levels are BAD and make it really hard to see what's one wrong.