bluetooth pic kontrol

bluetooth-pic-kontrol-ares-hex-dosyası-c-kodu-aia-ve-apk-dosyası

bluethoot pic kontrol semasi

kod:

#include <16f628a.h>
#fuses NOWDT,HS, NOPUT, NOPROTECT,NOBROWNOUT, NOLVP, NOCPD
#use delay (clock = 4000000 )
#use fast_io(a)
#use RS232 (BAUD=9600,BITS=8,PARITY=N,XMIT=PIN_B2,RCV=PIN_B1)

char valor;

void main()
{
set_tris_a(0b000);
Output_low(PIN_a0);
Output_low(PIN_a1);
Output_low(PIN_a2);
Output_low(PIN_a3);

while(true)
{
valor = getc();
switch (valor)
{
case ‘b’:
output_low(PIN_a0);
break;

case ‘a’:
output_high(PIN_a0);
break;

case ‘d’:
output_low(PIN_a1);
break;

case ‘c’:
output_high(PIN_a1);
break;

case ‘f’:
output_low(PIN_a2);
break;

case ‘e’:
output_high(PIN_a2);
break;

case ‘h’:
output_low(PIN_a3);
break;

case ‘g’:
output_high(PIN_a3);
break;

}
}
}