Here is the code we are going to use for the bubble machine:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//BUBBLE MACHINE | |
//Linda Pratto, Thomas Monaghan, Kevin Healy, Joshua Gardner | |
//Red LED connected to pin 13: | |
const int ledPin = 13; | |
#include <Servo.h> // servo library | |
Servo servo1; // servo control object | |
//DC Motor connected to pin 9: | |
const int motorPin = 9; | |
void setup() | |
{ | |
//Set up the LED as an output | |
pinMode(13,OUTPUT); | |
//Servo motor connected to pin 10: | |
servo1.attach(10); | |
//DC motor defined as output | |
pinMode(motorPin, OUTPUT); | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
//LED starts out off | |
digitalWrite(13, LOW); | |
delay(500); | |
//servo motor starts out in the vertical position | |
int position; | |
servo1.write(90); | |
delay(2000); | |
//rotates to the horizontal position, then returns to vertical | |
servo1.write(0); | |
delay(2000); | |
//LED turns on | |
digitalWrite(13, HIGH); | |
delay(500); | |
int onTime = 5000; // milliseconds to turn the motor on | |
int offTime = 2000; // milliseconds to turn the motor off | |
digitalWrite(motorPin, HIGH); // turn the motor on (full speed) | |
delay(onTime); // delay for onTime milliseconds | |
digitalWrite(motorPin, LOW); // turn the motor off | |
delay(offTime); // delay for offTime milliseconds | |
} |
Next, we designed the mount for the servo motor:
We want to reduce the height of the mount and simplify it to use less material.
Next, we designed the dish that we will use for the bubble juice:
This part may also be changed once we find out if it needs to be more wide or shallow.
The last part we designed this week is a bracket for the DC Motor:
No comments:
Post a Comment