Skip to content

Commit 4bad57d

Browse files
committed
see github.com/BPI-STEAM/BPI-BIT-MicroPython/releases/tag/20190116.
1 parent 557985a commit 4bad57d

4 files changed

Lines changed: 420 additions & 81 deletions

File tree

10.microbit/accelerometer.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,17 @@ def get_direction(self, delay=30):
128128

129129
return None if len(result) != 1 else result[0]
130130

131+
def was_gesture(self, gesture="shake"):
132+
print("was_gesture will be supported in the future.")
133+
134+
def is_gesture(self, gesture="shake"):
135+
print("is_gesture will be supported in the future.")
136+
137+
def get_gestures(self):
138+
print("get_gestures will be supported in the future.")
139+
140+
def current_gesture(self):
141+
print("current_gesture will be supported in the future.")
131142

132143
def unit_test():
133144
print("\n\

10.microbit/display.py

Lines changed: 103 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -138,137 +138,145 @@ def __next__(self):
138138
value = self.tem[self.num]
139139
self.num += 1
140140
return value # 返回下一个值
141+
142+
def copy(self):
143+
print("copy will be supported in the future.")
144+
145+
def invert(self):
146+
for i in range(self.tem):
147+
self.tem[i] = 0 if self.tem[i] != 0 else 1
148+
return self
141149

142150
HEART = [0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1,
143-
1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0]
151+
1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0]
144152
HEART_SMALL = [0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0,
145-
0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0]
153+
0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0]
146154
HAPPY = [0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0,
147-
0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0]
155+
0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0]
148156
SMILE = [0, 0, 0, 1, 0, 0, 1,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ARROW_NE = [1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1,
197205
0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]
198206
ARROW_E = [0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1,
199-
0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0]
207+
0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0]
200208
ARROW_SE = [0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0,
201209
0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0]
202210
ARROW_S = [0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1,
203-
1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0]
211+
1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0]
204212
ARROW_SW = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
205213
0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1]
206214
ARROW_W = [0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1,
207-
0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0]
215+
0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0]
208216
ARROW_NW = [0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1,
209217
0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0]
210218
TRIANGLE = [0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0,
211219
1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0]
212220
TRIANGLE_LEFT = [0, 0, 0, 0, 1, 0, 0, 0, 1, 1,
213-
0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1]
221+
0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1]
214222
CHESSBOARD = [0, 1, 0, 1, 0, 1, 0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, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0]
264272
UMBRELLA = [0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1,
265273
1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0]
266274
SNAKE = [0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0,
267-
0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0]
275+
0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0]
268276
ALL_CLOCKS = [CLOCK12, CLOCK1, CLOCK2, CLOCK3, CLOCK4, CLOCK5,
269-
CLOCK6, CLOCK7, CLOCK8, CLOCK9, CLOCK10, CLOCK11]
277+
CLOCK6, CLOCK7, CLOCK8, CLOCK9, CLOCK10, CLOCK11]
270278
ALL_ARROWS = [ARROW_N, ARROW_NE, ARROW_E,
271-
ARROW_SE, ARROW_S, ARROW_SW, ARROW_W, ARROW_NW]
279+
ARROW_SE, ARROW_S, ARROW_SW, ARROW_W, ARROW_NW]
272280

273281

274282
class Display:
@@ -315,10 +323,10 @@ def scroll(self, val, color=Red, delay=150):
315323
else:
316324
pixel_col[i] = [0, 0, 0]
317325

318-
for i in range(6): # 开始滚动显示 显示6行,一行为空白
326+
for i in range(6): # 开始滚动显示
319327
for t in range(4):
320328
self.tem[20 - (t * 5):20 - (t * 5) + 5] = self.tem[20 -
321-
((t + 1) * 5):20 - ((t + 1) * 5) + 5]
329+
((t + 1) * 5):20 - ((t + 1) * 5) + 5]
322330
# 数据向前移动5位
323331
if i == 5:
324332
self.tem[0:5] = Zero[0:5] # 每个字符之间间隔一行
@@ -340,7 +348,7 @@ def __show(self, it, color):
340348
self.Led.LoadPos(r, color if col else black)
341349
self.Led.Show()
342350

343-
def show(self, images, color=Red,*, loop=False, delay=500):
351+
def show(self, images, wait=True, color=Red,*, loop=False, delay=500, clear=False):
344352
if isinstance(images, str):
345353
images = CharData[images]
346354
if isinstance(images, list) and (isinstance(images[0], Image) or isinstance(images[0], list)):
@@ -366,6 +374,21 @@ def show(self, images, color=Red,*, loop=False, delay=500):
366374
self.Led.fill((0, 0, 0))
367375
self.Led.Show()
368376

377+
def get_pixel(self, x=0, y=0):
378+
print("get_pixel will be supported in the future.")
379+
380+
def set_pixel(self, x=0, y=0, value=9):
381+
print("set_pixel will be supported in the future.")
382+
383+
def on(self):
384+
self.clear()
385+
386+
def off(self):
387+
self.clear()
388+
389+
def is_on(self):
390+
return self.Led != None
391+
369392
def unit_test():
370393
print('The unit test code is as follows')
371394
print('\n\
@@ -400,7 +423,7 @@ def unit_test():
400423
"00000:"\n\
401424
"00000:"\n\
402425
"00000")\n\
403-
all_boats = [boat1, boat2, boat3, boat4, boat5, boat6]\n\
426+
all_boats = [boat1, boat2, boat3, boat4, boat5, boat6]\n\
404427
display.scroll(\'hello,world\', Yellow)\n\
405428
sleep_ms(1000)\n\
406429
display.scroll(454545)\n\
@@ -430,40 +453,40 @@ def unit_test():
430453
')
431454
display = Display()
432455
boat1 = Image("05050:"
433-
"05050:"
434-
"05050:"
435-
"99999:"
436-
"09990")
456+
"05050:"
457+
"05050:"
458+
"99999:"
459+
"09990")
437460

438461
boat2 = Image("00000:"
439-
"05050:"
440-
"05050:"
441-
"05050:"
442-
"99999")
462+
"05050:"
463+
"05050:"
464+
"05050:"
465+
"99999")
443466

444467
boat3 = Image("00000:"
445-
"00000:"
446-
"05050:"
447-
"05050:"
448-
"05050")
468+
"00000:"
469+
"05050:"
470+
"05050:"
471+
"05050")
449472

450473
boat4 = Image("00000:"
451-
"00000:"
452-
"00000:"
453-
"05050:"
454-
"05050")
474+
"00000:"
475+
"00000:"
476+
"05050:"
477+
"05050")
455478

456479
boat5 = Image("00000:"
457-
"00000:"
458-
"00000:"
459-
"00000:"
460-
"05050")
480+
"00000:"
481+
"00000:"
482+
"00000:"
483+
"05050")
461484

462485
boat6 = Image("00000:"
463-
"00000:"
464-
"00000:"
465-
"00000:"
466-
"00000")
486+
"00000:"
487+
"00000:"
488+
"00000:"
489+
"00000")
467490

468491
all_boats = [boat1, boat2, boat3, boat4, boat5, boat6]
469492
display.scroll('hello,world', Yellow)

10.microbit/microbit.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
pin19 = pins.Pins(22)
2424
pin20 = pins.Pins(21)
2525

26+
def panic(flag=0):
27+
return machine.reset_cause()
28+
29+
reset = machine.reset
30+
2631
import display
2732
Image = display.Image
2833
display = display.Display()
@@ -53,4 +58,4 @@
5358
import compass
5459
compass = compass.Compass(__sensor)
5560
except Exception as e:
56-
print("MPU9250 Error", e)
61+
print("MPU9250 Error", e)

0 commit comments

Comments
 (0)