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);
Need to update current time inside the while
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.