Giter VIP home page Giter VIP logo

micropython-pico's Introduction

micropython-pico : additional libraries for Raspberry-Pi Pico running under MicroPython

to be documented

Libraries

The libraries must be copied on the MicroPython board before using the various examples.

On a WiFi capable plateform:

>>> import mip
>>> mip.install("github:mchobby/micropython-pico")

Or via the mpremote utility :

mpremote mip install github:mchobby/micropython-pico

What are the libraries:

  • servo.py : offers the Servo class used to control servo-moteur.
  • ultrasonic.py : offers the Ultrasonic class used to measure distances with a HC-SR04.
  • buzzer.py : allows to play sound with a Piezo Buzzer (default on GPIO7).
  • ws2812.py : use the WS2812 / NeoPixel Smart RGB leds (default on GPIO11).

Servo motor

By default, the library generates a pulse between 1.0 to 2.0 ms (mid-point at 1.5ms) for an angle from 0 to 180°.

>>> s=Servo(10)
>>> s.angle(0)
>>> s.angle(90)
>>> s.angle(180)

Pulse values can be changed by calling the set calibration() method

# default calibration
s.calibration( 1.0, 2.0, 1.5, 0, 180 )
# SG92R calibratioin
s.calibration( 0.5, 2.5, 1.5, 0, 180 )

Ultrasonic

An example is available in the following repository pico-projects under the file test_ultrasonic.py

micropython-pico's People

Contributors

mchobby avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.