Membuat Kontrol Lift Sederhana Dengan Arduino Dan Motor Dc 5 V
Biasanya dipakai untuk simulasi kontrol lift berbasis arduino.
Cara kerja rangkaian :
Ada tiga buah push button yang berfungsi sebagai : tombol UP (putar kanan) tombol DOWN (putar kiri), dan tombol Stop.
anda juga sanggup memsang indikator LED di pin digital 11, 12 dan 13 untuk memperlihatkan tanda putar kanan, putar kiri dan stop.
kalau anda ingin menciptakan simulasi LIFT 4 lantai, silahkan mampir postingan aku disini
sketch arduino sanggup di copy dibawah ini :
.
/*
modified : by www.rokhmad.com
*/
int masalah = 0;
#define UP 2
#define STOP 3
#define DOWN 4
#define satu A0
#define dua A1
#define tiga A2
void setup() {
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
digitalWrite(11, HIGH);
pinMode(UP, INPUT_PULLUP);
pinMode(STOP, INPUT_PULLUP);
pinMode(DOWN, INPUT_PULLUP);
pinMode(satu, INPUT_PULLUP);
pinMode(dua, INPUT_PULLUP);
pinMode(tiga, INPUT_PULLUP);
// set the speed at 60 rpm:
// initialize the serial port:
Serial.begin(9600); }
void loop() {
if (digitalRead(UP) == LOW) {
kasus = 1;
}
if (kasus == 0 ) {
Serial.println("stop");
}
if (digitalRead(DOWN) == LOW)
{
kasus = 2; }
if (digitalRead(STOP) == LOW)
{ masalah = 0; digitalWrite(6, LOW);
digitalWrite(7, LOW); digitalWrite(13, LOW);
digitalWrite(12, LOW); digitalWrite(11, HIGH);
}
if (kasus == 1 ) {
Serial.println("putar kiri");
digitalWrite(7, HIGH);
digitalWrite(6, LOW);
digitalWrite(13, HIGH);
digitalWrite(12, LOW);
digitalWrite(11, LOW);
}
if (kasus == 2 ) { Serial.println("putar kanan");
digitalWrite(6, HIGH); digitalWrite(7, LOW);
digitalWrite(12, HIGH);
digitalWrite(13, LOW);
digitalWrite(11, LOW); } }
modified : by www.rokhmad.com
*/
int masalah = 0;
#define UP 2
#define STOP 3
#define DOWN 4
#define satu A0
#define dua A1
#define tiga A2
void setup() {
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
digitalWrite(11, HIGH);
pinMode(UP, INPUT_PULLUP);
pinMode(STOP, INPUT_PULLUP);
pinMode(DOWN, INPUT_PULLUP);
pinMode(satu, INPUT_PULLUP);
pinMode(dua, INPUT_PULLUP);
pinMode(tiga, INPUT_PULLUP);
// set the speed at 60 rpm:
// initialize the serial port:
Serial.begin(9600); }
void loop() {
if (digitalRead(UP) == LOW) {
kasus = 1;
}
if (kasus == 0 ) {
Serial.println("stop");
}
if (digitalRead(DOWN) == LOW)
{
kasus = 2; }
if (digitalRead(STOP) == LOW)
{ masalah = 0; digitalWrite(6, LOW);
digitalWrite(7, LOW); digitalWrite(13, LOW);
digitalWrite(12, LOW); digitalWrite(11, HIGH);
}
if (kasus == 1 ) {
Serial.println("putar kiri");
digitalWrite(7, HIGH);
digitalWrite(6, LOW);
digitalWrite(13, HIGH);
digitalWrite(12, LOW);
digitalWrite(11, LOW);
}
if (kasus == 2 ) { Serial.println("putar kanan");
digitalWrite(6, HIGH); digitalWrite(7, LOW);
digitalWrite(12, HIGH);
digitalWrite(13, LOW);
digitalWrite(11, LOW); } }
0 Response to "Membuat Kontrol Lift Sederhana Dengan Arduino Dan Motor Dc 5 V"
Posting Komentar