bertambah anggota puak and the gang.
Rashdan Muhammada Adyantara.
selang 1 bulan atau kata orang jawa itu selapan. kami skeluarga hijrah dari sidoarjo ke probolinggo.
merasakan kesibukan seorang daddy seorang enginerr. bingung naruh si baby.
akhirnya taruh si baby di bouncer
namun bouncer ini nggak ada pengayun otomatis.
Ahaaa.. i have idea
ada komponen nganggur:
- arduino uno
- servo SG5010
- powerbank
- kabel jumper
cek in this video
sketch experimen ini saya ambil dari example servo->sweep
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
int pos = 0; // variable to store the servo position
char command;
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
for(pos = 0; pos < 40; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 40; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
Tidak ada komentar:
Posting Komentar