Binary number converter

18 Mar 2025 - 18:18 | Version 1 |

Objectives

  1. Get really comfortable with variables

Assignment

  1. Create a clean program that will read a binary number (black = 1, white = 0) and display the equivalent number (in decimal) on the screen. Your robot should stop when it encounters any color other than black or white. Keep the length short.
    1. Each digit will be about one inch square. There is nothing special separating the colors

Suggestions

    1. Start playing two different notes as the robot moves along, one note for black and a different note for white. Make sure these notes are very short duration. End when it encounters another color.
    2. Start the variable out as 1, multiply it by 2 for each new inch, display the final number. It should be a power of 2!
    3. The conditional add one after the multiplier if it is black.

Submission instructions

  1. Due date is found on Canvas
  2. Each person should create a pdf document that contains the following information
    1. Your name
    2. Your partner's name
    3. A brief description of what you did
    4. A brief description of what your partner did
    5. How your team improved over any mistakes made last time
    6. Indicate which hints (if any) your team used
    7. How well you achieve each objective.
  3. Submission:
    1. Team member A submits the team's code and his/her pdf document in one zip folder.
    2. Team member B submits his/her pdf document (does not need to be zip'ed)

Hints

Challenges

  1. Have the robot speak the final number
  2. Let the user work in octal or binary (based on the button on the block that is clicked).
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This website is using cookies. More info. That's Fine