Skip to content

Instantly share code, notes, and snippets.

View four in the row.py
x_pos = 0
x_pos_1 = 0
y_pos_1 = 0
remind = 0
remind_1 = 0
remind_2 = 0
move_counter = 0
player_ = 1
View motr_board.py
from microbit import *
pin8.set_analog_period(1)
pin12.set_analog_period(1)
pin0.set_analog_period(1)
pin16.set_analog_period(1)
def_speed = 512
def move_forward():
pin8.write_analog(def_speed)
pin12.write_analog(0)
View cardboard_bot.py
from microbit import *
pin0.set_analog_period(10)
pin1.set_analog_period(10)
motor_direction = 0
zero_pos = 155
f_pos_1 = 165
f_pos_2 = 145
r_pos_1 = 0
r_pos_2 = 0
View Ampmeter.py
from microbit import *
analog_val = 0
analog_val_old = 0
while True:       
analog_val = pin0.read_analog()           
analog_val_old = analog_val   
analog_val = (analog_val * 0.0029297)   
View voltmeter.py
from microbit import *
analog_val = 0
analog_val_old = 0
#display.scroll("Simple Voltmeter with autorange.", delay=100)
while True:
analog_val = pin0.read_analog()
if (analog_val != (analog_val_old + 1)|(analog_val_old - 1)):
View pov.py
from microbit import *
time_ = 1
time_1 = 1
axis_x = 0
pin16.write_digital(1)
pin15.write_digital(1)
pin14.write_digital(1)
pin13.write_digital(1)
@VlastimilHovan
VlastimilHovan / stopwatch.py
Created Feb 1, 2017
BBC microbit stopwatch
View stopwatch.py
from microbit import *
def clear_line(line):
display.set_pixel(0, line, 0)
display.set_pixel(1, line, 0)
display.set_pixel(2, line, 0)
display.set_pixel(3, line, 0)
display.set_pixel(4, line, 0)
@VlastimilHovan
VlastimilHovan / measuring tape.py
Created Dec 1, 2016
BBC microbit digital measuring tape (code release)
View measuring tape.py
# with this code you need to make hardware changes to sensor
# or you can add on code to disable pull resistor on pin16
from microbit import *
remind = 0
remind_1 = 0
counter = 0
display.scroll("Hello Girls")
@VlastimilHovan
VlastimilHovan / maths game.py
Created Dec 1, 2016
BBC microbit maths game (code release)
View maths game.py
#Written by Vlastimil Hovan 2016
#Please include text above in any redistribution
#Thanks
from microbit import *
import random
remind = -1
operation_ = 0
number_1 = 0
@VlastimilHovan
VlastimilHovan / colour sensor.py
Created Nov 30, 2016
BBC microbit colour sensor (code release)
View colour sensor.py
from microbit import *
analog_val = 0
while True:
analog_val = pin0.read_analog()
if (button_a.is_pressed() == True):