Advertisement
Electgpl

PIC - Control básico Bluetooth UART

Apr 18th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <16F628A.h>
  2. #use delay(int=4000000)
  3. #use rs232(baud=9600,parity=N,xmit=PIN_B2,rcv=PIN_B1,bits=8)
  4. void main(){
  5.    char charIn;
  6.    while(true){
  7.       if(kbhit())
  8.          charIn=getch();
  9.       switch(charIn){
  10.       case ‘a’:
  11.          output_high(PIN_A0);
  12.          break;
  13.       case ‘w’:
  14.          output_low(PIN_A0);
  15.          break;
  16.       }
  17.    }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement