This repo features examples for MicroPython similar to Arduino.
###00.Basics
BareMinimum
A template that serves as a starting point
HelloWorld
Turns on LED 4 (the blue LED).
REPL
REPL stands for Read-Eval-Print-Loop.
Very important and highly useful feature that allows easy debugging and quick learning.
All examples could be tested on the board without having to manually upload every time.
RunForever
A simple while True loop that mimicks Arduino's loop() at a very simple level
###01.LEDs
Blink
Replicates Arduino's Blink sketch exactly (uses .on() and .off() and loops)
BlinkWithoutDelay
Replicates Arduino's BlinkWithoutDelay sketch (uses .toggle() and .millis())
BlinkWithToggle
Same as Blink, but uses .toggle()
Fade
Similar to Arduino's Fade sketch
Heartbeat
Something more interesting that simple blinks
HeartbeatFade Similar to previous 'Heartbeat' script, but fades the light in and out instead of just switching on and off
###02.Inputs
SimpleButton
Pull down button that toggles an LED
Potentiometer
Simple analog input that controls an LED's intensity
###03.Pins
not yet updated - expect update by 19th Aug, 2014
###04.Accelerometer
AccelerometerControlLED
Controls blink speed of an LED using the accelerometer's value along the X axis
This script also features a custom remap() function that remaps a value to different bounds/range
AccelerometerTest
Prints the x,y,z values of the accelerometer every second (REPL required)
====================
Contributions include code from:
Mithru Vigneshwara
Dave Hylands