Saturday, October 18, 2014

Binary Counting Addition and Subtraction Continued...

This time we do some Binary Addition and Subtraction as one S2 counts the other as it passes. The S2 passing Left to Right is added to the total and the same S2 passing from Right to Left is subtracted from the count total.

The original Binary Addition and Subtraction code was modified with a "wait" to allow time for the counted S2 to pass (and allows a full pass in either direction without being "counted" on both sides in a pass). See BinaryCountAddSubwWait code The S2 being counted makes Counter-Clockwise and Clockwise circles - the loops can be adjusted to get different results. See TwoDirectionCircle code and photo below - with a nod to Nikos (on the Parallax Forums) and his nice noted photos. This version results in an answer count of 2 in binary form - just the center LED lighted green! Again 4 is my max count in the code. 

See the video and for the code - visit the Parallax Forums in this thread.

No comments:

Post a Comment