Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Installing a library from Github
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Installing a library from Github

by Jerryy on Wed Apr 21, 2021 5:59 pm

I am attempting to install the "HC-SR04 / US-100 Library" for use with the
HC-SR04 Sonar Sensor. When I clicked on the "install the Adafruit CircuitPython HCSR04 library"
hyperlink in the "Python & CircuitPython" section, the system goes to a page in github entitled
"adafruit/Adafruit_CircuitPython_HCSR04". Since I have never been on github before,
I am a little unsure how to proceed from this point.

I'm guessing that I follow the section entitled "Installing from PyPI" and run the command
"pip3 install adafruit-circuitpython-hcsr04 on my PC that is connected to my Trinket M0.
Is that correct or am I missing something
.
Thanks

Jerry

Jerryy
 
Posts: 24
Joined: Thu Feb 22, 2018 9:06 pm

Re: Installing a library from Github

by tannewt on Wed Apr 21, 2021 6:21 pm

Take a look at this guide: https://learn.adafruit.com/welcome-to-c ... -libraries

It explains how to install libraries onto a CircuitPython device. (pip is used for desktop Python.)

tannewt
 
Posts: 2385
Joined: Thu Oct 06, 2016 8:48 pm

Re: Installing a library from Github

by Jerryy on Wed Apr 21, 2021 9:01 pm

Hi:

I downloaded the Circuitpython bundle and realized that both file/directory (adafruit_hcsr04.mpy
adafruit_bus_device that needed to be placed in the CIRCUITPY/lib folder are in the
CircuitPython library bundle.

When I first read the document for this device I though it indicated that I should first load the
adafruit_hcsr04.py file in Github page pointed to and then download adafruit_hcsr04.mpy &
adafruit_bus_device from the CircuitPython library bundle.

I guess I took the first paragraph:
"To use the HC-SR04, you'll need to install the Adafruit CircuitPython HCSR04 library on your CircuitPython board."
to mean click on that link and load the file found there.

My mistake :)
Thanks for the help

Jerry

Jerry

Jerryy
 
Posts: 24
Joined: Thu Feb 22, 2018 9:06 pm

Please be positive and constructive with your questions and comments.