Tonight I worked on the electronics for my cell sculpture. The DC vibration motor is controlled by the adafruit motor shield (v2). The motor will be triggered by a pushbutton to turn it on for 10-15 seconds, its’ overall speed controlled by a potentiometer. The button will also cause a white LED strip (backlighting) to fade in, then fade out after the motor finishes. Here’s what the wiring looks like (DC motor not pictured):
Here is the arduino code:
//For use with the Adafruit Motor Shield v2
*/
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include “utility/Adafruit_MS_PWMServoDriver.h”
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);
// Select which ‘port’ M1, M2, M3 or M4. In this case, M2
Adafruit_DCMotor *myMotor = AFMS.getMotor(2);
// You can also make another motor on port M2
//Adafruit_DCMotor *myOtherMotor =…
View original post 121 more words