Brkclskn
Published

Bluetooth wooden boat

How to make a simple boat out of wood using arduino uno

BeginnerProtip250
Bluetooth wooden boat

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
Dual H-Bridge motor drivers L298
SparkFun Dual H-Bridge motor drivers L298
×1
Battery, 9 V
Battery, 9 V
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1
şaft tekne
×1
DC Motor, 12 V
DC Motor, 12 V
fırçasız motor ve esc kullanılırsa daha hızlı olur
×1

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
iskarpela

Story

Read more

Schematics

33_kbEa3adYq2.jpeg

Code

Untitled file

Arduino
#include <Servo.h>
const int motorA1  = 5;  // L298N'in IN3 Girişi
const int motorA2  = 6;  // L298N'in IN1 Girişi

Servo servo;

int durum; 
int Hiz=255;
 
void setup() {
    pinMode(motorA1, OUTPUT);
    pinMode(motorA2, OUTPUT);
 

    servo.attach(7);  
    int aciDegeri=45;
    Serial.begin(9600);
}
 
void loop() {
    if(Serial.available() > 0){     
      durum = Serial.read();   
      servo.write(45);
    }
  
  // Uygulamadan ayarlanabilen 3 hız seviyesi.(Değerler 0-255 arası)
   if (durum == '1'){
      Hiz=50;}
    else if (durum == '2'){
      Hiz=150;}
    else if (durum == '3'){
      Hiz=255;}
         
  /******************** İleri *************************/
    if (durum == 'F') {
      analogWrite(motorA1, Hiz); analogWrite(motorA2, 0);
       
    }
  /****************** İleri Sağ *********************/
    else if (durum == 'I') {
      analogWrite(motorA1,Hiz ); analogWrite(motorA2, 0);  
         
          servo.write(0);
    }
  /****************** İleri Sol ********************/
    else if (durum == 'G') {
        analogWrite(motorA1, Hiz); analogWrite(motorA2, 0);  
          servo.write(90);
    }
  /****************** Geri ****************************/
    else if (durum == 'B') {
      analogWrite(motorA1, 0);   analogWrite(motorA2, Hiz); 
    
    }
   
   
  /********************* Dur ************************/
    else if (durum == 'S'){
        analogWrite(motorA1, 0);  analogWrite(motorA2, 0); 
        }  
}  
  
    
   

Credits

Brkclskn
0 projects • 1 follower
Contact

Comments

Please log in or sign up to comment.