Giter Club home page Giter Club logo

mpy-lib's People

Contributors

ele-clouds avatar ianhom avatar mschiessl avatar shaoziyang avatar windfallw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpy-lib's Issues

Error running the bmp280.py

I am having an error trying to run the test for the bmp280 sensor. This is the error showing:

File "bmp280.py", line 9, in init
File "bmp280.py", line 45, in get2Reg
File "bmp280.py", line 41, in getReg
OSError: [Errno 19] ENODEV

How do I solve this? Thanks

Wake up esp32 each 2 or 3 hours

Hi, the alarm allows esp32 wake up each 2 or 3 hours?
I was trying to wake up esp32 every two hours using this line "ds.ALARM(ds.Day(), (ds.Hour() + 2)%24, 46, DS3231.PER_HOUR)" but the esp32 keeps waking up every hour.
Can you help how to do it?
Thank you in advance.

Error to run test.py in nodemcu esp8266 board

I have insert bmp280 and test.py into esp8266 board by using ampy.after I have tried 'ampy -p /dev/ttyUSB0 -b 115200 run test.py' but it is showing :

Traceback (most recent call last):
  File "/usr/local/bin/ampy", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/ampy/cli.py", line 337, in run
    output = board_files.run(local_file, not no_output)
  File "/usr/local/lib/python3.6/dist-packages/ampy/files.py", line 303, in run
    out = self._pyboard.execfile(filename)
  File "/usr/local/lib/python3.6/dist-packages/ampy/pyboard.py", line 273, in execfile
    return self.exec_(pyfile)
  File "/usr/local/lib/python3.6/dist-packages/ampy/pyboard.py", line 267, in exec_
    raise PyboardError('exception', ret, ret_err)
ampy.pyboard.PyboardError: ('exception', b'', b'Traceback (most recent call last):\r\n  File "<stdin>", line 15, in <module>\r\n  File "bmp280.py", line 20, in __init__\r\n  File "bmp280.py", line 60, in get2Reg\r\n  File "bmp280.py", line 55, in getReg\r\nOSError: [Errno 110] ETIMEDOUT\r\n')

I am using Ubuntu 18.04 terminal to upload the code.How can I resolve this issue?

Problem with the alarm

Hi
I' ve had some problems with the following lines of code:
ds.ALARM(12, 20, 10, ds.PER_DISABLE)
ds.ALARM(12, 20, 10, ds.PER_DAY)
When I run the programan, the shell show me the following:
-----AttributeError: 'DS3231' object has no attribute 'PER_DISABLE'---
I am using an ESP32 dev module
Could you help me fix it?
Thank you very much in advance.

RTC Calibration

Thanks for the library, its been helpful for my application.

I am trying to use your library to get my RTC working with OpenMV Cam H7, I have read about the calibration of RTC which basically set the the RTC time and stores it in the battery-backed memory. So if a backup cell is used the RTC will run accurately in the event of a power outage.

I was wondering how do you I can set the RTC time and store it in the memory with your library. I will appreciate any suggestion on how to do this.
Thanks.

Line 36 in lib calls time.sleep_ms, but imports as "from time import sleep_ms"

Line 36 of mp_i2c_lcd1602.py gives an error of time not defined.

Since Micropython 1.13, it would be better for line 10 to read:
from utime import sleep_ms

and line 36:
sleep_ms(1)

test.py could have a better I2C definition, for example

i2c = I2C(0, scl=Pin(22), sda=(Pin(21), freq=400000)
LCD = LCD1602(i2c, addr=39)

This is how I got this working.

NeoPixel neo_16x16 to neo_10x10

Hi!

Using your neo_16x16 code to customize neo_10x10 :
test.py

from machine import Pin
import time

from neo10x10 import neo10x10

np = neo10x10(Pin(5))

npdat=[
0x00, 0x66, 0x66, 0xe0, 0xe0, 0xe0, 0xe0, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 0x00
] 

n = 0
while 1:
    np.show(npdat, n)
    n = (n-10)%10
    time.sleep_ms(100)

neo10x10.py

from machine import Pin
import neopixel

class neo10x10:
    def __init__(self, pin):
        self.np = neopixel.NeoPixel(pin, 100)
        self.color = (0,0,8)
    
    def clear(self):
        self.np.fill((0,0,0))
        self.np.write()

    def set(self, n, color=''):
        if color!='':
            self.np[n] = color
        else:
            self.np[n] = self.color
        self.np.write()

    def setcolor(self, color):
        self.color = color

    def show(self, dat, offset=0, clear = True, color=''):
        if color != '':
            self.color = color
        if clear:
            self.np.fill((0,0,0))
        num = 0
        for x in range(10):
            for y in range(10):
                if (x+offset)>=len(dat):
                    self.np[x*10+y]=(0,0,0)
                else:
                    if (1<<y)&dat[x+offset]:
                        if offset%2==0:
                            self.np[x*10 + y] = self.color
                        else:
                            self.np[x*10 + 9 - y] = self.color

        self.np.write()

trying to display an image smile
I get this output
what could be the problem?
tell me in which editor to convert the image into an array of data?

Voltage on SQW

Hello. I state that I am not a programmer. I am using your library and thank you for sharing it. I use it with an ESP32 that I would like to awaken from a deep sleep with a DS3231. The DS3231 is connected to ESP32 with SDA on pin 22 and SCL on pin 23. The SQW pin of the DS3231 to pin 32 of the ESP32. On the DS3231 I was able to correctly set both the time and the alarm for waking up. When ESP32 goes into deep sleep, a problem arises that prevents it from restarting at the time programmed on DS3231. It happens that when ESP32 goes into deep sleep the voltage goes from 0V to 3.28V and immediately reactivates ESP32 in a continuous loop and I cannot understand why. The DS3231 is powered directly from the 3.3v pin of the ESP32 which continues to supply current even when it goes into dormancy. This is my code.

import machine
from machine import Pin, I2C, RTC, lightsleep, wake_reason, idle
import utime
import time
import DS3231

i2c = I2C(sda = Pin(22), scl=Pin(23))
ds = DS3231.DS3231(i2c)

led = Pin (18, Pin.OUT)
led.value(1)
rtc = RTC()

import esp32
from time import sleep
sleep(10)

btn1 = Pin(32, Pin.IN, Pin.PULL_DOWN) # Normally low, high when pressed
esp32.wake_on_ext0(pin = btn1, level = esp32.WAKEUP_ANY_HIGH)
machine.deepsleep()

What could be the problem?

I thank you in advance.

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.