Giter VIP home page Giter VIP logo

raspberrypi-pico-micropython-cookbook's Introduction

Hello! I'm Alan Wang👋

Software engineer/technical writer/translator

profile

The chances of finding out what’s really going on in the universe are so remote, the only thing to do is hang the sense of it and keep yourself occupied.

--- The Hitchhiker's Guide to the Galaxy

raspberrypi-pico-micropython-cookbook's People

Contributors

alankrantas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

raspberrypi-pico-micropython-cookbook's Issues

Trying to use Neopixel and DHT11 together but it fails

Hello,

I am using Raspberry Pi Pico with your libraries. When I try to put the examples together, it stucks exactly at "data = self._sm.get()" line which is under dht.measure(). Do you know why and is there any solution?

You can see my code below and I am using NeoPixel on GP6, DHT11 on GP11.

import time
from dht import DHT11
from ws2812_driver import NeoPixel


RED = (255, 0, 0)
YELLOW = (255, 150, 0)
GREEN = (0, 255, 0)
CYAN = (0, 255, 255)
BLUE = (0, 0, 255)
PURPLE = (180, 0, 255)
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
COLORS = (RED, YELLOW, GREEN, CYAN, BLUE, PURPLE, WHITE, BLACK)


dht_sensor = DHT11(11)

neo = NeoPixel(6, n=1, brightness=0.3, autowrite=False)
    
    
while True:

    # fill
    for color in COLORS:       
        neo.fill(color)
        neo.show()
        time.sleep(0.25)

    # chase
    for color in COLORS:       
        for i in range(neo.n):
            neo[i] = color
            neo.show()
            time.sleep(0.025)

    # rainbow
    for i in range(255):
        neo.rainbow_cycle(i)
        neo.show()
        time.sleep(0.0025)
    print('Here2')
    # rotate
    for _ in range(neo.n * 3):
        neo.rotate(clockwise=True)
        neo.show()
        time.sleep(0.05)
    print('Here3')
    neo.clear()
    neo.show()
    print('Here4')
    
    dht_sensor.measure()
    print('Humidity = {}%, temperature = {}C, checksum passed = {}'.format(
        dht_sensor.humidity(),
        dht_sensor.temperature(),
        dht_sensor.successful()
    ))
    time.sleep(2)

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.