awal mobil datang senang sekali, tapi lama-kelamaan bosan juga. pdahal baru 1 hari.
akhirnya saya punya ide. gimana caranya supaya mobil ini sangat tertarik meskipun harganya 18rb.
mari kumpulkan komponen pendukungnya.
1. mikrokontroller nodemcu (50rb)
2. shield motor nodemcu (22rb)
3. batre holder isi 2 (10rb)
4. batre 18650 sebanyak 2 (15rb bekas)
5. motor + gear sebanyak 2 (42rb)
6. kabel secukupnya. (2rb)
estimasi hasil dari pencarian di toped 141rb
estimasi hasil dari pencarian di toped 141rb
setelah semua terkumpul
step pertama bikin project di aplikasi blynk
jangan lupa token yang dikirim ke email di copy ke coding dibawah ini
step kedua bikin koding:
upload koding tersebut ke nodemcu.
step ketiga rakit motor + batre + shield motor + nodemcu + mobil 18rb an
abaikan motor a2 dan b2... atau bisa juga bikin 4 motor
tapi saya hanya bikin 2 motor aja. karena di gudang SIMOR hanya ada itu.
setelah selesai rakit
#define BLYNK_PRINT Serial #include <ESP8266WiFi.h>#include <BlynkSimpleEsp8266.h>
// You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "your token";
// Your WiFi credentials. // Set password to "" for open networks. char ssid[] = "yourname wifi"; char pass[] = "password";
int PWMA=5;//Right side int PWMB=4;//Left side int DA=0;//Right reverse int DB=2;//Left reverse
void setup(){ // Debug console Serial.begin(9600); Blynk.begin(auth, ssid, pass); pinMode(PWMA, OUTPUT); pinMode(PWMB, OUTPUT); pinMode(DA, OUTPUT); pinMode(DB, OUTPUT); }
void loop(){ Blynk.run(); }
// Handling Joystick data BLYNK_WRITE(V1){ int x = param[0].asInt(); int y = param[1].asInt(); if(x==-1 && y==-1){ //Backward and Left digitalWrite(PWMA, LOW); digitalWrite(DA, LOW); digitalWrite(PWMB, HIGH); digitalWrite(DB, HIGH); }else if(x==-1 && y==0){ //Left Turn digitalWrite(PWMA, 450); digitalWrite(DA, HIGH); digitalWrite(PWMB, 450); digitalWrite(DB, LOW); }else if(x==-1 && y==1){ //Forward and Left digitalWrite(PWMA, LOW); digitalWrite(DA, LOW); digitalWrite(PWMB, HIGH); digitalWrite(DB, LOW); }else if(x==0 && y==-1){ //Backward digitalWrite(PWMA, HIGH); digitalWrite(DA, HIGH); digitalWrite(PWMB, HIGH); digitalWrite(DB, HIGH);}else if(x==0 && y==0){ //Stay digitalWrite(PWMA, LOW); digitalWrite(DA, LOW); digitalWrite(PWMB, LOW); digitalWrite(DB, LOW); }else if(x==0 && y==1){ //Forward digitalWrite(PWMA, HIGH); digitalWrite(DA, LOW); digitalWrite(PWMB, HIGH); digitalWrite(DB, LOW); }else if(x==1 && y==-1){ //Backward and Right digitalWrite(PWMA, HIGH); digitalWrite(DA, HIGH); digitalWrite(PWMB, LOW); digitalWrite(DB, LOW); }else if(x==1 && y==0){ //Right turn digitalWrite(PWMA, 450); digitalWrite(DA, LOW); digitalWrite(PWMB, 450); digitalWrite(DB, HIGH); }else if(x==1 && y==1){ //Forward and Right digitalWrite(PWMA, HIGH); digitalWrite(DA, LOW); digitalWrite(PWMB, LOW); digitalWrite(DB, LOW); } }
upload koding tersebut ke nodemcu.
step ketiga rakit motor + batre + shield motor + nodemcu + mobil 18rb an
abaikan motor a2 dan b2... atau bisa juga bikin 4 motor
tapi saya hanya bikin 2 motor aja. karena di gudang SIMOR hanya ada itu.
setelah selesai rakit
hasil uji: