Project: Physical Computing

Balloon journey

Using Stepper Motor & potentiometer¬†to bring the balloon move around others destinations ¬†( inspired by Moe floating doggie snack!! ) Here is the code : #define DIR_PIN 2 #define STEP_PIN 3 #define anaPin A0 int sensorValue = 0; void setup() { pinMode(DIR_PIN, OUTPUT); pinMode(STEP_PIN, OUTPUT); pinMode(anaPin, INPUT ); } void loop(){ sensorValue = analogRead(anaPin); //rotate a specific number of degrees if ( sensorValue >=0 && sensorValue <= 1023) { sensorValue = sensorValue+1; } rotate(sensorValue*8, .1); delay(100); rotate(-sensorValue*8, .1); delay(1000); } void rotate(int steps, float speed){… More

KIT KAT CHALLENGE

#define buttonPin 7 #define ledPin 8 #define anaPin A0 int sensorValue = 0; int maValue = 1; void setup() { pinMode( ledPin, OUTPUT ); pinMode( buttonPin, INPUT ); pinMode( anaPin, INPUT ); } void loop() { sensorValue = analogRead (anaPin); boolean btnState = digitalRead( buttonPin ); if ( sensorValue >= 100 && sensorValue <=220 ) { maValue = 0; digitalWrite( ledPin, maValue); } else { maValue = 1; } if ( btnState == HIGH && maValue == 0 ) { digitalWrite( ledPin, HIGH );… More