The original
SAMDINO, I use this design as the initial design, then I
change some components and made a new schematic in order to
fit my Final Project rqueriments
A PNG image of
my PCB, we need to export the image in this format to open
it in MODS
I use MODS to
set up the Modela for milling my PCB
The Modela
machining my PCB in the copper plate
My PCB and the
components I need to weld it
For this
assignment I want to blink the PCB led to check comms, then
the servo rotate and the led will go ON and OFF (HIGH and
LOW)
the servo only
rotates from 0 to 180º VS a step motor that rotates 360º but
for assignment purposes I will use the servo, so, in this
tst code first the red led will turn ON and OFF, then the
servo moves into 3 different positions and then the wearable
LED (lamp) will turn ON, OFF and ON again
Here is the
code and a video
int
led = 2;
int servo = 8;
int angle;
int pwm;
int lamp = 5;
void setup()
{
pinMode(servo, OUTPUT);
pinMode(led, OUTPUT);
pinMode(lamp, OUTPUT);
}
void loop ()
{
//Probe PCB board function
digitalWrite(led,HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
//Move servomotor
servoPulse(servo, 15);
delay(1000);
servoPulse(servo, 120);
delay(2000);
servoPulse(servo, 180);
delay(4000);
//turn On & turn off lamp
digitalWrite(lamp, HIGH);
delay(500);
digitalWrite(lamp, LOW);
delay(1500);
digitalWrite(lamp, HIGH);
delay(500);
}
void servoPulse (int servo, int angle)
{
pwm = (angle*11) +
500; // Convert angle to
microseconds
digitalWrite(servo, HIGH);
delayMicroseconds(pwm);
digitalWrite(servo, LOW);
delay(50);
// Refresh cycle of servo
}