마지막으로 회로도랑 펌웨어 그리고 안드로이드 앱을 공유해 본다.
최종 회로도는 요렇게 간단하게 생겼고~
/*******************************************************
This program was created by the
CodeWizardAVR V3.16 Evaluation
Automatic Program Generator
?Copyright 1998-2014 Pavel Haiduc, HP InfoTech s.r.l.
http://www.hpinfotech.com
Project :
Version :
Date : 2015-03-31
Author :
Company :
Comments:
Chip type : ATmega8A
Program type : Application
AVR Core Clock frequency: 8.000000 MHz
Memory model : Small
External RAM size : 0
Data Stack size : 256
*******************************************************/
#include <mega8.h>
// Declare your global variables here
// Standard Input/Output functions
#include <stdio.h>
void init_uart()
{
// USART initialization
// Communication Parameters: 8 Data, 1 Stop, No Parity
// USART Receiver: On
// USART Transmitter: On
// USART Mode: Asynchronous
// USART Baud Rate: 115200
UCSRA=(0<<RXC) | (0<<TXC) | (0<<UDRE) | (0<<FE) | (0<<DOR) | (0<<UPE) | (0<<U2X) | (0<<MPCM);
UCSRB=(0<<RXCIE) | (0<<TXCIE) | (0<<UDRIE) | (1<<RXEN) | (1<<TXEN) | (0<<UCSZ2) | (0<<RXB8) | (0<<TXB8);
UCSRC=(1<<URSEL) | (0<<UMSEL) | (0<<UPM1) | (0<<UPM0) | (0<<USBS) | (1<<UCSZ1) | (1<<UCSZ0) | (0<<UCPOL);
UBRRH=0x00;
UBRRL=0x03;
}
void main(void)
{
unsigned char c = 0;
DDRB = 0xff;
PORTB = 0x01;
init_uart();
printf("atn=PENTAS\r\n");
while (1)
{
c = getchar();
if(c == 'u')
{
PORTB = 0x01;
}
else if(c == 'd')
{
PORTB = 0x00;
}
}
}
최종 펌웨어는 코드비젼으로 작성했으며 블루투스로 u가 날라오면 on 되고 d가 날라오면 off 되는 간단한 동작이다.
안드로이드 앱 다운로드는 >>> 다운
이번 프로젝트 진행하면서 큰 어려움은 없었지만
아무래도 다른일 하면서 진행하다보니 부품수급이라던가 진행속도가 상당히 느릴 수 밖에 없었다. 그래도 최대한 마무리 할 수 있다는 것이 좋았으며 지속적인 업데이트를 통해 여기서 끝나지 않고 최대한 더 유용하게 만들 수 있도록 해봐야겠다.
다음 버젼은 wifi 모델을 해야하나~?ㅋ
Smart Switch V1.0
끝.