• AVR Freaks

Helpful ReplyHot!I need some help using the HC-05 bluetooth module with the PIC16F18446 microcontroller.

Page: < 12 Showing page 2 of 2
Author
nashsth
New Member
  • Total Posts : 19
  • Reward points : 0
  • Joined: 2020/03/17 21:13:03
  • Location: 0
  • Status: offline
Re: I need some help using the HC-05 bluetooth module with the PIC16F18446 microcontroller 2020/05/31 18:16:47 (permalink)
#21
ric
Super Member
  • Total Posts : 27954
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: offline
Re: I need some help using the HC-05 bluetooth module with the PIC16F18446 microcontroller 2020/05/31 18:57:47 (permalink)
+2 (2)
You don't need this line, and your code will be more efficient without it.
(Plus the comments are wrong, I have bolded the correction)
 
void send_char(char byte){
    //only load the data into the register if the register is empty
    while(!TX1IF); //if TX1IF == 0, the register is full, wait until it is empty
    while(!TRMT); //if TRMT == 0, the register is full, so do nothing
    TX1REG = byte;
}


post edited by ric - 2020/05/31 18:59:36

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#22
nashsth
New Member
  • Total Posts : 19
  • Reward points : 0
  • Joined: 2020/03/17 21:13:03
  • Location: 0
  • Status: offline
Re: I need some help using the HC-05 bluetooth module with the PIC16F18446 microcontroller 2020/05/31 19:07:18 (permalink)
0
Awesome; thank you for your edits and suggestions, Ric :)
#23
Page: < 12 Showing page 2 of 2
Jump to:
© 2020 APG vNext Commercial Version 4.5