You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
####NOTE: THIS REPOSITORY HAS RECENTLY BEEN UPDATED AND THE CHANGES HAVEN'T BEEN UPDATED IN THIS FILE YET
6
-
7
-
8
-
9
4
This repo features examples for MicroPython similar to Arduino.
10
5
11
6
###00.Basics
12
7
13
-
__BareMinimum__
14
-
A template that serves as a starting point
8
+
__boot.py__
9
+
Sample boot file which points to 'helloWorld.py' to run after booting. The examples in this repo will not include copies of the boot file. Please edit and include boot.py accordingly.
15
10
16
-
__HelloWorld__
11
+
__helloWorld.py__
17
12
Turns on LED 4 (the blue LED).
18
13
19
14
__REPL__
20
15
REPL stands for Read-Eval-Print-Loop.
21
16
Very important and highly useful feature that allows easy debugging and quick learning.
22
-
All examples could be tested on the board without having to manually upload every time.
23
-
24
-
__RunForever__
25
-
A simple while True loop that mimicks Arduino's loop() at a very simple level
17
+
All examples can be tested on the board without having to manually upload every time.
26
18
27
19
====================
28
20
29
21
###01.LEDs
30
22
31
-
__Blink__
23
+
__blink__
32
24
Replicates Arduino's Blink sketch exactly (uses .on() and .off() and loops)
33
25
34
-
__BlinkWithoutDelay__
26
+
__blinkWithoutDelay__
35
27
Replicates Arduino's BlinkWithoutDelay sketch (uses .toggle() and .millis())
36
28
37
-
__BlinkWithToggle__
29
+
__blinkToggle__
38
30
Same as Blink, but uses .toggle()
39
31
40
-
__Fade__
32
+
__fade__
41
33
Similar to Arduino's Fade sketch
42
34
43
-
__Heartbeat__
35
+
__heartbeat__
44
36
Something more interesting that simple blinks
45
37
46
-
__HeartbeatFade__
38
+
__heartbeatFade__
47
39
Similar to previous 'Heartbeat' script, but fades the light in and out instead of just switching on and off
48
40
49
41
====================
50
42
51
43
###02.Inputs
52
44
53
-
__SimpleButton__
45
+
__button__
54
46
Pull down button that toggles an LED
55
47
56
-
__Potentiometer__
48
+
__potentiometer__
57
49
Simple analog input that controls an LED's intensity
58
50
59
-
__SwitchObject__
51
+
__switchObject__
60
52
Simple demo of the Switch object that can control the inbuilt USR button on the pyboard
61
53
62
-
__SwitchCallback__
54
+
__switchCallback__
63
55
Example of the Switch.callback function (uses interrupts)
64
56
65
57
====================
@@ -73,11 +65,11 @@ Example of using on of the pins to control an output (LED, motor, buzzer, relay,
73
65
74
66
###04.Accelerometer
75
67
76
-
__AccelerometerControlLED__
68
+
__accelerometerControlLED__
77
69
Controls blink speed of an LED using the accelerometer's value along the X axis
78
70
This script also features a custom remap() function that remaps a value to different bounds/range
79
71
80
-
__AccelerometerTest__
72
+
__accelerometer__
81
73
Prints the x,y,z values of the accelerometer every second (REPL required)
82
74
83
75
====================
@@ -92,6 +84,13 @@ Generates a random number roughly between -90 and 90, and sets it as the servo's
92
84
93
85
====================
94
86
87
+
###06.Clock
88
+
89
+
__clock__
90
+
Uses the RTC (independent Real Time Clock) in the pyboard. Prints the time and date with delay of 100 microseconds. Start time is set with variables.
0 commit comments