Assignment 3: Ravebot

At long last we have unboxed the mBots. In order to verify correct installation of the mBlock IDE and arduino drivers, and to get practice programming in scratch and uploading code, we attempt to control the mCore board’s onboard LEDs to create a smoothly flashing, colorful display, thus lending a party-like atmosphere to the classroom.

Disclaimer: This is more of a fancy lightbulb than a robot per-se (there is no autonomous decision-making.)

Disclaimer: This will be more fun rave once we add sound and movement… šŸ™‚

//ravebot pseudocode

//learning objective: learn about variables, control loops, and get used to uploading code to the mBot.

//goal: to create a light show, with the two onboard LEDs independently shifting through the color spectrum. The lights should change smoothly, without strobing.

//plan: each color should go up until 255, then go down until 0, then go up…etc.
//need to set each color to a different value initially

//initialize
-variables for each color, RGB, different
-variables for each colors’ direction (dir1, dir2, dir3)

//loop
-check the values of each color, and if the value is 255, change the direction of that color to -1, if it’s 0, change the direction to 1.
-change the value of the color by its direction
-set the left led color
-set the right led color
//end loop

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: