Sending data via an HC bluetooth module is no different to sending it via normal serial, just that there is no physical cable between the two devices (such as a PC and the PIC).
You could try using an FTDI usb to serial module and get the code working via hardwired setup and then use the HC module which should function exactly the same, if it doesn't then this would suggest that there may be a fault with the hardware.
I use these in a couple of my projects to send decimal values from word variables to an application running on a PC
Code:HSEROUT [dec4 CH1_MAX] HSEROUT [dec4 CH2_MAX] etc then HSERIN 1000, RX_Bombed, [dec4 CH1_MAX] to read it back
The RX Bombed is a time out
I then have this bit of code at the start of my comms subroutinesCode:RX_Bombed: TimeoutCount = TimeOutCount + 1 end select Goto main
In the main program loop I have this to check the buffer and jump to the comms subroutineCode:coms: HSERIN [nTest] SELECT CASE nTest CASE "Q" ; if Q then send data to PC Goto Term_TX CASE "S" ; if S then receive data from PC goto Term_RX return
Hope this helpsCode:FOR TempWD = 0 TO 500 IF RCIF=1 THEN GOSUB coms ; Check to see if PC application connected PAUSE 1 next TempWD
Sorry for got to add
Code:RCIF VAR PIR1.5 ' USART receive flag




Bookmarks