User:Sheehampster/ENES-100/Project 2

Week1 Narrative
(Understanding this code)

int LightValueA0; // The value from the sensor (0..1023) int LightValueA1; // The value from the sensor (0..1023) int ENA=5;//connected to Arduino's port 5(output pwm) int IN1=2;//connected to Arduino's port 2 DIRA int IN2=3;//connected to Arduino's port 3 DIR#A -- Motor A Brake int ENB=6;//connected to Arduino's port 6(output pwm) int IN3=4;//connected to Arduino's port 4 DIRB int IN4=7;//connected to Arduino's port 7 DIR#B -- Motor B Brake
 * 1) define SENSOR_PINA0 A0
 * 2) define SENSOR_PINA1 A1

void setup { Serial.begin (115200); pinMode(ENA,OUTPUT);//output pinMode(ENB,OUTPUT); pinMode(IN1,OUTPUT); pinMode(IN2,OUTPUT); pinMode(IN3,OUTPUT); pinMode(IN4,OUTPUT); digitalWrite(ENA,LOW); digitalWrite(ENB,LOW);//stop driving }

void loop { {   LightValueA0 = analogRead(SENSOR_PINA0);  //Read the voltage from sensor Serial.println(LightValueA0,DEC);     // Send result to Serial Monitor delay(100); LightValueA1 = analogRead(SENSOR_PINA1); //Read the voltage from sensor Serial.println(LightValueA1,DEC);     // Send result to Serial Monitor delay(100); if (analogRead(SENSOR_PINA0) >= 900 && analogRead(SENSOR_PINA1) >= 900) {digitalWrite(9, HIGH);  // set the LED on    delay(100);              // wait for a second digitalWrite(9, LOW);   // set the LED off delay(100);             // wait for a second analogWrite(ENA,200);//start driving motorA analogWrite(ENB,230);//start driving motorB digitalWrite(IN1,LOW); digitalWrite(IN2,HIGH);//setting motorA's directon digitalWrite(IN3,HIGH); digitalWrite(IN4,LOW);//setting motorB's directon delay(200); analogWrite(ENA,200);//start driving motorA analogWrite(ENB,230);//start driving motorB digitalWrite(IN1,LOW); digitalWrite(IN2,LOW);//setting motorA's directon digitalWrite(IN3,LOW); digitalWrite(IN4,LOW);//setting motorB's directon delay(50); }   if (analogRead(SENSOR_PINA0) >= 900 && analogRead(SENSOR_PINA1) <= 900) {   analogWrite(ENA,180);//start driving motorA analogWrite(ENB,230);//start driving motorB digitalWrite(IN1,LOW); digitalWrite(IN2,HIGH);//setting motorA's directon digitalWrite(IN3,LOW); digitalWrite(IN4,HIGH);//setting motorB's directon delay(100); analogWrite(ENA,200);//start driving motorA analogWrite(ENB,230);//start driving motorB digitalWrite(IN1,LOW); digitalWrite(IN2,LOW);//setting motorA's directon digitalWrite(IN3,LOW); digitalWrite(IN4,LOW);//setting motorB's directon delay(50); } {    if (analogRead(SENSOR_PINA0) <= 900 && analogRead(SENSOR_PINA1) >= 900) {   analogWrite(ENA,230);//start driving motorA analogWrite(ENB,180);//start driving motorB digitalWrite(IN1,HIGH); digitalWrite(IN2,LOW);//setting motorA's directon digitalWrite(IN3,HIGH); digitalWrite(IN4,LOW);//setting motorB's directon delay(100); analogWrite(ENA,200);//start driving motorA analogWrite(ENB,230);//start driving motorB digitalWrite(IN1,LOW); digitalWrite(IN2,LOW);//setting motorA's directon digitalWrite(IN3,LOW); digitalWrite(IN4,LOW);//setting motorB's directon delay(50); } {    if (analogRead(SENSOR_PINA0) <= 900 && analogRead(SENSOR_PINA1) <= 900) {   analogWrite(ENA,230);//start driving motorA analogWrite(ENB,230);//start driving motorB digitalWrite(IN1,LOW); digitalWrite(IN2,LOW);//setting motorA's directon digitalWrite(IN3,LOW); digitalWrite(IN4,LOW);//setting motorB's directon delay(100); } delay(100); }}}}

Week2 Narrative
This week I changed my focus from learning to program linus to beginning to 3D design it so that we may print parts. I have been and will continue to learn 3D design software. I am currently using Blender, but will probably switch to Autodesk because it is more structured and will probably be easier to use, especially for exact measurements and for small, precise parts.

Here are links to youtube videos showing the two different 3D design softwares.

Blender

Autodesk Inventor

Week3 Narrative
I have been struggling with Autodesk most of this week, but believe I am now capable of designing all the parts, though it may take some time. I have been working on and will continue taking exact measurements of Linus using a caliper. I am recording those measurements in my notebook, so that myself and others may reference them. I have already designed a few of the upper platforms for the robot.



Week4 Narrative
This week I was successfully able to model the entire robot on autodesk. I used previously designed arduino and arduino motor shields parts to make it even more just like linus. I had to make some minor adjustments, and it was a long process, but it is done. I also was successful in doing test prints with the 3D printer so that I know how to operate it and print out the parts.

Example drawings of the parts made from Autodesk shown as thumbnails. The final product is shown as a larger image below. Additionally, we attempted to 3D print the entire robot as a scale model. This proved very difficult trying to do all of the parts at once. We certainly learned a lesson in keeping all of the parts separate, and putting everything else together afterwards. This can be seen as thumnails below the final Autodesk product image.



Final Robot on the 3D design software shown below