Commit Graph

95 Commits

Author SHA1 Message Date
Philip Howard e249113fea
Merge pull request #183 from pimoroni/driver/icp10125
Driver for the ICP10125 pressure & temperature sensor
2021-11-09 17:02:50 +00:00
Philip Howard 1a9e2802fe
Merge pull request #206 from pimoroni/driver/pwm3901
C++ and MP drivers and examples for Optical Flow sensors
2021-10-06 11:19:29 +01:00
Philip Howard 0c4be0dbb9
Merge pull request #209 from helgibbons/main
add Pico Explorer weather station examples
2021-10-06 11:13:28 +01:00
Philip Howard 3c57cbcdef
Merge pull request #208 from pimoroni/picowireless-ppwhttp
PicoWireless: move HTTP code to ppwhttp library
2021-10-06 11:12:13 +01:00
Phil Howard 1bb61b2c52 PicoWireless: network scan example
Basic example to scan SSID networks and list them.
2021-10-04 16:20:57 +01:00
helgibbons de05483ca6 linting Pico Explorer weather station examples 2021-09-30 19:05:11 +01:00
helgibbons 67a4490180 add Pico Explorer tiny weather station examples 2021-09-30 18:37:53 +01:00
Phil Howard 7772959450 PicoWireless: add TLS support to ppwhttp
* Add a new "connection_mode" argument to http_request. This can be TLS_MODE or TCP_MODE
* Fix a bug where assumptions about json parsing don't hold up
* Check for TCP_STATE_CLOSED and bail early from connect_to_server
2021-09-30 10:47:30 +01:00
Phil Howard 78d50c2986 PicoWireless: ppwhttp add wildcard routes
This slightly reckless extension to ppwhttp adds support for wildcard routes, eg:

/get_led/<int:index>

Which will serve URLs in the form:

/get_led/10
/get_led/22

etc.

The wildcard includes <type:key>, attempting to match the behaviour of Flask.

Only type "int" is supported currently.

/get_led/<index> - would set data["index"] to a string
/get_led/<int:index> - would attempt to parse the URL part to an int, and would not serve eg: /get_led/hi

See plasma_ws2812_http.py for example usage.
2021-09-29 16:27:02 +01:00
Phil Howard b92d77a2f9 PicoWireless: handle encoding/content type better in ppwhttp
Uses the correct? default Content-Type and encoding for HTTP.

Parses the Content-Type header *before* decoding the content body.

Handles JSON type gracefully.

Decodes the response body accoding to the encoding header.
2021-09-29 14:09:59 +01:00
Phil Howard eb3c8b0ebc PicoWireless: ppwhttp fix to support JSON content type
This is a bit of a fudge, and was only tested against the Cheerlights API.

Detects JSON content type, parses out the content length and truncates the response body to length.

Should probably do this *before* decoding from utf-8.

Updates cheerlights.py API example to support XML, JSON and TEXT endpoints.
2021-09-29 12:47:55 +01:00
Phil Howard 9f07be90da PicoWireless: move HTTP code to ppwhttp library
Creates a new ppwhttp library to hide the implementation detail of HTTP clients/servers from the examples.

Adds a new example - plasma_ws2812_http.py - showing how to expand rgb_http.py to use a WS2812 pixel strip.

Adds "secrets.py" and moves WIFI connection information there. ppwhttp will throw an error if it's missing.
2021-09-29 12:20:06 +01:00
ZodiusInfuser 27b74e140b Finished drivers bindings and examples for flow sensors. 2021-09-13 21:58:11 +01:00
Phil Howard 759868e787 Python bindings & docs for ICP10125 2021-09-08 14:10:21 +01:00
ZodiusInfuser 9906fdec38 C class and MP bindings for PicoDisplay2 2021-09-08 13:56:03 +01:00
Phil Howard 90c01f613c Pico Unicorn: Add rainbow.py example 2021-08-27 10:52:26 +01:00
ZodiusInfuser bb23ba22db Added C++ port of accelerometer example 2021-08-25 18:12:10 +01:00
Phil Howard 03a7cbee06 Fix speed gauge 2021-08-25 16:06:51 +01:00
ZodiusInfuser 08a54a600f Linting fixes 2021-08-25 15:23:22 +01:00
ZodiusInfuser 9d505f208a Added MP accelerometer example 2021-08-25 15:06:05 +01:00
ZodiusInfuser 4393372726 Linting Fixes 2021-08-24 16:10:23 +01:00
ZodiusInfuser f92d35a014 Added I2C defines 2021-08-24 16:06:44 +01:00
ZodiusInfuser 51d4901e34 Added rotary encoder MP example 2021-08-24 16:01:51 +01:00
ZodiusInfuser a5d9fcf48a Renamed bme68x plasma example to Monitor 2021-08-24 11:41:56 +01:00
ZodiusInfuser 5b40899e44 Linting fixes 2021-08-23 16:30:03 +01:00
ZodiusInfuser a98252993d Linting fixes 2021-08-23 16:28:27 +01:00
ZodiusInfuser 88a9449e0a Added micropython version of bme example, and backported some fixes 2021-08-23 16:21:38 +01:00
ZodiusInfuser 41365fd89e Updated button example for new mp 2021-08-19 15:50:16 +01:00
ZodiusInfuser c4e0316fd8 Linting fix 2021-08-19 15:19:01 +01:00
ZodiusInfuser 0faa312358 Updated micropython example to use working submodule 2021-08-19 15:16:40 +01:00
ZodiusInfuser 64e6d248d5 Updated rainbow example to be consistant across languages 2021-08-19 12:58:13 +01:00
ZodiusInfuser 373a7df923 Linting fixes 2021-08-19 12:58:13 +01:00
ZodiusInfuser 336791ed77 Updated plasma mp examples to use user_sw and current sensing 2021-08-19 12:58:13 +01:00
Phil Howard 59d3c91f1b Demo and document RGBLED and Button
Add constants to `plasma` module for Plasma 2040 pins.
2021-08-02 14:37:07 +01:00
Phil Howard 596fb55a57 Add "plasma" MicroPython module
Includes "WS2812" and "APA102" modules, wrapping the libraries.

Uses a destructor to clean up the LED strip and resources when MicroPython is stopped/restarted.
2021-08-02 14:37:06 +01:00
Phil Howard be9b1437db Add MicroPython bindings for BME280 and BMP280 2021-08-02 14:20:59 +01:00
Phil Howard 746e21c542 BME68X Add Time/Temp config to Gas, document 2021-08-02 14:12:46 +01:00
Phil Howard 618fd559f9 BME68X Python example, docs and configure 2021-08-02 14:12:46 +01:00
Phil Howard b80b714c4f BH1745 MicroPython bindings & example 2021-07-30 12:41:06 +01:00
Phil Howard ff8917cbe0 Retry failed HTTP connections in cheerlights.py
As discussed on https://forums.pimoroni.com/t/pico-wireless-pack-fetching-data-from-web/17215/ the cheerlights.py example was stalling on the first HTTP request.

I have added a timeout in this case, so the code will stop waiting and retry after the 60second polling wait period. Users report this does the trick!
2021-06-05 19:45:07 +01:00
Phil Howard 0bda2abd2a Fix AS7262 constructor and example 2021-05-18 11:36:14 +01:00
Phil Howard 66f6983290 Port remaining modules to PimoroniI2C, update examples 2021-05-18 11:18:41 +01:00
Phil Howard 77839e2a6a Tidy up constructors, drop unused variables, const single addr
Removes i2c_inst_t from constructors since it's ignored, and updated the Python bindings not to supply this argument. Instance is inferred from the supplied pins.
2021-05-17 14:50:49 +01:00
ZodiusInfuser 0a804a426b Micropython linting fixes 2021-05-14 13:15:39 +01:00
ZodiusInfuser 7886b8e78d Finished MP bindings for RV3028 and included a simple example 2021-05-14 13:15:39 +01:00
ZodiusInfuser 707aeba5aa MP linting fix 2021-05-14 12:41:46 +01:00
ZodiusInfuser 7eb8197e45 Added micropython examples for IOExpander 2021-05-14 12:41:46 +01:00
ZodiusInfuser 370167f0f4 Renamed MICS demo file to match other breakouts 2021-05-14 12:41:46 +01:00
Phil Howard 7202926fbb Add mics6814 python demo 2021-05-14 12:41:46 +01:00
ZodiusInfuser 4b850b9290 Added micropython examples for Pot and Enc 2021-05-14 12:41:46 +01:00