2019-09-03 (Tu) PillarGame

Once a Bluetooth connection was established with the peripheral device, all serial data was sent there and ignored by the central module. Since the central module was controlling the motor, some of the commands would have to respond locally. The buttons were already programmed, so those functions were co-opted with serial commands. Algorithm format for recognizing serial commands was copied from the peripheral device.

A new command jogged forward, starting at the home position, and counted segments until it reached the home position again. The count was not consistent, but there were approximately 100 counts. The next command allowed the motors to jog multiple times, forward or reverse, from a single command. This command could be abused by inputting an unnecessarily large number, although it only accepted  00 to 99 but did not check for improperly formatted input such as text or special symbols. Unexpected input resulted in erratic behavior.

The most important command was GoTo, which turned the pillar to the commanded segment by the shortest route. For example, if the pillar was at position 00 or HOME, and it was commanded to move to position 90, it would spin 10 segments in reverse. While at 90, if it was commanded to move to position 20, it would go forward, through the HOME position to find 20. Once position finding worked, it was expanded to move at high speed instead of only moving at the lowest possible rate the motors would turn.
Code screenshot

First time here?

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

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 in 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.