link:
link:
Part 1. Archimede's drill
link:
link:
Part 2. Case for the drill
link:
link:
Part 3. Case for a DC Motor
This shows a cross section of the assembly made from the screw and screw casing. When rotating this will ideally be facing upwards at approximately a 30 degree angle.
link:
link:
Assembly (Archimede's Drill)
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
#include <Servo.h> // includes the servo library | |
Servo servo1; // assigns servo variable | |
int buttonpin = 2; // assigns button to pin 2 on the redboard | |
int press1; // creates a variable to count button presses | |
int potPin = A0; // assigns potentiometer to pin 0 | |
int motorPin = 9; // assigns DC motor to pin 9 | |
int potValue = 0; // creates a variable to track potentiometer value | |
int motorValue = 0; // creates a variable to track DC motor value | |
void setup() { | |
Serial.begin(9600); | |
servo1.attach(10); // assigns servo motor to pin 10 | |
pinMode(buttonpin, INPUT); // assigns pushbutton as an input | |
digitalWrite(2, HIGH); // sets button state to high when not pressed | |
} | |
void loop() { | |
press1 = digitalRead(buttonpin); // determines if button is being pushed | |
if (press1 == LOW){ // if button is pressed tells the servo to rotate to 179 degrees, wait one second return to 10 degrees, then wait another second | |
servo1.write(179); | |
delay(1000); | |
servo1.write(10); | |
delay(1000); | |
} | |
potValue = analogRead(potPin); // reads the position of the potentiometer | |
motorValue = map(potValue, 0, 1023, 0, 255); // maps the speed of the DC motor to the position of the potentiometer | |
analogWrite(motorPin, motorValue); // assigns the mapped postion of the potentiometer to DC motor as its speed | |
Serial.print("potentiometer = " ); | |
Serial.print(potValue); // prints to potentiometer position to the screen | |
Serial.print("\t motor = "); | |
Serial.println(motorValue); // prints the DC motor speed to the screen | |
delay(2); | |
} |
Arduino code
The code allows the drill to be controlled. The drill speed is governed by the potentiometer, while the servo motor is controlled by the pushbutton. The code may be edited later to incorporate an LCD screen and possibly try to automate the servo function with a timing code.
For this meeting Brendan, Mike, Iasha, and Eric were all in attendance during the meetings this week. In total we spent about two and a half hours
No comments:
Post a Comment