2020-07-14 (Tu) InCompass

I dug through code examples for the Bluetooth module and happened across the HID example that would let me send keyboard commands. Eventually, I might get around to this sort of thing, but I am glad that it looks straight-forward. Some of the examples helped me piece together what was happening in the serial data transfer. I was able to recognize a button input from Adafruit's Bluefruit Connect app to print "Success!!!" on the Arduino's serial port.
Controller recognized by microcontroller

I programmed the button recognition to zero out the heading so any direction could be the origin. For most people, this will be geographic north. From anywhere sufficiently distant, it could point roughly toward Mecca. I had to change the function so that it would reset the origin in the code where the reading was first taken, or the button would only work once, and then it would need a restart.

My code cannot handle a 360° spin. It will always buzz after spinning 300° from the origin, which is the edge of the maximum angle of interest. Unwanted buzzes here are something I wanted to fix after I got live phone readings working, and now I can focus on them. Another issue with the phone is getting reliable reception. The Bluetooth power is too low to maintain a connection with my device.
Heading zeroed out over Bluetooth

The rest of the posts for this project have been arranged by date.
Completed projects from year 1
Completed projects from year 2
Completed projects from year 3
Completed projects from year 4
Completed projects from year 5
Completed projects from year 6
Completed projects from year 7

Disclaimer for http://24hourengineer.blogspot.com and 24HourEngineer.com

This disclaimer must be intact and whole. This disclaimer must be included if a project is distributed.

All information on this blog, or linked by this blog, is not to be taken as advice or solicitation. Anyone attempting to replicate, in whole or in part, is responsible for the outcome and procedure. Any loss of functionality, money, property, or similar, is the responsibility of those involved in the replication.

All digital communication regarding the email address 24hourengineer@gmail.com becomes the intellectual property of Brian McEvoy. Any information contained within these messages may be distributed or retained at the discretion of Brian McEvoy. Any email sent to this address, or any email account owned by  Brian McEvoy, cannot be used to claim property or assets.

Comments to the blog may be utilized or erased at the discretion of the owner. No one posting may claim property or assets based on their post.

This blog, including pictures and text, is copyright to Brian McEvoy.