Wher are the circuitpython references

I’m looking for circuitpython references. I only found the firmware, and one tutorial with very generic things. What I’m looking for are the hardware-specific things such as definitions and examples to run say accelerometer etc. I tried adafruit’s LIS3DH library but the code complains about SCL or SDA needs a pullup. Is it saying it’s the wrong pins or wrong address used etc.? With a hardware reference and wio terminal specific sample code I could make this work.

Thanks.

In lieu of circuitpython reference, I installed ardupy. It works but the aip tool is giving errors. Is it my python 3.8.3 version?

Traceback (most recent call last):
File “c:\program files (x86)\python38-32\lib\runpy.py”, line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File “c:\program files (x86)\python38-32\lib\runpy.py”, line 87, in run_code
exec(code, run_globals)
File "C:\Program Files (x86)\Python38-32\Scripts\aip.exe_main
.py", line 7, in
File “c:\program files (x86)\python38-32\lib\site-packages\aip\main.py”, line 52, in main
from aip.command import commands_dict, parse_command
File “c:\program files (x86)\python38-32\lib\site-packages\aip\command.py”, line 46, in
from aip.build import buildCommand
File “c:\program files (x86)\python38-32\lib\site-packages\aip\build.py”, line 34, in
from pip._internal.operations.prepare import (
ImportError: cannot import name ‘_download_http_url’ from ‘pip._internal.operations.prepare’ (c:\program files (x86)\python38-32\lib\site-packages\pip_internal\operations\prepare.py)

The iap.exe seems to run OK. It returns board info as 2020-08-14.

Either circuitpython or ardupy seems more trouble than it’s worth for something that can be done on Arduino IDE. I mean, running python on a microcontroller is nice but I can’t get aip to install libraries so I’m not able to drive much hardware, neither can I write my own libraries because I’m not sure how in python. I’ll have to find good reasons to use them vs. Arduino IDE.

Reference to what? The CircuitPython native APIs are here: https://circuitpython.readthedocs.io/en/latest/README.html

Each library also has its own API docs. Here are the LIS3DH ones: https://circuitpython.readthedocs.io/projects/lis3dh/en/latest/ You can find them from the GitHub page by clicking the “Docs Passing” button on the README.

Adafruit also has a bunch of guides. The essentials is the best place to start: https://learn.adafruit.com/circuitpython-essentials/

What LIS3DH breakout are you using? Does it have pullups on board? (Adafruit’s do.)

If you read my OP, I did load a circuitpython lis3dh library for the INTERNAL accelerometer on Wio terminal and their sample code but it didn’t work. So I guess I need to specify the correct SCL SDA pin naming correctly or enable pullup. I appreciate your time though.

I got the internal accelerometer working by creating an i2c instance for the built-in gyroscope pins provided through the busio package. This requires the adafruit_lis3dh library from here: https://circuitpython.org/libraries

import adafruit_lis3dh
import digitalio
import board
import busio
import time

int1 = digitalio.DigitalInOut(board.GYROSCOPE_INT) # pin connected to interrupt
i2c = busio.I2C(board.GYROSCOPE_SCL, board.GYROSCOPE_SDA)
lis3dh = adafruit_lis3dh.LIS3DH_I2C(i2c, int1=int1)
lis3dh.range = adafruit_lis3dh.RANGE_8_G
for i in range(5):
    print(lis3dh.acceleration)
    time.sleep(5)

This is fantastic progress!

I’m looking to get connected to the GPS in the LoRaWan Chassis.

What I do not yet know is how to correctly define the pins for the GNSS (GPS.) The board does not seem to define the GPS pins the way way it does the ones for the accelerometer.

I’m not completely sure if the GPS should use a UART, or I2C like you have here for the accelerometer.

It would really be ideal if Seeed would actually assign an engineer to spend a little time with circuitpython and map out examples of how to use each of the hardware capabilities on the WIO terminal and the Lora chassis so the learning curve would not stop us from making progress.

I have many friends who would by these devices, yet if I can’t get them to work, why would they?