Leesounghoongledel
Published © GPL3+

Arduino (5) (FabLab)

I learn how to use a Bluetooth module.

BeginnerShowcase (no instructions)1 hour501
Arduino (5) (FabLab)

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Breadboard (generic)
Breadboard (generic)
×1
Bluetooth Low Energy (BLE) Module (Generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
LED (generic)
LED (generic)
×1
Resistor 330 ohm
Resistor 330 ohm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

bluetooth

this circuit is to use bluetooth model

bluetooth and LED

this circuit is to turn on LED by bluetooth model

Code

bluetooth

Arduino
this code is pairing arduino and cellphone
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(12, 13);
void setup() {
  Serial.begin(9600);
  BTSerial.begin(9600);

}

void loop() {
  if (BTSerial.available())
  Serial.write(BTSerial.read());
  if (Serial.available())
  BTSerial.write(Serial.read());

}

bluetooth and LED

Arduino
this code is to turn on/off LED to use cellphone
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(12, 13);
int led = 8;
char command;

void setup() {
  Serial.begin(9600);
  BTSerial.begin(9600); 

}

void loop() {
 if (BTSerial.available()){
  char command = BTSerial.read();
  Serial.println(char(command));
  if (command == 'Y' || command == 'y') {
   analogWrite(led, 200);
  }
  else if(command == 'N' || command == 'n'){
    analogWrite(led, 0);
 }
 }

}

Credits

Leesounghoon

Leesounghoon

9 projects • 4 followers
Hi my name is sung hoon lee. I`m a student at Bongilcheon High School. I want to learn 3D Printing and how to use arduino code(+python code)
gledel

gledel

100 projects • 115 followers
Looking back on my childhood, I was happy when I was making something and I was proud of myself. "Making is instinct!"

Comments