This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x_pos = 0 | |
x_pos_1 = 0 | |
y_pos_1 = 0 | |
remind = 0 | |
remind_1 = 0 | |
remind_2 = 0 | |
move_counter = 0 | |
player_ = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from microbit import * | |
analog_val = 0 | |
while True: | |
analog_val = pin0.read_analog() | |
if (button_a.is_pressed() == True): | |
NewerOlder