hc-05 – Kevin Gulling http://www.kevingulling.com Game Development, VR, and more Fri, 23 Dec 2016 02:59:44 +0000 en-US hourly 1 https://wordpress.org/?v=5.9.13 81085834 12 Days of Arduino Day 10 – Robot Bluetooth Connection https://kevingulling.com/2016/12/12-days-of-arduino-day-10-robot-bluetooth-connection/ Thu, 22 Dec 2016 19:46:57 +0000 https://kevingulling.com/?p=1387 Welcome back to 12 Days of Arduino Day 10. Today we finish the core and connect to a remote computer via bluetooth. Everything has been pretty simple up until this point, so if you are a beginner you might want to watch some tutorials on YouTube and read up on the HC-05 and HC-06 before-hand. […]

The post 12 Days of Arduino Day 10 – Robot Bluetooth Connection appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
12 days of arduino day 10

Welcome back to 12 Days of Arduino Day 10. Today we finish the core and connect to a remote computer via bluetooth. Everything has been pretty simple up until this point, so if you are a beginner you might want to watch some tutorials on YouTube and read up on the HC-05 and HC-06 before-hand.



Parts:
-Arduino Uno R3
-Motor
-Fan
-Jumper Wires
-Breadboard
-Spam Can
-2x TIP120 transistors
-HC-05 or HC-06

Bluetooth Sketch

Bluetooth Sketch

#include <SoftwareSerial.h>

#define rxPin 0
#define txPin 1

int motor = 3;
int fan = 5;
int incomingByte = 0;

SoftwareSerial bluetooth(rxPin, txPin);

void setup() {
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
pinMode (motor, OUTPUT);
pinMode (fan, OUTPUT);
bluetooth.begin(9600);
}

void loop() {
// put your main code here, to run repeatedly:
if(bluetooth.available()>0){
bluetooth.print("I received: ");
bluetooth.println(incomingByte, DEC);
}
analogWrite (motor, 255);
digitalWrite (fan, HIGH);
delay(1000);
}

Pro Tip: If you have issues uploading your sketch, unplug the Bluetooth module from the rx/tx pins.

Support future projects by visiting our affiliate ICStation for electronics components:


The post 12 Days of Arduino Day 10 – Robot Bluetooth Connection appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
1387