CONTRIBUTION: SNAP! running micro:bit running microBlocks

Issue #115 closed
Turgut Guneysu created an issue

microBit-n-microBlocksInSNAP

Hi Guys,

Corona lull coerced me to write a melange of holy trinity (SNAP! / micro:bit / microBlocks).

I am hoping it will make demos easier and also give an idea to those who have not delved into the mixture of all three areas.

Plus I wanted a combo where I did not have to plug different devices together and use different IDEs.

It comes with two preset projects and an open third one. Working on a 3rd one to demo UART byte transfer.

microBlocks blocks are are dispersed among the SNAP categories as custom blocks marked with the robot pic.

Three coding area sprites are for writing code for the three project options. But really it does not matter where that code is.

micro:bit is always operational, even without the battery connected; to make things easy.

Projects turn the battery on and off.

Some extra actions out of the ordinary:

  • clicking the micro:bit board will make the display pattern reversed.
  • clicking the individual LEDs will toggle them on / off.
  • color blocks above the micro:bit are for color change on the board.
  • clicking the battery will turn it on / off.

microBlocks blocks included:

Control blocks for the logic utilize the SNAP! blocks, as they are totally suitable for the task.

PROJECTS:

  1. An electric fan driven by an adjustable pot:
    Preprogrammed button A will turn the fan at selected POT setting.
    Button B will stop the fan.
    Other combos are up to the user.
  2. A DC motor driving a wheel using KEYES Motor Driver Board:
    Preprogrammed button A will turn the motor counter-clock wise.
    Button B will turn the wheel clock wise.
    Other combos are up to the user.
  3. OPEN third project:
    Planning on using it for an UART demo transferring bytes between pins.

PROGRAMMING Details:

Some SNAP! techniques that were used for the GUI are worth mentioning:

  • Clickable MENU created by using PEN write, costume create.
  • Display of PWM and Voltages using position controlled variable reporters.
  • Heavy use of INHERITANCE to drive Voltage / PWM values from source to PINs to and points.
  • OHM’s Law adhering implementation of POT details.
  • Adjustable display of float values with n decimal point positions.

I want to post this to the SNAP! forum as well. However, I did want to check with you in case it goes counter to how you would want things to look like or presented.

Comments (7)

  1. Log in to comment