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
Copy file name to clipboardExpand all lines: README.md
+19-10Lines changed: 19 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,15 @@ MicroPython-Examples
3
3
4
4
This repo features examples for MicroPython similar to Arduino.
5
5
6
+
### Troubleshooting
7
+
8
+
__Safe Mode__
9
+
Hold down USR switch and quickly press and release RST switch. Release USR switch when only the orange LED is lit. The orange LED will flash quickly 4 times and stop. This is safe mode, which ignores boot.py and main.py. It might be helpful if something is running on the pyboard and that's preventing you from changing its contents.
10
+
11
+
__Factory Reset__
12
+
Hold down USR switch and quickly press and release RST switch. Release USR switch when both orange and green LEDs are lit. Both those LEDs will flash 4 times and stop. The board will now be factory reset.
13
+
14
+
6
15
### 00.Basics
7
16
8
17
__boot.py__
@@ -16,7 +25,7 @@ REPL stands for Read-Eval-Print-Loop.
16
25
Very important and highly useful feature that allows easy debugging and quick learning.
17
26
All examples can be tested on the board without having to manually upload every time.
18
27
19
-
====================
28
+
---
20
29
21
30
### 01.LEDs
22
31
@@ -38,7 +47,7 @@ Something more interesting that simple blinks
38
47
__heartbeatFade__
39
48
Similar to previous 'Heartbeat' script, but fades the light in and out instead of just switching on and off
40
49
41
-
====================
50
+
---
42
51
43
52
### 02.Inputs
44
53
@@ -54,16 +63,16 @@ Simple demo of the Switch object that can control the inbuilt USR button on the
54
63
__switchCallback__
55
64
Example of the Switch.callback function (uses interrupts)
56
65
57
-
====================
66
+
---
58
67
59
68
### 03.Pins
60
69
61
70
__PinsBasicOutput__
62
71
Example of using on of the pins to control an output (LED, motor, buzzer, relay, et al)
63
72
64
-
====================
73
+
---
65
74
66
-
###04.Accelerometer
75
+
###04.Accelerometer
67
76
68
77
__accelerometerControlLED__
69
78
Controls blink speed of an LED using the accelerometer's value along the X axis
@@ -72,7 +81,7 @@ This script also features a custom remap() function that remaps a value to diffe
72
81
__accelerometer__
73
82
Prints the x,y,z values of the accelerometer every second (REPL required)
74
83
75
-
====================
84
+
---
76
85
77
86
### 05.Servos
78
87
@@ -82,14 +91,14 @@ Example of setting a servo's angle, and animating it over time
82
91
__ServoGetAngle__
83
92
Generates a random number roughly between -90 and 90, and sets it as the servo's angle. The servo's angle is then obtained from the object
84
93
85
-
====================
94
+
---
86
95
87
96
### 06.Clock
88
97
89
98
__clock__
90
99
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.
91
100
92
-
====================
101
+
---
93
102
94
103
### 07.Mouse
95
104
@@ -99,14 +108,14 @@ Sets the device as a HID when it boots.
99
108
__main.py__
100
109
Control cursor with the pyboard's accelerometer. The USR switch is used as the button. Hold the board such that side with the microUSB port points to the direction you face.
101
110
102
-
====================
111
+
---
103
112
104
113
### 08.Sensors
105
114
106
115
__HC-SR04__
107
116
Prints distance values in cm and inches from two ultrasonic sensors connected to the pyboard. Uses the ultrasonic module available [here](https://github.com/mithru/MicropythonLibs/tree/master/Ultrasonic) and [here](https://github.com/skgsergio/MicropythonLibs/tree/master/Ultrasonic).
0 commit comments