Devices & Components
Arduino Uno Rev3
Tactile Switch, Top Actuated
Machine Screw, M3
DS3218MG Servo
HC-05 Bluetooth Module
Machine Screw, M4
Jumper wires (generic)
Breadboard (generic)
SG90 Micro-servo motor
Heat Inserts
Analog joystick (Generic)
Resistor 10k ohm
Hardware & Tools
Solder Wire, Lead Free
Drill / Driver, 20V
3D Printer (generic)
Multitool, Screwdriver
Hot glue gun (generic)
Soldering iron (generic)
Software & Tools
Arduino IDE
Ultimaker Cura
Project description
Code
Sketch SCARA Arm
arduino
This is the sketch wich you must load on your arduino board.
1#include <Servo.h> //include the library about servo 2 3Servo servo_base; //give a name to the servo 4Servo servo_arm; 5Servo servo_dispenser; 6 7 8int val = 0; 9int val1 = 0; 10int n = 0; 11int t = 0; 12int pos = 0; 13int pos1 = 0; 14int pos2 = 0; 15 16void setup() { 17 servo_base.attach(9); //set the pin 9 for servo 18 servo_arm.attach(10); 19 servo_dispenser.attach(11); 20 pinMode(A0, INPUT); //set the pin A0 and A1 to receive data from the joystick 21 pinMode(A1, INPUT); 22 pinMode(8, INPUT); //set the pin 8 to receive data from the buttom 23 Serial.begin(9600); //start the serial monitor 24} 25 26void loop() { 27 28 val = int (map(analogRead(A0), 0, 1023, -550, 550) / 512); //map the value read from A0 ad take the integer 29 val1 = int (map(analogRead(A1), 0, 1023, -550, 550) / 512); 30 pos2 = map(digitalRead(8), 0, 1, 130, 100); 31 pos = n + 1 * val; //add up the value with the previous 32 pos1 = t + 1 * val1; 33 pos = constrain(pos, 0, 180); //limit the value of the variable between 0 and 180 34 pos1 = constrain(pos1, 0, 180); 35 servo_base.write(pos); //turn the servo of the angle we want 36 servo_arm.write(pos1); 37 servo_dispenser.write(pos2); 38 n = pos; //store the position 39 t = pos1; 40 delay(10); 41 Serial.print("servo-base "); // send the value to the bluetooth 42 Serial.print(pos); 43 Serial.print("servo-arm "); 44 Serial.print(pos1); 45 Serial.print("servo-dispenser "); 46 Serial.println(pos2); 47 48 49} 50
Downloadable files
Wirings SCARA
This is how you must connect the elettronic parts.
Wirings SCARA
Wirings SCARA
This is how you must connect the elettronic parts.
Wirings SCARA
Documentation
Guide
Guide
Practice Platform
Practice Platform
Funnel
Funnel
Top
Top
Arm
Arm
Base
Base
Dispenser
Dispenser
Practice Platform
Practice Platform
Funnel
Funnel
Top
Top
Arm
Arm
Base
Base
Dispenser
Dispenser
Guide
Guide
Comments
Only logged in users can leave comments