MicroPython: Difference between revisions

From Noisebridge
Jump to navigation Jump to search
m (Reverted edits by SteveMnuchin (talk) to last revision by )
m (Mac tips)
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
== Mac OS X tips ==
*Install esptool
**https://stackoverflow.com/questions/17271319/how-do-i-install-pip-on-macos-or-os-x
*Find the Serial
**https://stackoverflow.com/questions/12254378/how-to-find-the-serial-port-number-on-mac-os-x
*Blue USB/Serial Adapter
**https://learn.adafruit.com/adafruits-raspberry-pi-lesson-5-using-a-console-cable/software-installation-mac

Revision as of 10:53, 2 February 2019

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


Mac OS X tips