정건우Juhyun Kim홍태현
Created December 8, 2017 © CC BY-NC

Arduino Bluetooth Window control

아두이노 나노를 코딩한 후 블루투스 통신을 이용하여 창문 제어하기

BeginnerWork in progress14 hours118
Arduino Bluetooth Window control

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
arduino nano ATmega328P
×1
Jumper wires (generic)
Jumper wires (generic)
×1
DC motor (generic)
DC모터 사진은 없네요...
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

칼, 자, 글루건, 네임펜, 인두기, 납 등등

Story

Read more

Schematics

아두이노 블루투스 창문 컨트롤 fritzing 파일

블루투스 모듈이 없어 왼쪽 윗 부분을 끼우지 못 하였고
학교에서 사용하던 RC드라이버가 없어서 다른 드라이버를 사용하였습니다.(학교에서 사용하던 것과 달라 선을 어디에 연결할 지 몰라 연결을 하지
못 하였습니다.

Code

아두이노 나노 블루투스 창문 컨트롤

Arduino
기존 토요일에 만들었던 RC카 코드를 변형하여 만들 창문 컨트롤러 코드입니다
// Smartphone Controlled Arduino Robot 
int izqA = 5;  
int izqB = 6;  
int derA = 9;  
int derB = 10;  
int vel = 255; // Velocidad de los motores (0-255) 
int estado = 'g'; // inicia detenido 
 
void setup() {  
Serial.begin(9600); // inicia el puerto serial para comunicacion con el Bluetooth 
pinMode(derA, OUTPUT); 
pinMode(derB, OUTPUT); 
pinMode(izqA, OUTPUT); 
pinMode(izqB, OUTPUT); 
}  
 
void loop() {  
 
if(Serial.available()>0){ // lee el bluetooth y almacena en estado 
estado = Serial.read(); 
} 
if(estado=='a'){ // Forward 
  Serial.println(estado); 
analogWrite(derB, 0);  
analogWrite(izqB, 0);  
analogWrite(derA, vel);  
analogWrite(izqA, vel);  
} 

if(estado=='c'){ // Stop 
    Serial.println(estado); 
analogWrite(derB, 0);  
analogWrite(izqB, 0);  
analogWrite(derA, 0);  
analogWrite(izqA, 0);  
} 
   
 if(estado=='e'){ // Reverse 
    Serial.println(estado); 
analogWrite(derA, 0);  
analogWrite(izqA, 0); 
analogWrite(derB, vel);  
analogWrite(izqB, vel);  
} 
if (estado =='f'){ // Boton ON se mueve sensando distancia  
 
} 
if (estado=='g'){ // Boton OFF, detiene los motores no hace nada  
} 
} 

Credits

정건우
1 project • 0 followers
Contact
Juhyun Kim
26 projects • 12 followers
Contact
홍태현
0 projects • 0 followers
Contact

Comments

Please log in or sign up to comment.