Skip to content

Commit 806a29e

Browse files
committed
Initial commit.
0 parents  commit 806a29e

File tree

63 files changed

+1628
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1628
-0
lines changed

02-PyBoard/blink.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Taken from the REPL based example.
2+
import pyb
3+
4+
5+
while True:
6+
pyb.LED(1).toggle()
7+
pyb.delay(500)

03-BBC_microbit/blink.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from microbit import display, sleep
2+
3+
4+
while True:
5+
display.set_pixel(2, 2, 9)
6+
sleep(500)
7+
display.set_pixel(2, 2, 0)
8+
sleep(500)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Taken from the REPL based example.
2+
from board import D13
3+
import digitalio
4+
import time
5+
6+
led = digitalio.DigitalInOut(D13)
7+
led.switch_to_output()
8+
while True:
9+
led.value = not led.value
10+
time.sleep(0.5)

05-ESP8266-32/blink.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Taken from the REPL based example.
2+
from machine import Pin
3+
import time
4+
5+
6+
led = Pin(2, Pin.OUT)
7+
8+
9+
while True:
10+
led.value(not led.value())
11+
time.sleep(0.5)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import neopixel
2+
import random
3+
import time
4+
from board import NEOPIXEL
5+
6+
7+
np = neopixel.NeoPixel(NEOPIXEL, 10, auto_write=False)
8+
step = 32
9+
10+
11+
while True:
12+
for i in range(10):
13+
for j in range(10):
14+
np[j] = tuple((max(0, val - step) for val in np[j]))
15+
r = random.randint(0, 255)
16+
g = random.randint(0, 255)
17+
b = random.randint(0, 255)
18+
np[i] = (r, g, b)
19+
np.write()
20+
time.sleep(0.05)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Taken from the REPL based example.
2+
from board import D13
3+
import time
4+
import pulseio
5+
6+
7+
pin = pulseio.PWMOut(D13)
8+
9+
10+
while True:
11+
for i in range(16):
12+
pin.duty_cycle = 2 ** i
13+
time.sleep(0.1)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from microbit import display, Image
2+
3+
4+
my_picture = Image(
5+
'33333:'
6+
'36663:'
7+
'36963:'
8+
'36663:'
9+
'33333:')
10+
11+
display.show(my_picture)

07-Visual_Feedback/microbit_happy.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Taken from the REPL based example.
2+
from microbit import display, Image
3+
4+
5+
display.show(Image.HAPPY)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Taken from the REPL based example
2+
from microbit import display
3+
4+
5+
display.scroll("Hello World!", delay=80, wait=False, loop=True, monospace=True)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from microbit import display, Image
2+
3+
buf = bytearray(x % 10 for x in range(100))
4+
i = Image(10, 10, buf)
5+
6+
display.show(i.crop(3, 4, 5, 5))

0 commit comments

Comments
 (0)