This BT module requirement is fairly simple:
Bluesoleil, a BT software is needed to establish communication first. No communication can be made until both SKKCA-21 and PC with BT dongle is paired.
[spoiler]http://www.cytron.com.my/usr_attachm...6.2.227.10.zip[/spoiler]
PIC Basic Pro Coding:
[spoiler]
Code:
INCLUDE "modedefs.bas" ' Serial communication mode definition file
DEFINE OSC 20 ' Oscillator speed is set to 20MHz
TRISB = %11111111
TRISC = %10000000 ' RC.7 => USART RX pin set to input
PortC = 0
SPBRG = 10 ' Baud Rate = 115200
' Variable definition
' ===================
'
count01 VAR BYTE ' variable to store TXREG content
stop01 VAR BYTE
TXSTA.2 = 1 ' High speed
TXSTA.5 = 1 ' Enable transmit
RCSTA.7 = 1 ' Bit 7, SPEN, Enable USART
RCSTA.4 = 1 ' Bit 4, CREN, Enable Continuous Receive
stop01 = 0
mainloop:
IF (PortB.7 = 1) THEN
FOR count01 = 0 TO 9
TXREG = count01 + $30 ' Transmit Data
PAUSE 2000
HIGH PortD.2
PAUSE 2000
LOW PortD.2
Next
ENDIF
GOTO mainloop
END
[/spoiler]
Someone please close this thread.......
Bookmarks