2020-06-09 (Tu) HexShaftMonitor

Programming in Blockly was a lot different than scripting, and not just the style, but also the way I interacted with the computer. When I'm programming in a text-only language, I mostly keep my hands on the keyboard, but with a graphic language, I used my touch-screen more than usual.

I made a rising/falling edge structure to recognize each spin, making it easy to create a rotation counter. For the speed calculation, I started by displaying the time that the reed switch was closed. The time display was erratic, and something I had seen before was popping up. The problem I had was the magnet was triggering the contact in two places during the rotation, so there was a double-tap each rotation. I could control this behavior a bit by angling the reed switch.

 I added a few features that aided debugging, like a button that would reset the rotation counter and some serial output. Learning these functions early was more important than having control. Next, I started the RPM calculation, which was the same as converting a time delay into beats per minute, which happened in another project. By accident, I mixed up a couple of variables and tried to divide by zero, which lead to a system freeze. Once the calculation seemed to work, I printed the result and mapped it with the Arduino plotter. Some of the time, I triggered it with my finger magnet, and other times, I triggered it with the wheel, which caused the double-tapping effect.
Screenshot of code and feedback

The rest of the posts for this project have been arranged by date. 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
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.