Giter Club home page Giter Club logo

arduino-turret-shooter's Issues

Radar aim

Make a branch called "Radar" that is moving the turret and the ultrasonic scanning for an absolute change in the distance of 0.5 (?) And then keep result pretty similar in the next 5 cycles.
When the ultrasonic is founding the target, the turret needs to stop and then shooter start accelerate, the led will turn on red, displaying "loading" and after some delay time the color will change to green, means: "ready to shoot".

Sample code for Bluetooth communication.

HC05 Configuration:

 

#include <SoftwareSerial.h>

#define tx 2

#define rx 3

SoftwareSerial configBt(rx, tx); // RX, TX

void setup() 

{

  Serial.begin(38400);

  configBt.begin(38400);

  pinMode(tx, OUTPUT);

  pinMode(rx, INPUT);

}

void loop() 

{

  if(configBt.available()) //if the bluetooth module is sending something...

  {

    Serial.print(configBt.readString()); //print whatever the bluetooth module is sending 

  }

   

  if(Serial.available()) //if we have typed anything into the serial monitor input text box...

  {

    configBt.write(Serial.read()); //write whatever we typed into the serial monitor input text box to the bluetooth module

  }

}

 

 

Receiver:

 

#include <SoftwareSerial.h>

#define tx 2

#define rx 3

SoftwareSerial bt(rx, tx); //RX, TX

void setup()

{

  Serial.begin(9600);

  bt.begin(9600);

  pinMode(tx, OUTPUT);

  pinMode(rx, INPUT);

}

void loop()

{

  if(bt.available()>0)

  {

    Serial.println(bt.read());

  }

}

 

 

Sender:

 

#include <SoftwareSerial.h>

#define tx 2

#define rx 3

SoftwareSerial bt(rx,tx); //RX, TX

void setup() 

{

  Serial.begin(9600);

  bt.begin(9600);

  pinMode(tx, OUTPUT);

  pinMode(rx, INPUT);

}

void loop() 

{

  bt.write(123);


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.