Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
qazx7283
Published

An Ordinary Car

The major goal of the project is to use materials and sources that are simply reachable and getable in our lives.

BeginnerFull instructions provided3 hours871
An Ordinary Car

Things used in this project

Hardware components

Battery Holder 18650 x3
×1
H-Bridge motor drivers L298N
×1
Arduino Nano R3
Arduino Nano R3
×1
HC-05 Bluetooth Module
×1
18650 battery
×3
DC motor (generic)
×1
box
×1
wheel
×4

Software apps and online services

Bluetooth RC Controller

Story

Read more

Schematics

Circuit

Wire connection

Code

Code

C/C++
#include <AFMotor.h>
#include <SoftwareSerial.h> 
int speed_min = 0; 
int speed_max = 255;
char bt = 0; 
AF_DCMotor m1(1);

void setup() {
  Serial.begin(9600); 
}
void loop()
 {
   if (Serial.available() > 0) //save incoming data to variable 'bt'
   {
     bt = Serial.read();
     
     int x=0;
     m1.setSpeed(x);
     
if(bt == 'F')  //move forwards
     {
      int x=255;
      m1.setSpeed(x);   
      m1.run(FORWARD);
      }    
else if(bt == 'B')  //move backwards
     {
      int x=255;
      m1.setSpeed(x);
      m1.run(BACKWARD);     
      }
else
     {
      m1.setSpeed(0);  //stop
      m1.run(RELEASE);
     }
     }
     }

Credits

qazx7283
2 projects • 2 followers
Contact

Comments

Please log in or sign up to comment.