• 0 Votes
    6 Posts
    63 Views
    T
    It looks like you are using signed intergers/numbers for the reading from the light sensor. When it reaches the half way value it wraps around and goes negative. If you simply define the data as an unsigned type does it fix the issue.
  • Cannot import lora library

    LoPy lopy lora import library pycom
    2
    0 Votes
    2 Posts
    98 Views
    ShanevanJS
    @Kcsss Read the documentation here more carefully. The case is important! from network import LoRa import socket import ubinascii import struct # Initialise LoRa in LORAWAN mode. # Please pick the region that matches where you are using the device: # Asia = LoRa.AS923 # Australia = LoRa.AU915 # Europe = LoRa.EU868 # United States = LoRa.US915 lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.EU868)
  • 0 Votes
    1 Posts
    95 Views
    No one has replied
  • Framebuf library incomplete ?

    Issues & Bugs e-ink framebuf library micropython
    3
    0 Votes
    3 Posts
    445 Views
    E
    @robert-hh Working ! Thank you 😊
  • 1 Votes
    4 Posts
    662 Views
    T
    @rcolistete Thanks for the links. Thats a great start, and already has helped me in the implementation of one of my components. As a noob to Pycom, it really has taken longer than it should have to acquaint myself with where to find information, drivers, tutorials, and examples for Pycom. For instance, the links you provided are very useful, but for a newcomer they are very much in the woodworks, and I still think everything is too scattered. Some consolidation would be greatly appreciated. Even a pinned getting started page with links would be a start. Through comparing a few Pycom libraries that were adapted from Micropython libraries I have gotten the hang of how to convert over libraries. If there was a good centralized place to post Pycom libraries I would be happy to share my adaptations and the libraries I've created for some components that don't have libraries out there at all. A tutorial, for converting libraries would still be great, thanks @Paul-Thornton for your consideration.
  • Pycom + Azure IoT Hub SDK

    MicroPython azure library pycom micropython
    1
    0 Votes
    1 Posts
    351 Views
    No one has replied
  • Controlling NeoPixel LED

    SiPy led spi library
    9
    0 Votes
    9 Posts
    1k Views
    robert-hhR
    @brossingo I simplified the neopixel demo code using RMT a little bit. Also, I made a similar short function using SPI. It works to some extend (better than the other SPI driver), but the problem is the unpredictable timing of SPI. It had gaps between the words it sends, which the disturbs the communication. Here is the RMT variant from machine import RMT from time import sleep def send_rmt(data, rmt): from time import sleep_us no_pixel = len(data) bits = bytearray(no_pixel * 24 * 2) duration = bytearray(no_pixel * 24 * 2) index = 0 for pixel in data: for byte in pixel: mask = 0x80 while mask: bits[index] = 1 bits[index+1] = 0 if byte & mask: duration[index] = 8 duration[index+1] = 4 else: duration[index] = 4 duration[index+1] = 8 index += 2 mask >>= 1 sleep_us(60) # wait for the reset time rmt.pulses_send(tuple(duration), tuple(bits)) sleep_us(60) # wait for the reset time data = 6 * [ (127, 0, 0), # green (0, 127, 0), # red (0, 0, 127), # blue ] blank = 24 * [(0,0,0)] rmt = RMT(channel=3, gpio="P11", tx_idle_level=0) while True: send_rmt(data, rmt) sleep(1) send_rmt(blank, rmt) sleep(1) And here is the SPI variant: from machine import SPI, disable_irq, enable_irq from time import sleep, sleep_us def send_spi(data, spi): no_pixel = len(data) buffer = bytearray(no_pixel * 3 * 4) index = 0 for pixel in data: for byte in pixel: bits = 0 mask = 0x80 while mask: bits <<= 4 if byte & mask: bits |= 0x0e else: bits |= 0x08 mask >>= 1 buffer[index] = (bits >> 24) & 0xff buffer[index + 1] = (bits >> 16) & 0xff buffer[index + 2] = (bits >> 8) & 0xff buffer[index + 3] = bits & 0xff index += 4 sleep_us(60) # ensure initial reset state = disable_irq() spi.write(buffer) enable_irq(state) data = 6 * [ (85, 0, 0), # green (0, 85, 0), # red (0, 0, 85), # blue (85, 85, 85), # white ] blank = 24 * [(0,0,0)] spi = SPI(SPI.MASTER, baudrate=3200000, polarity = 0, firstbit = SPI.MSB, bits=32) while True: send_spi(data, spi) sleep(1) send_spi(blank, spi) sleep(1)
  • 1 Votes
    1 Posts
    545 Views
    No one has replied
  • Pytrack GPS library

    Discussion pytrack gps library gps pytrack
    11
    0 Votes
    11 Posts
    2k Views
    G
    @tttadam Hi. Looks like you might have found my L76micropyGPS.py useful. Any feedback welcome! I just updated the doco as the issue has been resolved, and I had not updated the README.
  • Import Custom Library

    MicroPython i2c atom library import fipy
    3
    2
    0 Votes
    3 Posts
    829 Views
    B
    @dan I understand that and get this error when I flash it, but I would also like it to link in Atom so I can build and run it right away without having to flash it. [image: 1537809779016-2f6c007e-17d2-4496-a1eb-b82c77973113-image.png]
  • Library for Sensirion SHT1x SHT7x

    LoPy lopy sht1x sht7x library
    1
    0 Votes
    1 Posts
    458 Views
    No one has replied
  • 0 Votes
    1 Posts
    545 Views
    No one has replied
  • Still no directories in lib?

    Issues & Bugs lib library wheel directory egg
    2
    0 Votes
    2 Posts
    591 Views
    danD
    Hi @brady-aiello, You can add folders to lib/ to your project. You can import them with from folder import file.
  • fipy eagle footprint

    Comments & Feedback eagle fipy library
    3
    0 Votes
    3 Posts
    1k Views
    X
    @pas We have KiCad footprints available on GitHub https://github.com/pycom/footprints All our development modules have the same footprint so if you have one for a WiPy2, LoPy or SiPy etc (NOT WiPy/WiPy1) then that will also work with the FiPy. We also have Altium design files for the Universal Expansion Board https://docs.pycom.io/chapter/datasheets/oem/universal_reference.html which for the headers uses the same footprint as the FiPy (it fits into the expansion board the same way).
  • 0 Votes
    3 Posts
    990 Views
    M
    You have to look at machine.deepsleep link text For example with machine.deepsleep(60000) the LoPy will sleep for 60 seconds (better to say about 60 seconds).
  • 1 Votes
    6 Posts
    2k Views
    C
    @robert-hh Hello, I updated the firmware and it seems to work, thank you ! Can't belive I didn't do this step ...
  • 0 Votes
    11 Posts
    5k Views
    C
    This error statement TypeError: 'module' object is not callable is raised as you are being confused about the Class name and Module name. The problem is in the import line . You are importing a module, not a class. This happend because the module name and class name have the same name . If you have a class "MyClass" in a file called "MyClass.py" , then you should import : from MyClass import MyClass In Python , a script is a module, whose name is determined by the filename . So when you start out your file MyClass.py with import MyClass you are creating a loop in the module structure. In Python, everything (including functions, methods, modules, classes etc.) is an object , and methods are just attributes like every others. So,there's no separate namespaces for methods. So when you set an instance attribute, it shadows the class attribute by the same name. The obvious solution is to give attributes different names.
  • Uploading libraries to FiPy

    Discussion pysense fipy library
    3
    0 Votes
    3 Posts
    1k Views
    robert-hhR
    @mylescai You can access the file system of your FiPy using ftp. Have a look at chapter 2.4 of the documentation: https://docs.pycom.io/chapter/toolsandfeatures/FTP.html That should also be possible in PyMakr. The primary obstacle is, that you might have to set the IP setting of your computers wifi temporarily to use the FiPy's access point. Later, you can reconfigure the FiPy to use your home network as a Station.
  • 0 Votes
    4 Posts
    1k Views
    D
    @jclo13 Two general guidelines has been ignored in the github post, which are sensor & ground isolation and duration of excitation : ā€œ Sensors must be powered individually, and the ground must be isolated from sensor to sensor. Even if powered individually, an open ground path to another un-powered sensor can't be allowed. This is best accomplished using multiplexers to open and close the appropriate channels. ā€œ For additional details please refer to : www.irrometer.com/200ss.html