MicroPython: Difference between revisions

From Noisebridge
Jump to navigation Jump to search
No edit summary
m (Reverted edits by SteveMnuchin (talk) to last revision by )
Line 33: Line 33:


Source and instructions for compiling yourself are available at: https://github.com/micropython/micropython
Source and instructions for compiling yourself are available at: https://github.com/micropython/micropython
[[File:Munichin1.png]]
[[File:Munichin2.png]]

Revision as of 21:05, 4 January 2018

This is all about micropython.org in particular using it with ESP8266 & ESP32

programs

solid color neopixels (WS2812b)

from machine import Pin
from neopixel import NeoPixel

NEO_PIN = const(3)
NEO_COUNT = const(72)

neo = Pin(NEO_PIN, Pin.OUT)
np = NeoPixel(neo, NEO_COUNT)

#        R   G   B
color = [0, 20, 20]

def stripColor():
    global NEO_COUNT, np, color
    for x in range(0, NEO_COUNT):
        np[x] = color
    np.write()

# update the entire strip with one color
stripColor()

firmware/flashing

Instructions for flash and pre-compiled binaries can be found at: https://micropython.org/download

Source and instructions for compiling yourself are available at: https://github.com/micropython/micropython