hpr1908 :: Arduino Pumpkin
droops talks about how his class built a pumpkin that comes alive for halloween.

Hosted by droops on Wednesday, 2015-11-25 is flagged as Clean and is released under a CC-BY-NC-SA license.
Arduino, Arduino Uno, LED, pumpkin, Halloween.
1.
Listen in ogg,
opus,
or mp3 format. Play now:
Duration: 00:07:28
Download the transcription and
subtitles.
Arduino and related devices.
In this series various contributors talk about how to use and program Arduino single-board microcontrollers and related devices.
See the Wikipedia article
https://en.wikipedia.org/wiki/List_of_Arduino_boards_and_compatible_systems for details of the range of devices.
Code for Pumpkin
int ledPin1 = 5;
int ledPin2 = 6;
int motorPin = 8;
int lightPin = 3;
int lightVal;
int potPin = 0;
int potVal;
void setup(){
Serial.begin(9600);
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(motorPin, OUTPUT);
pinMode(potPin, INPUT);
pinMode(lightPin, INPUT);
digitalWrite(ledPin1, LOW);
digitalWrite(ledPin2, LOW);
digitalWrite(motorPin, LOW);
}
void loop(){
potVal = analogRead(potPin);
lightVal = analogRead(lightPin);
Serial.println(lightVal);
if (lightVal < potVal){
animate();
}
}
void animate(){
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin2, HIGH);
digitalWrite(motorPin, HIGH);
delay(100);
digitalWrite(ledPin1, LOW);
digitalWrite(ledPin2, LOW);
digitalWrite(motorPin, LOW);
}