Thursday, October 16, 2014

Binary Counting - Addition and Subtraction

Last example for Ken from this thread on the Parallax Forums.  - this is a follow up to the Binary Counting below. This version counts when objects pass the S2 left to right and subtracts when objects pass from right to left. I used a screen/target in the video - you could count passing S2s or Scribblers as I did previously.

I wanted to count/add to 7 and subtract back to 0 - but I ran into the limitation of variables (I think - the program wouldn't load - till I reduced to a maximum count of 4). So we count to 4 and subtract to zero. See other info in the post below (on Binary Count using the LEDs), video below and the good and bad code posted on the Forums at the link above.

NOTE: The code there labeled TOOMANYVAR - which looks okay to me (may have an error), never would load properly - again I think because it exceeds the limits of the Program Maker or the S2 - I asked for input on the Forums and there may be more there eventually.

Hope Ken has a great time with his class! The S2 is an amazing robot to teach with...

No comments:

Post a Comment