Electorials Electronics
Published © GPL3+

Review 005: ElecFreaks Micro:bit Tinker Kit Review

A review of the ElecFreaks Micro:bit Tinker Kit from ElecFreaks.

IntermediateProtip2 hours174
Review 005: ElecFreaks Micro:bit Tinker Kit Review

Things used in this project

Hardware components

Elecfreaks Micro:bit Tinker Kit
×1
PCBWay Custom PCB
PCBWay Custom PCB
×1

Story

Read more

Code

JavaScript Micro:bit Sample Code

JavaScript
basic.forever(() => {
    basic.showString("This is the Micro:bit!")
    basic.showIcon(IconNames.Heart)
    basic.pause(1000)
})

MicroPython Octopus Soil Moisture Sensor Brick Sample Code

MicroPython
from microbit import *
while True:
    value = pin0.read_analog()
    display.scroll(str(value))
    sleep(3000)

JavaScript Octopus ADKeypad Sample Code

JavaScript
basic.forever(() => {
    if (tinkercademy.ADKeyboard(ADKeys.A, AnalogPin.P0)) {
        basic.showString("A")
    }
    if (tinkercademy.ADKeyboard(ADKeys.B, AnalogPin.P0)) {
        basic.showString("B")
    }
    if (tinkercademy.ADKeyboard(ADKeys.C, AnalogPin.P0)) {
        basic.showString("C")
    }
    if (tinkercademy.ADKeyboard(ADKeys.D, AnalogPin.P0)) {
        basic.showString("D")
    }
    if (tinkercademy.ADKeyboard(ADKeys.E, AnalogPin.P0)) {
        basic.showString("E")
    }
})

MicroPython Octopus ADKeypad Sample Code

MicroPython
from microbit import *
while True:
    if pin0.read_analog() < 10:
        display.show('A')
    if pin0.read_analog() > 40 and pin0.read_analog() < 60:
        display.show('B')
    if pin0.read_analog() > 80 and pin0.read_analog() < 110:
        display.show('C')
    if pin0.read_analog() > 130 and pin0.read_analog() < 150:
        display.show('D')
    if pin0.read_analog() > 530 and pin0.read_analog() < 560:
        display.show('E')

JavaScript Octopus Crash Sensor Brick Sample Code

JavaScript
basic.forever(() => {
    if (pins.digitalReadPin(DigitalPin.P16) == 0) {
        basic.showString("Crashed!")
    }
})

MicroPython Octopus Crash Sensor Brick Sample Code

MicroPython
from microbit import *
while True:
  if pin16.read_digital() == False:
    display.scroll("Crashed!")

JavaScript Octopus Passive Buzzer Brick OBPB01 Sample Code

JavaScript
basic.forever(() => {
    for (let i = 0; i < 2; i++) {
        music.playTone(330, music.beat(BeatFraction.Whole))
    }
    music.playTone(349, music.beat(BeatFraction.Whole))
    for (let i = 0; i < 2; i++) {
        music.playTone(392, music.beat(BeatFraction.Whole))
    }
    music.playTone(349, music.beat(BeatFraction.Whole))
    music.playTone(330, music.beat(BeatFraction.Whole))
    music.playTone(294, music.beat(BeatFraction.Whole))
    for (let i = 0; i < 2; i++) {
        music.playTone(262, music.beat(BeatFraction.Whole))
    }
    music.playTone(294, music.beat(BeatFraction.Whole))
    music.playTone(330, music.beat(BeatFraction.Whole))
    music.playTone(330, music.beat(BeatFraction.Double))
    music.playTone(294, music.beat(BeatFraction.Half))
    music.playTone(294, music.beat(BeatFraction.Double))
})

MicroPython Octopus Passive Buzzer Brick OBPB01 Sample Code

MicroPython
import music
while True:
  for count in range(2):
    music.pitch(330, 500)
  music.pitch(349, 500)
  for count2 in range(2):
    music.pitch(392, 500)
  music.pitch(349, 500)
  music.pitch(330, 500)
  music.pitch(294, 500)
  for count3 in range(2):
    music.pitch(262, 500)
  music.pitch(294, 500)
  music.pitch(330, 500)
  music.pitch(330, 1000)
  music.pitch(294, 250)
  music.pitch(294, 1000)

JavaScript Octopus 5mm LED Brick OBLED - Red Sample Code

JavaScript
basic.forever(() => {
    pins.digitalWritePin(DigitalPin.P16, 1)
    basic.pause(200)
    pins.digitalWritePin(DigitalPin.P16, 0)
    basic.pause(200)
})

MicroPython Octopus 5mm LED Brick OBLED - Red Sample Code

MicroPython
from microbit import *
while True:
    pin16.write_digital(1)
    sleep(200)
    pin16.write_digital(0)
    sleep(200)

JavaScript Octopus 5mm LED Brick - Green Sample Code

JavaScript
basic.forever(() => {
    pins.digitalWritePin(DigitalPin.P16, 1)
    basic.pause(200)
    pins.digitalWritePin(DigitalPin.P16, 0)
    basic.pause(200)
})

MicroPython Octopus 5mm LED Brick - Green Sample Code

MicroPython
from microbit import *
while True:
    pin16.write_digital(1)
    sleep(200)
    pin16.write_digital(0)
    sleep(200)

JavaScript Octopus 5mm LED Brick OBLED - Blue Sample Code

JavaScript
basic.forever(() => {
    pins.digitalWritePin(DigitalPin.P16, 1)
    basic.pause(200)
    pins.digitalWritePin(DigitalPin.P16, 0)
    basic.pause(200)
})

MicroPython Octopus 5mm LED Brick OBLED - Blue Sample Code

MicroPython
from microbit import *
while True:
    pin16.write_digital(1)
    sleep(200)
    pin16.write_digital(0)
    sleep(200)

JavaScript Octopus Analog Rotation Brick OBARot Sample Code

JavaScript
input.onButtonPressed(Button.A, () => {
    basic.showNumber(pins.analogReadPin(AnalogPin.P0))
})

MicroPython Octopus Analog Rotation Brick OBARot Sample Code

MicroPython
from microbit import *
while True:
    if button_a.is_pressed():
        value = pin0.read_analog()
        display.show(str(value))

MicroPython Micro:bit Sample Code

MicroPython
from microbit import * 
while True:
    display.scroll("This is the Micro:bit!")
    sleep(1000)
    display.show(Image.HEART)
    sleep(1000)

JavaScript IIC OLED Display Sample Code

JavaScript
basic.forever(() => {
    OLED.init(32, 128)
    OLED.showString("This is the IIC OLED Display.")
    basic.pause(2000)
    OLED.clear()
    OLED.init(32, 128)
    OLED.showString("This OLED was coded  with the Micro:bit.")
    basic.pause(2000)
    OLED.clear()
})

MicroPython IIC OLED Display Sample Code

MicroPython
# Please visit the following links below to see more on using the OLED Display with the Micro:bit on MicroPython
# as there're no finalized libraries made yet:

# https://github.com/fizban99/microbit_ssd1306
# https://gist.github.com/yuliantoeric/2eff0ed8fd2457f7862a8ea9979073ca
# https://github.com/Tinkertanker/pxt-ssd1306-microbit
# https://github.com/micropython/micropython/blob/479392a56e6edd8449e594c0e5c1e8f5176411ab/drivers/display/ssd1306.py
# https://github.com/khenderick/micropython-drivers

JavaScript TowerPro SG-90 Mini Servo Motor (1.6kg) Sample Code

JavaScript
basic.forever(() => {
    pins.servoWritePin(AnalogPin.P0, 180)
    basic.pause(500)
    pins.servoWritePin(AnalogPin.P0, 0)
    basic.pause(500)
})

MicroPython TowerPro SG-90 Mini Servo Motor (1.6kg) Sample Code

MicroPython
from microbit import *
while True:
    pin0.write_analog(180)
    sleep(500)
    pin0.write_analog(1)
    sleep(500) 

JavaScript Octopus PIR Sensor Brick Sample Code

JavaScript
basic.forever(() => {
    if (pins.digitalReadPin(DigitalPin.P0) == 1) {
        basic.showString("Motion!")
    }
})

MicroPython Octopus PIR Sensor Brick Sample Code

MicroPython
from microbit import *
while True:
    if pin0.read_digital():
        display.scroll("Motion!")

JavaScript Octopus Soil Moisture Sensor Brick Sample Code

JavaScript
let value = 0
basic.forever(() => {
    value = pins.analogReadPin(AnalogPin.P0)
    basic.clearScreen()
    basic.showNumber(value)
    basic.pause(3000)
})

Credits

Electorials Electronics

Electorials Electronics

73 projects • 21 followers
I'm an electronic hobbyist interested in anything, from Arduino to drones. I plan to educate people with the content on my website.

Comments