From 9b1d44707c2026528a39997dd69d343b6dd5393f Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 22 Feb 2021 15:12:06 +0100 Subject: [PATCH 01/22] restructuring Pycoproc documentation --- .../pycom/expansionboards/L76GNSS.md | 25 +++ .../pycom/expansionboards/LIS2HH12.md | 35 ++++ .../pycom/expansionboards/LTR329ALS01.md | 30 ++++ .../pycom/expansionboards/MFRC630.md | 94 +++++++++++ .../pycom/expansionboards/MPL3115A2.md | 29 ++++ .../pycom/expansionboards/SI7006A20.md | 25 +++ .../pycom/expansionboards/_index.md | 10 +- .../pycom/expansionboards/pycoproc.md | 6 + .../pycom/expansionboards/pycoproc2.md | 6 + .../pycom/expansionboards/pyscan.md | 152 ------------------ .../pycom/expansionboards/pysense.md | 114 ------------- .../pycom/expansionboards/pysense2.md | 130 --------------- 12 files changed, 252 insertions(+), 404 deletions(-) create mode 100644 content/firmwareapi/pycom/expansionboards/L76GNSS.md create mode 100644 content/firmwareapi/pycom/expansionboards/LIS2HH12.md create mode 100644 content/firmwareapi/pycom/expansionboards/LTR329ALS01.md create mode 100644 content/firmwareapi/pycom/expansionboards/MFRC630.md create mode 100644 content/firmwareapi/pycom/expansionboards/MPL3115A2.md create mode 100644 content/firmwareapi/pycom/expansionboards/SI7006A20.md create mode 100644 content/firmwareapi/pycom/expansionboards/pycoproc.md create mode 100644 content/firmwareapi/pycom/expansionboards/pycoproc2.md delete mode 100644 content/firmwareapi/pycom/expansionboards/pyscan.md delete mode 100644 content/firmwareapi/pycom/expansionboards/pysense.md delete mode 100644 content/firmwareapi/pycom/expansionboards/pysense2.md diff --git a/content/firmwareapi/pycom/expansionboards/L76GNSS.md b/content/firmwareapi/pycom/expansionboards/L76GNSS.md new file mode 100644 index 00000000..1318ad12 --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/L76GNSS.md @@ -0,0 +1,25 @@ +--- +Title: "GPS" +--- + +The L76GNSS is the GPS module that can provide location data to your application. + +## Constructors + +### class L76GNSS(pytrack = None, sda = 'P22', scl = 'P21', timeout = None) + +Creates a `L76GNSS` object. Constructor must be passed a Pytrack or I2C object to successfully construct. Set the `timeout` to a time period (in seconds) for the GPS to search for a lock. If a lock is not found by the time the `timeout` has expired, the `coordinates` method will return `(None, None)`. + +## Methods + +### L76GNSS.coordinates(debug = False) + +Read the longitude and latitude from the `L76GNSS`. Returns a tuple with `(longitude, latitude)`. With `debug` set to `True` the output from the GPS is verbose. + +### L76GNSS.dump_nmea() + +Continuously print nmea sentences received from the `L76GNSS` to the REPL. This is useful if you want to use a graphical tool over UART to visualise GPS reception + +### L76GNSS.write() + +Send commands to the `L76GNSS`. See the datasheet of the L76 for more information. Be aware that some commands might break the communication interface. diff --git a/content/firmwareapi/pycom/expansionboards/LIS2HH12.md b/content/firmwareapi/pycom/expansionboards/LIS2HH12.md new file mode 100644 index 00000000..48074f9b --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/LIS2HH12.md @@ -0,0 +1,35 @@ +--- +Title: "Accelerometer" +--- + +The LIS2HH12 is a 3-Axis Accelerometer provides outputs for acceleration as well as roll, pitch and yaw. + +## Constructors + +### class LIS2HH12(pycoproc = None, sda = 'P22', scl = 'P21') + +Creates a `LIS2HH12` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. + +## Methods + +### LIS2HH12.acceleration() + +Read the acceleration from the `LIS2HH12`. Returns a tuple with the 3 values of acceleration in g-force: `(x, y, z)`. + +### LIS2HH12.roll() + +Read the current roll from the `LIS2HH12`. Returns a float in degrees in the range -180 to 180. + +### LIS2HH12.pitch() + +Read the current pitch from the `LIS2HH12`. Returns a float in degrees in the range -90 to 90. Once the board tilts beyond this range the values will repeat. This is due to a lack of yaw measurement, making it not possible to know the exact orientation of the board. + +### LIS2HH12.enable_activity_interrupt(threshold, duration, handler=None) + +Set an activity- and inactivity interrupt for the accelerometer. This takes the arguments: +* `threshold`: the activity threshold in `mg`, between 62 - 4000 +* `duration`: the duration in `ms`, between 160 - 40800 +* `handler`: The interrupt handler. When not given, it will print `Activity interrupt` and `Inactivity interrupt` +The function returns a tuple containing the set values: `(threshold, duration)`. These depend on the resolution. + + diff --git a/content/firmwareapi/pycom/expansionboards/LTR329ALS01.md b/content/firmwareapi/pycom/expansionboards/LTR329ALS01.md new file mode 100644 index 00000000..4f495137 --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/LTR329ALS01.md @@ -0,0 +1,30 @@ +--- +Title: "Ambient Light sensor" +--- + +The LTR329ALS01 is a dual light sensor that provides outputs for external light levels in lux. See the datasheet for more information about the wavelengths of the two sensors. + +### Constructors + +### class LTR329ALS01(pycoproc = None, sda = 'P22', scl = 'P21', gain = LTR329ALS01.ALS_GAIN_1X, integration = LTR329ALS01.ALS_INT_100, rate = LTR329ALS01.ALS_RATE_500) + +Creates a `LTR329ALS01` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. The arguments are: +* `pycoproc`: A pycoproc opbject +* `sda / scl`: If pycoproc is not passed, enter the I2C pins here +* `gain`: The light sensor ADC gain. see the Constants for values +* `integration`: Controls the integration time of the periodic measurement. See the Constants for values +* `rate`: The used sample rate in ms, must be set larger than the integration period. See the Constants for values + +## Methods + +### LTR329ALS01.light() + +Read the light levels of both `LTR329ALS01` sensors. Returns a tuple with two values for light levels in lux: `(blue, red)`, between 0-65535. + +## Constants + +The following arguments may be passed into the constructor. + +* gain: `ALS_GAIN_1X`,`ALS_GAIN_2X`, `ALS_GAIN_4X`, `ALS_GAIN_8X`, `ALS_GAIN_48X`, `ALS_GAIN_96X` +* integration: `ALS_INT_50`, `ALS_INT_100`, `ALS_INT_150`, `ALS_INT_200`, `ALS_INT_250`, `ALS_INT_300`, `ALS_INT_350`, `ALS_INT_400` +* rate: `ALS_RATE_50`, `ALS_RATE_100`, `ALS_RATE_200`, `ALS_RATE_500`, `ALS_RATE_1000`, `ALS_RATE_2000` \ No newline at end of file diff --git a/content/firmwareapi/pycom/expansionboards/MFRC630.md b/content/firmwareapi/pycom/expansionboards/MFRC630.md new file mode 100644 index 00000000..7d2c3ab2 --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/MFRC630.md @@ -0,0 +1,94 @@ +--- +Title: "NFC and RFID reader" +--- + +The MFRC630 is a NFC and RFID card reader. + +## Constructors + +### class MFRC630(pycoproc=None, sda='P22', scl='P21', timeout=None, debug=False) + +Creates a `MFRC630` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. + +## Methods + +### MFRC630.mfrc630_cmd_init() + +Initialises the `MFRC630`. + +### MFRC630.mfrc630_cmd_reset() + +Reset the device. Stops the currently active command and resets device. + +### MFRC630.mfrc630_cmd_idle() + +Set the device into idle mode. Stops the currently active command and return to idle mode. + +### MFRC630.mfrc630_cmd_load_key(key) + +Loads the provided key into the key buffer. + +* `key` Array which holds the MIFARE key, **it is always 6 bytes long** + +#### MFRC630.mfrc630_MF_read_block(block_address, dest) + +Reads a block of memory from an authenticated card. Try to read a block of memory from the card with the appropriate timeouts and error checking. + +* `block_address` The block to read +* `dest` The array in which to write the 16 bytes read from the card + +Returns `0` for failure, otherwise the number of bytes received. + +#### MFRC630.mfrc630_MF_auth(uid, key_type, block) + +Perform a MIFARE authentication procedure. This function is a higher-level wrapper around the MF authenticate command. The result of the authentication is checked to identify whether it appears to have succeeded. The key must be loaded into the key buffer with `MFRC630.mfrc630_cmd_load_key(key)`. + +Once authenticated, the authentication MUST be stopped manually by calling the `mfrc630_MF_deauth()` function or otherwise disabling the `Crypto1 ON` bit in the status register. + +* `key_type`: The MIFARE key A or B (`MFRC630_MF_AUTH_KEY_A` or `MFRC630_MF_AUTH_KEY_B`) to use +* `block`: The block to authenticate +* `uid`: The authentication procedure required the first four bytes of the card's UID to authenticate + +Returns `0` in case of failure, nonzero in case of success. + +#### MFRC630.mfrc630_MF_deauth() + +Disables MIFARE authentication. Disable the `Crypto1` bit from the status register to disable encryption. + +#### MFRC630.mfrc630_iso14443a_WUPA_REQA(instruction) + +Send `WUPA` and `REQA`. Returns the response byte, the answer to request `A` byte (`ATQA`), or `0` in case of no answer. + +* instruction: `MFRC630_ISO14443_CMD_WUPA`, `MFRC630_ISO14443_CMD_REQA` + +#### MFRC630.mfrc630_iso14443a_select(uid) + +Performs the `SELECT` procedure to discover a card's UID. This performs the `SELECT` procedure as explained in _ISO14443A_, this determines the UID of the card, if multiple cards are present, a collision will occur, which is handled according to the norm. + +* `uid`: The UID of the card will be stored into this array. + +Returns the length of the UID in bytes (`4, 7, 10`), or `0` in case of failure. + +#### MFRC630.print_debug(msg) + +Prints debug statements if `DEBUG` is enabled. + +#### MFRC630.format_block(block, length) + +Prints `block` with `length`. + +#### MFRC630.mfrc630_format_block(data, len) + +Converts `data` to hexadecimal format. + +* `data` The array to be formatted +* `len` The number of bytes to format + +#### MFRC630.mfrc630_print_block(data, len) + +Prints the bytes in `data` array in hexadecimal format, separated by spaces using the `mfrc630_format_block` method. + +* `data` The array to be printed +* `len` The number of bytes to print + +## Constants diff --git a/content/firmwareapi/pycom/expansionboards/MPL3115A2.md b/content/firmwareapi/pycom/expansionboards/MPL3115A2.md new file mode 100644 index 00000000..ebede81b --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/MPL3115A2.md @@ -0,0 +1,29 @@ +--- +Title: "Pressure and Altitude sensor" +--- + +## Constructors + +### class MPL3115A2(pycoproc = None, sda = 'P22', scl = 'P21', mode = MPL3115A2.PRESSURE) + +Creates a `MPL3115A2` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. + +## Methods + +### MPL3115A2.pressure() + +Read the atmospheric pressure of the `MPL3115A2`. Returns a float with the pressure in Pascal. + +### MPL3115A2.altitude() + +Read the altitude of the `MPL3115A2`. Returns a float with the altitude in meter. + +### MPL3115A2.temperature() + +Read the temperature of the `MPL3115A2`. Returns a float with the temperature in degrees Celcius. + +## Constants + +The following constants may be passed into the constructor. + +* mode: `PRESSURE`, `ALTITUDE` \ No newline at end of file diff --git a/content/firmwareapi/pycom/expansionboards/SI7006A20.md b/content/firmwareapi/pycom/expansionboards/SI7006A20.md new file mode 100644 index 00000000..8af5e3ed --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/SI7006A20.md @@ -0,0 +1,25 @@ +--- +Title: "Humidity and Temperature Sensor" +--- + +The Humidity and Temperature sensor provides values of relative humidity and external temperature. + +## Constructors + +### class SI7006A20(pycoproc = None, sda = 'P22', scl = 'P21') + +Creates a `SI7006A20` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. + +## Methods + +### SI7006A20.humidity() + +Read the relative humidity of the `SI7006A20`. Returns a float with the percentage relative humidity. + +### SI7006A20.temperature() + +Read the external temperature of the `SI7006A20`. Returns a float with the temperature in degrees Celcius. + +### SI7006A20.dew_point() + +Calculates the dew point temperature for the current temperature and humidity measurement. \ No newline at end of file diff --git a/content/firmwareapi/pycom/expansionboards/_index.md b/content/firmwareapi/pycom/expansionboards/_index.md index 8829d29f..e30944e1 100644 --- a/content/firmwareapi/pycom/expansionboards/_index.md +++ b/content/firmwareapi/pycom/expansionboards/_index.md @@ -8,14 +8,12 @@ aliases: --- As the development for these devices are on going with additional features being added, every week, it is essential to ensure you frequently check for updates on the Pytrack/Pysense/Pyscan. As well as updating the device firmware, it is important to check the [GitHub repository](https://github.com/pycom/pycom-libraries) for the respective library files as they as also being updated, to include additional features/functionality. -{{% hint style="info" %}} -Please note that updated libraries are available for the Pytrack 2.0 X and Pysense 2.0 X in the pytrack-2 and pysense-2 directories on GitHub. +> Please note that updated libraries are available for the Pytrack 2.0 X and Pysense 2.0 X in the pytrack-2 and pysense-2 directories on GitHub. These new libraries will allow you to use the new additional features. -{{% /hint %}} ## Uploading the Libraries to a Device -These libraries should be uploaded to a device (LoPy, SiPy, WiPy 3.0, etc.) in the same process as a standard MicroPython library. The various `.py` files should be placed into the `/lib` folder on the device. +These libraries should be uploaded to a device in the same process as a standard MicroPython library. The various `.py` files should be placed into the `/lib` folder on the device. Add as many or as few of the libraries that are required. @@ -30,10 +28,6 @@ For example, if using the Pysense and the user wishes to enable the only Acceler - LTR329ALS01.py ``` -{{% hint style="info" %}} -The Pytrack and Pysense boards behave the same as the Expansion Board. `Upload`, `Run` and upload code to Pycom modules via the Pymakr Plugin, in exactly the same process. -{{% /hint %}} - ## Importing/Using the Libraries Once the libraries are uploaded to the device, they can be used/imported as a typical MicroPython library would be. For example, importing and using the light sensor on the Pysense: diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc.md b/content/firmwareapi/pycom/expansionboards/pycoproc.md new file mode 100644 index 00000000..8ed4afcf --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/pycoproc.md @@ -0,0 +1,6 @@ +--- +Title: "Pycoproc" +--- + +The `pycoproc.py` file is a supporting python library for the Pysense, Pytrack and Pyscan expansionboards. + diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc2.md b/content/firmwareapi/pycom/expansionboards/pycoproc2.md new file mode 100644 index 00000000..d84e921e --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/pycoproc2.md @@ -0,0 +1,6 @@ +--- +Title: "Pycoproc2" +--- + + +The `pycoproc2.py` file is a supporting python library for the Pysense 2 and Pytrack 2 expansionboards. diff --git a/content/firmwareapi/pycom/expansionboards/pyscan.md b/content/firmwareapi/pycom/expansionboards/pyscan.md deleted file mode 100644 index 95268327..00000000 --- a/content/firmwareapi/pycom/expansionboards/pyscan.md +++ /dev/null @@ -1,152 +0,0 @@ ---- -title: "Pyscan" -aliases: - - pytrackpysense/apireference/pyscan.html - - pytrackpysense/apireference/pyscan.md - - chapter/pytrackpysense/apireference/pyscan ---- - -This chapter describes the various libraries which are designed for the Pyscan board. This includes details about the various methods and classes available for each of the Pyscan's sensors. - ->Note: follow the guide [here](/firmwareapi/pycom/expansionboards/) to be able to use the functions below - -## 3-Axis Accelerometer (LIS2HH12) - -Pysense has a 3-Axis Accelerometer that provides outputs for acceleration as well as roll, pitch and yaw. - -### Constructors - -#### class LIS2HH12(pysense = None, sda = 'P22', scl = 'P21') - -Creates a `LIS2HH12` object, that will return values for acceleration, roll, pitch and yaw. Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### LIS2HH12.acceleration() - -Read the acceleration from the `LIS2HH12`. Returns a **tuple** with the 3 values of acceleration (G). - -#### LIS2HH12.roll() - -Read the current roll from the `LIS2HH12`. Returns a **float** in degrees in the range -180 to 180. - -#### LIS2HH12.pitch() - -Read the current pitch from the `LIS2HH12`. Returns a **float** in degrees in the range -90 to 90. Once the board tilts beyond this range the values will repeat. This is due to a lack of yaw measurement, making it not possible to know the exact orientation of the board. - -## Digital Ambient Light Sensor (LTR-329ALS-01) - -Pysense has a dual light sensor that provides outputs for external light levels in lux. See the datasheet for more information about the wavelengths of the two sensors. - -### Constructors - -#### class LTR329ALS01(pysense = None, sda = 'P22', scl = 'P21', gain = ALS\_GAIN\_1X, integration = ALS\_INT\_100, rate = ALS\_RATE\_500) - -Creates a `LTR329ALS01` object, that will return values for light in lux. Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### LTR329ALS01.light() - -Read the light levels of both `LTR329ALS01` sensors. Returns a **tuple** with two values for light levels in lux. - -### Arguments - -The following arguments may be passed into the constructor. - -* gain: `ALS_GAIN_1X`,`ALS_GAIN_2X`, `ALS_GAIN_4X`, `ALS_GAIN_8X`, `ALS_GAIN_48X`, `ALS_GAIN_96X` -* integration: `ALS_INT_50`, `ALS_INT_100`, `ALS_INT_150`, `ALS_INT_200`, `ALS_INT_250`, `ALS_INT_300`, `ALS_INT_350`, `ALS_INT_400` -* rate: `ALS_RATE_50`, `ALS_RATE_100`, `ALS_RATE_200`, `ALS_RATE_500`, `ALS_RATE_1000`, `ALS_RATE_2000` - -## Pyscan NFC library (MFRC6300) - -### Constructors - -#### class MFRC630(pyscan=None, sda='P22', scl='P21', timeout=None, debug=False) - -Creates a `MFRC630` object. Constructor must be passed a Pyscan or I2C object to successfully construct. - -### Methods - -#### MFRC630.mfrc630\_cmd\_init() - -Initialise the `MFRC630` with some settings - -#### MFRC630.mfrc630\_cmd\_reset() - -Reset the device. Stops the currently active command and resets device. - -#### MFRC630.mfrc630\_cmd\_idle() - -Set the device into idle mode. Stops the currently active command and return to idle mode. - -#### MFRC630.mfrc630\_cmd\_load\_key(key) - -Loads the provided key into the key buffer. - -* `key` Array which holds the MIFARE key, **it is always 6 bytes long** - -#### MFRC630.mfrc630\_MF\_read\_block(block\_address, dest) - -Reads a block of memory from an authenticated card. Try to read a block of memory from the card with the appropriate timeouts and error checking. - -* `block_address` The block to read -* `dest` The array in which to write the 16 bytes read from the card - -Returns `0` for failure, otherwise the number of bytes received. - -#### MFRC630.mfrc630\_MF\_auth(uid, key\_type, block) - -Perform a MIFARE authentication procedure. This function is a higher-level wrapper around the MF authenticate command. The result of the authentication is checked to identify whether it appears to have succeeded. The key must be loaded into the key buffer with `MFRC630.mfrc630_cmd_load_key(key)`. - -Once authenticated, the authentication MUST be stopped manually by calling the `mfrc630_MF_deauth()` function or otherwise disabling the `Crypto1 ON` bit in the status register. - -* `key_type` The MIFARE key A or B (`MFRC630_MF_AUTH_KEY_A` or `MFRC630_MF_AUTH_KEY_B`) to use -* `block` The block to authenticate -* `uid` The authentication procedure required the first four bytes of the card's UID to authenticate - -Returns `0` in case of failure, nonzero in case of success. - -#### MFRC630.mfrc630\_MF\_deauth() - -Disables MIFARE authentication. Disable the `Crypto1` bit from the status register to disable encryption. - -#### MFRC630.mfrc630\_iso14443a\_WUPA\_REQA(instruction) - -Send `WUPA` and `REQA`. Returns the response byte, the answer to request `A` byte (`ATQA`), or `0` in case of no answer. - -* instruction: `MFRC630_ISO14443_CMD_WUPA`, `MFRC630_ISO14443_CMD_REQA` - -#### MFRC630.mfrc630\_iso14443a\_select(uid) - -Performs the `SELECT` procedure to discover a card's UID. This performs the `SELECT` procedure as explained in _ISO14443A_, this determines the UID of the card, if multiple cards are present, a collision will occur, which is handled according to the norm. - -* `uid`: The UID of the card will be stored into this array. - -Returns the length of the UID in bytes (`4, 7, 10`), or `0` in case of failure. - -#### MFRC630.print\_debug(msg) - -Prints debug statements if `DEBUG` is enabled. - -#### MFRC630.format\_block(block, length) - -Prints `block` with `length`. - -#### MFRC630.mfrc630\_format\_block(data, len) - -Converts `data` to hexadecimal format. - -* `data` The array to be formatted -* `len` The number of bytes to format - -#### MFRC630.mfrc630\_print\_block(data, len) - -Prints the bytes in `data` array in hexadecimal format, separated by spaces using the `mfrc630_format_block` method. - -* `data` The array to be printed -* `len` The number of bytes to print - -{{% hint style="info" %}} -Please note that more functionality is being added weekly to these libraries. If a required feature is not available, feel free to contribute with a pull request at the [Libraries GitHub repository](https://github.com/pycom/pycom-libraries) -{{% /hint %}} diff --git a/content/firmwareapi/pycom/expansionboards/pysense.md b/content/firmwareapi/pycom/expansionboards/pysense.md deleted file mode 100644 index eafc2328..00000000 --- a/content/firmwareapi/pycom/expansionboards/pysense.md +++ /dev/null @@ -1,114 +0,0 @@ ---- -title: "Pysense" -aliases: - - pytrackpysense/apireference/pysense.html - - pytrackpysense/apireference/pysense.md - - chapter/pytrackpysense/apireference/pysense ---- - -This chapter describes the various libraries which are designed for the Pysense board. This includes details about the various methods and classes available for each of the Pysense's sensors. - ->Note: follow the guide [here](/firmwareapi/pycom/expansionboards/) to be able to use the functions below - -## 3-Axis Accelerometer (LIS2HH12) - -Pysense has a 3-Axis Accelerometer that provides outputs for acceleration as well as roll, pitch and yaw. - -### Constructors - -#### class LIS2HH12(pysense = None, sda = 'P22', scl = 'P21') - -Creates a `LIS2HH12` object, that will return values for acceleration, roll, pitch and yaw. Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### LIS2HH12.acceleration() - -Read the acceleration from the `LIS2HH12`. Returns a **tuple** with the 3 values of acceleration (G). - -#### LIS2HH12.roll() - -Read the current roll from the `LIS2HH12`. Returns a **float** in degrees in the range -180 to 180. - -#### LIS2HH12.pitch() - -Read the current pitch from the `LIS2HH12`. Returns a **float** in degrees in the range -90 to 90. Once the board tilts beyond this range the values will repeat. This is due to a lack of yaw measurement, making it not possible to know the exact orientation of the board. - -## Digital Ambient Light Sensor (LTR-329ALS-01) - -Pysense has a dual light sensor that provides outputs for external light levels in lux. See the datasheet for more information about the wavelengths of the two sensors. - -### Constructors - -#### class LTR329ALS01(pysense = None, sda = 'P22', scl = 'P21', gain = ALS\_GAIN\_1X, integration = ALS\_INT\_100, rate = ALS\_RATE\_500) - -Creates a `LTR329ALS01` object, that will return values for light in lux. Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### LTR329ALS01.light() - -Read the light levels of both `LTR329ALS01` sensors. Returns a **tuple** with two values for light levels in lux. - -### Arguments - -The following arguments may be passed into the constructor. - -* gain: `ALS_GAIN_1X`,`ALS_GAIN_2X`, `ALS_GAIN_4X`, `ALS_GAIN_8X`, `ALS_GAIN_48X`, `ALS_GAIN_96X` -* integration: `ALS_INT_50`, `ALS_INT_100`, `ALS_INT_150`, `ALS_INT_200`, `ALS_INT_250`, `ALS_INT_300`, `ALS_INT_350`, `ALS_INT_400` -* rate: `ALS_RATE_50`, `ALS_RATE_100`, `ALS_RATE_200`, `ALS_RATE_500`, `ALS_RATE_1000`, `ALS_RATE_2000` - -## Humidity and Temperature Sensor (SI7006A20) - -Pysense has a Humidity and Temperature sensor that provides values of relative humidity and external temperature. - -### Constructors - -#### class SI7006A20(pysense = None, sda = 'P22', scl = 'P21') - -Creates a `SI7006A20` object, that will return values for humidity (%) and temperature ('C). Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### SI7006A20.humidity() - -Read the relative humidity of the `SI7006A20`. Returns a **float** with the percentage relative humidity. - -#### SI7006A20.temperature() - -Read the external temperature of the `SI7006A20`. Returns a **float** with the temperature. - -## Barometric Pressure Sensor with Altimeter (MPL3115A2) - -Pysense has a Barometric Pressure sensor that provides readings for pressure, altitude as well as an additional temperature sensor. - -### Constructors - -#### class MPL3115A2(pysense = None, sda = 'P22', scl = 'P21', mode = PRESSURE) - -Creates a `MPL3115A2` object, that will return values for pressure (Pa), altitude (m) and temperature ('C). Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### MPL3115A2.pressure() - -Read the atmospheric pressure of the `MPL3115A2`. Returns a **float** with the pressure in (Pa). - -#### MPL3115A2.altitude() - -Read the altitude of the `MPL3115A2`. Returns a **float** with the altitude in (m). - -#### MPL3115A2.temperature() - -Read the temperature of the `MPL3115A2`. Returns a **float** with the temperature in ('C). - -### Arguments - -The following arguments may be passed into the constructor. - -* mode: `PRESSURE`, `ALTITUDE` - -{{% hint style="info" %}} -Please note that more functionality is being added weekly to these libraries. If a required feature is not available, feel free to contribute with a pull request at the [Libraries GitHub repository](https://github.com/pycom/pycom-libraries) -{{% /hint %}} - diff --git a/content/firmwareapi/pycom/expansionboards/pysense2.md b/content/firmwareapi/pycom/expansionboards/pysense2.md deleted file mode 100644 index 56d3a55b..00000000 --- a/content/firmwareapi/pycom/expansionboards/pysense2.md +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: "Pysense 2.0 X" -aliases: - - pytrackpysense/apireference/pysense2.html - - pytrackpysense/apireference/pysense2.md - - chapter/pytrackpysense/apireference/pysense2 ---- - -This chapter describes the various libraries which are designed for the Pysense board. This includes details about the various methods and classes available for each of the Pysense's sensors. - ->Note: follow the guide [here](/firmwareapi/pycom/expansionboards/) to be able to use the functions below - -## 3-Axis Accelerometer (LIS2HH12) - -Pysense has a 3-Axis Accelerometer that provides outputs for acceleration as well as roll, pitch and yaw. - -### Constructors - -#### class LIS2HH12(pysense = None, sda = 'P22', scl = 'P21') - -Creates a `LIS2HH12` object, that will return values for acceleration, roll, pitch and yaw. Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### LIS2HH12.acceleration() - -Read the acceleration from the `LIS2HH12`. Returns a **tuple** with the 3 values of acceleration (G). - -#### LIS2HH12.roll() - -Read the current roll from the `LIS2HH12`. Returns a **float** in degrees in the range -180 to 180. - -#### LIS2HH12.pitch() - -Read the current pitch from the `LIS2HH12`. Returns a **float** in degrees in the range -90 to 90. Once the board tilts beyond this range the values will repeat. This is due to a lack of yaw measurement, making it not possible to know the exact orientation of the board. - -## Digital Ambient Light Sensor (LTR-329ALS-01) - -Pysense has a dual light sensor that provides outputs for external light levels in lux. See the datasheet for more information about the wavelengths of the two sensors. - -### Constructors - -#### class LTR329ALS01(pysense = None, sda = 'P22', scl = 'P21', gain = ALS\_GAIN\_1X, integration = ALS\_INT\_100, rate = ALS\_RATE\_500) - -Creates a `LTR329ALS01` object, that will return values for light in lux. Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### LTR329ALS01.light() - -Read the light levels of both `LTR329ALS01` sensors. Returns a **tuple** with two values for light levels in lux. - -### Arguments - -The following arguments may be passed into the constructor. - -* gain: `ALS_GAIN_1X`,`ALS_GAIN_2X`, `ALS_GAIN_4X`, `ALS_GAIN_8X`, `ALS_GAIN_48X`, `ALS_GAIN_96X` -* integration: `ALS_INT_50`, `ALS_INT_100`, `ALS_INT_150`, `ALS_INT_200`, `ALS_INT_250`, `ALS_INT_300`, `ALS_INT_350`, `ALS_INT_400` -* rate: `ALS_RATE_50`, `ALS_RATE_100`, `ALS_RATE_200`, `ALS_RATE_500`, `ALS_RATE_1000`, `ALS_RATE_2000` - -## Humidity and Temperature Sensor (SI7006A20) - -Pysense has a Humidity and Temperature sensor that provides values of relative humidity and external temperature. - -### Constructors - -#### class SI7006A20(pysense = None, sda = 'P22', scl = 'P21') - -Creates a `SI7006A20` object, that will return values for humidity (%) and temperature ('C). Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### SI7006A20.humidity() - -Read the relative humidity of the `SI7006A20`. Returns a **float** with the percentage relative humidity. - -#### SI7006A20.temperature() - -Read the external temperature of the `SI7006A20`. Returns a **float** with the temperature. - -## Barometric Pressure Sensor with Altimeter (MPL3115A2) - -Pysense has a Barometric Pressure sensor that provides readings for pressure, altitude as well as an additional temperature sensor. - -### Constructors - -#### class MPL3115A2(pysense = None, sda = 'P22', scl = 'P21', mode = PRESSURE) - -Creates a `MPL3115A2` object, that will return values for pressure (Pa), altitude (m) and temperature ('C). Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### MPL3115A2.pressure() - -Read the atmospheric pressure of the `MPL3115A2`. Returns a **float** with the pressure in (Pa). - -#### MPL3115A2.altitude() - -Read the altitude of the `MPL3115A2`. Returns a **float** with the altitude in (m). - -#### MPL3115A2.temperature() - -Read the temperature of the `MPL3115A2`. Returns a **float** with the temperature in ('C). - -### Arguments - -The following arguments may be passed into the constructor. - -* mode: `PRESSURE`, `ALTITUDE` - -### Constructors - -#### class Pytrack(i2c=None, sda='P22', scl='P21') - -Initialise I2C communication with the supervisor MCU - -### Methods - -#### Pysense.sd_power(enabled=True) - -This command allows switching the power supply for the SD card (VCC + PullUP resistors) - -#### Pysense.sensor_power(enabled=True) - -This command allows switching the power supply for the onboard sensors and any sensors connected through the external 6-pin connector - - -{{% hint style="info" %}} -Please note that more functionality is being added weekly to these libraries. If a required feature is not available, feel free to contribute with a pull request at the [Libraries GitHub repository](https://github.com/pycom/pycom-libraries) -{{% /hint %}} From ae80f633864cf3f4f5abe10b1a8161cb2d980a45 Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 22 Feb 2021 15:47:44 +0100 Subject: [PATCH 02/22] Fixed formatting --- .../pycom/expansionboards/L76GNSS.md | 2 +- .../pycom/expansionboards/LIS2HH12.md | 10 ++++----- .../pycom/expansionboards/LTR329ALS01.md | 6 ++---- .../pycom/expansionboards/MFRC630.md | 2 +- .../pycom/expansionboards/MPL3115A2.md | 8 +++---- .../pycom/expansionboards/SI7006A20.md | 6 +++--- .../pycom/expansionboards/pycoproc.md | 21 +++++++++++++++++++ .../pycom/expansionboards/pycoproc2.md | 21 ++++++++++++++++++- 8 files changed, 57 insertions(+), 19 deletions(-) diff --git a/content/firmwareapi/pycom/expansionboards/L76GNSS.md b/content/firmwareapi/pycom/expansionboards/L76GNSS.md index 1318ad12..31b1e7e6 100644 --- a/content/firmwareapi/pycom/expansionboards/L76GNSS.md +++ b/content/firmwareapi/pycom/expansionboards/L76GNSS.md @@ -8,7 +8,7 @@ The L76GNSS is the GPS module that can provide location data to your application ### class L76GNSS(pytrack = None, sda = 'P22', scl = 'P21', timeout = None) -Creates a `L76GNSS` object. Constructor must be passed a Pytrack or I2C object to successfully construct. Set the `timeout` to a time period (in seconds) for the GPS to search for a lock. If a lock is not found by the time the `timeout` has expired, the `coordinates` method will return `(None, None)`. +Creates a L76GNSS object. Constructor must be passed a Pytrack or I2C object to successfully construct. Set the `timeout` to a period in seconds for the GPS to search for a lock. If a lock is not found by the time the `timeout` has expired, the `coordinates` method will return `(None, None)`. ## Methods diff --git a/content/firmwareapi/pycom/expansionboards/LIS2HH12.md b/content/firmwareapi/pycom/expansionboards/LIS2HH12.md index 48074f9b..ab1a0bf6 100644 --- a/content/firmwareapi/pycom/expansionboards/LIS2HH12.md +++ b/content/firmwareapi/pycom/expansionboards/LIS2HH12.md @@ -2,27 +2,27 @@ Title: "Accelerometer" --- -The LIS2HH12 is a 3-Axis Accelerometer provides outputs for acceleration as well as roll, pitch and yaw. +The LIS2HH12 is a 3-Axis Accelerometer provides outputs for acceleration, roll and pitch ## Constructors ### class LIS2HH12(pycoproc = None, sda = 'P22', scl = 'P21') -Creates a `LIS2HH12` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. +Creates a LIS2HH12 object. Constructor must be passed a Pycoproc or I2C object to successfully construct. ## Methods ### LIS2HH12.acceleration() -Read the acceleration from the `LIS2HH12`. Returns a tuple with the 3 values of acceleration in g-force: `(x, y, z)`. +Read the acceleration from the accelerometer. Returns a tuple with the 3 values of acceleration in g-force: `(x, y, z)`. ### LIS2HH12.roll() -Read the current roll from the `LIS2HH12`. Returns a float in degrees in the range -180 to 180. +Read the current roll from the accelerometer. Returns a float in degrees in the range -180 to 180. ### LIS2HH12.pitch() -Read the current pitch from the `LIS2HH12`. Returns a float in degrees in the range -90 to 90. Once the board tilts beyond this range the values will repeat. This is due to a lack of yaw measurement, making it not possible to know the exact orientation of the board. +Read the current pitch from the accelerometer. Returns a float in degrees in the range -90 to 90. Once the board tilts beyond this range the values will repeat. This is due to a lack of yaw measurement, making it not possible to know the exact orientation of the board. ### LIS2HH12.enable_activity_interrupt(threshold, duration, handler=None) diff --git a/content/firmwareapi/pycom/expansionboards/LTR329ALS01.md b/content/firmwareapi/pycom/expansionboards/LTR329ALS01.md index 4f495137..ce3b1f31 100644 --- a/content/firmwareapi/pycom/expansionboards/LTR329ALS01.md +++ b/content/firmwareapi/pycom/expansionboards/LTR329ALS01.md @@ -8,9 +8,7 @@ The LTR329ALS01 is a dual light sensor that provides outputs for external light ### class LTR329ALS01(pycoproc = None, sda = 'P22', scl = 'P21', gain = LTR329ALS01.ALS_GAIN_1X, integration = LTR329ALS01.ALS_INT_100, rate = LTR329ALS01.ALS_RATE_500) -Creates a `LTR329ALS01` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. The arguments are: -* `pycoproc`: A pycoproc opbject -* `sda / scl`: If pycoproc is not passed, enter the I2C pins here +Creates a LTR329ALS01 object. Constructor must be passed a Pycoproc or I2C object to successfully construct. The additional arguments are: * `gain`: The light sensor ADC gain. see the Constants for values * `integration`: Controls the integration time of the periodic measurement. See the Constants for values * `rate`: The used sample rate in ms, must be set larger than the integration period. See the Constants for values @@ -19,7 +17,7 @@ Creates a `LTR329ALS01` object. Constructor must be passed a Pycoproc or I2C obj ### LTR329ALS01.light() -Read the light levels of both `LTR329ALS01` sensors. Returns a tuple with two values for light levels in lux: `(blue, red)`, between 0-65535. +Read the light levels of both light sensors. Returns a tuple with two values for light levels in lux: `(blue, red)`, between 0-65535. ## Constants diff --git a/content/firmwareapi/pycom/expansionboards/MFRC630.md b/content/firmwareapi/pycom/expansionboards/MFRC630.md index 7d2c3ab2..7283d74a 100644 --- a/content/firmwareapi/pycom/expansionboards/MFRC630.md +++ b/content/firmwareapi/pycom/expansionboards/MFRC630.md @@ -14,7 +14,7 @@ Creates a `MFRC630` object. Constructor must be passed a Pycoproc or I2C object ### MFRC630.mfrc630_cmd_init() -Initialises the `MFRC630`. +Initialises the MFRC630. ### MFRC630.mfrc630_cmd_reset() diff --git a/content/firmwareapi/pycom/expansionboards/MPL3115A2.md b/content/firmwareapi/pycom/expansionboards/MPL3115A2.md index ebede81b..3435716f 100644 --- a/content/firmwareapi/pycom/expansionboards/MPL3115A2.md +++ b/content/firmwareapi/pycom/expansionboards/MPL3115A2.md @@ -6,21 +6,21 @@ Title: "Pressure and Altitude sensor" ### class MPL3115A2(pycoproc = None, sda = 'P22', scl = 'P21', mode = MPL3115A2.PRESSURE) -Creates a `MPL3115A2` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. +Creates a MPL3115A2 object. Constructor must be passed a Pycoproc or I2C object to successfully construct. ## Methods ### MPL3115A2.pressure() -Read the atmospheric pressure of the `MPL3115A2`. Returns a float with the pressure in Pascal. +Read the atmospheric pressure of the sensor. Returns a float with the pressure in Pascal. ### MPL3115A2.altitude() -Read the altitude of the `MPL3115A2`. Returns a float with the altitude in meter. +Read the altitude of the sensor. Returns a float with the altitude in meter. ### MPL3115A2.temperature() -Read the temperature of the `MPL3115A2`. Returns a float with the temperature in degrees Celcius. +Read the temperature of the sensor. Returns a float with the temperature in degrees Celcius. ## Constants diff --git a/content/firmwareapi/pycom/expansionboards/SI7006A20.md b/content/firmwareapi/pycom/expansionboards/SI7006A20.md index 8af5e3ed..6bfd5f64 100644 --- a/content/firmwareapi/pycom/expansionboards/SI7006A20.md +++ b/content/firmwareapi/pycom/expansionboards/SI7006A20.md @@ -8,17 +8,17 @@ The Humidity and Temperature sensor provides values of relative humidity and ext ### class SI7006A20(pycoproc = None, sda = 'P22', scl = 'P21') -Creates a `SI7006A20` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. +Creates a SI7006A20 object. Constructor must be passed a Pycoproc or I2C object to successfully construct. ## Methods ### SI7006A20.humidity() -Read the relative humidity of the `SI7006A20`. Returns a float with the percentage relative humidity. +Read the relative humidity of the sensor. Returns a float with the percentage relative humidity. ### SI7006A20.temperature() -Read the external temperature of the `SI7006A20`. Returns a float with the temperature in degrees Celcius. +Read the external temperature of the sensor. Returns a float with the temperature in degrees Celcius. ### SI7006A20.dew_point() diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc.md b/content/firmwareapi/pycom/expansionboards/pycoproc.md index 8ed4afcf..8b18bd50 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc.md @@ -4,3 +4,24 @@ Title: "Pycoproc" The `pycoproc.py` file is a supporting python library for the Pysense, Pytrack and Pyscan expansionboards. +## Pytrack class to control supervisor MCU + +### Constructors + +#### class Pytrack(i2c=None, sda='P22', scl='P21') + +Initialise I2C communication with the supervisor MCU + +### Methods + +#### Pytrack.sd_power(enabled=True) + +This command allows switching the power supply for the SD card (VCC + PullUP resistors). + +#### Pytrack.sensor_power(enabled=True) + +This command allows switching the power supply for the GPS module and any sensors connected through the external 6-pin connector. + +#### Pytrack.gps_standby(enabled=True) + +This command allows switching the GPS module into stand-by mode. The GPS module is no longer accessible via I2C in this case. diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc2.md b/content/firmwareapi/pycom/expansionboards/pycoproc2.md index d84e921e..bc41a3a6 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc2.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc2.md @@ -2,5 +2,24 @@ Title: "Pycoproc2" --- - The `pycoproc2.py` file is a supporting python library for the Pysense 2 and Pytrack 2 expansionboards. + +### Constructors + +#### class Pytrack(i2c=None, sda='P22', scl='P21') + +Initialise I2C communication with the supervisor MCU + +### Methods + +#### Pytrack.sd_power(enabled=True) + +This command allows switching the power supply for the SD card (VCC + PullUP resistors). + +#### Pytrack.sensor_power(enabled=True) + +This command allows switching the power supply for the GPS module and any sensors connected through the external 6-pin connector. + +#### Pytrack.gps_standby(enabled=True) + +This command allows switching the GPS module into stand-by mode. The GPS module is no longer accessible via I2C in this case. From dba7764492afaa3d498df77d448e26a31fd69372 Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 22 Feb 2021 15:47:54 +0100 Subject: [PATCH 03/22] added to menu tree --- config.toml | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/config.toml b/config.toml index be224993..4b567e3b 100644 --- a/config.toml +++ b/config.toml @@ -744,47 +744,41 @@ theme = "doc-theme" weight = 50 [[menu.main]] - name = "Pygate" - url = "/firmwareapi/pycom/expansionboards/pygate/" - identifier = "firmwareapi@pycom@expansionboards@pygate" + name = "Pycoproc" + url = "/firmwareapi/pycom/expansionboards/pycoproc/" + identifier = "firmwareapi@pycom@expansionboards@pycoproc" parent = "firmwareapi@pycom@expansionboards" weight = 10 [[menu.main]] - name = "pysense" - url = "/firmwareapi/pycom/expansionboards/pysense/" - identifier = "firmwareapi@pycom@expansionboards@pysense" + name = "Pycoproc2" + url = "/firmwareapi/pycom/expansionboards/pycoproc2/" + identifier = "firmwareapi@pycom@expansionboards@pycoproc2" parent = "firmwareapi@pycom@expansionboards" weight = 20 [[menu.main]] - name = "pysense 2.0 x" - url = "/firmwareapi/pycom/expansionboards/pysense2/" + name = "Accelerometer" + url = "/firmwareapi/pycom/expansionboards/LIS2HH12/" identifier = "firmwareapi@pycom@expansionboards@pysense2" parent = "firmwareapi@pycom@expansionboards" weight = 30 [[menu.main]] - name = "pytrack" - url = "/firmwareapi/pycom/expansionboards/pytrack/" - identifier = "firmwareapi@pycom@expansionboards@pytrack" + name = "Light sensor" + url = "/firmwareapi/pycom/expansionboards/LTR329ALS01/" + identifier = "firmwareapi@pycom@expansionboards@LTR329ALS01" parent = "firmwareapi@pycom@expansionboards" weight = 40 [[menu.main]] - name = "pytrack 2.0 x" - url = "/firmwareapi/pycom/expansionboards/pytrack2/" - identifier = "firmwareapi@pycom@expansionboards@pytrack2" + name = "Temperature sensor" + url = "/firmwareapi/pycom/expansionboards/SI7006A20/" + identifier = "firmwareapi@pycom@expansionboards@SI7006A20" parent = "firmwareapi@pycom@expansionboards" weight = 50 [[menu.main]] - name = "pyscan" - url = "/firmwareapi/pycom/expansionboards/pyscan/" - identifier = "firmwareapi@pycom@expansionboards@pyscan" + name = "Pressure sensor" + url = "/firmwareapi/pycom/expansionboards/MPL3115A2/" + identifier = "firmwareapi@pycom@expansionboards@MPL3115A2" parent = "firmwareapi@pycom@expansionboards" weight = 60 -[[menu.main]] - name = "sleep" - url = "/firmwareapi/pycom/expansionboards/sleep/" - identifier = "firmwareapi@pycom@expansionboards@sleep" - parent = "firmwareapi@pycom@expansionboards" - weight = 70 From 0805463c1ea72c418be81f8e1c5dc03dedc978fc Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Fri, 26 Feb 2021 12:33:56 +0100 Subject: [PATCH 04/22] removed the pytrack / pysense layer --- .../pycom/expansionboards/pytrack.md | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 content/firmwareapi/pycom/expansionboards/pytrack.md diff --git a/content/firmwareapi/pycom/expansionboards/pytrack.md b/content/firmwareapi/pycom/expansionboards/pytrack.md deleted file mode 100644 index 1a1380bb..00000000 --- a/content/firmwareapi/pycom/expansionboards/pytrack.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: "Pytrack" -aliases: - - pytrackpysense/apireference/pytrack.html - - pytrackpysense/apireference/pytrack.md - - chapter/pytrackpysense/apireference/pytrack ---- - -This chapter describes the various libraries which are designed for the Pytrack board. This includes details about the various methods and classes available for each of the Pytrack's sensors. - ->Note: follow the guide [here](/firmwareapi/pycom/expansionboards/) to be able to use the functions below - -## 3-Axis Accelerometer (LIS2HH12) - -Pytrack has a 3-Axis Accelerometer that provides outputs for acceleration as well as roll, pitch and yaw. - -### Constructors - -#### class LIS2HH12(pytrack = None, sda = 'P22', scl = 'P21') - -Creates a `LIS2HH12` object, that will return values for acceleration, roll, pitch and yaw. Constructor must be passed a Pytrack or I2C object to successfully construct. - -### Methods - -#### LIS2HH12.acceleration() - -Read the acceleration from the `LIS2HH12`. Returns a **tuple** with the 3 values of acceleration (G). - -#### LIS2HH12.roll() - -Read the current roll from the `LIS2HH12`. Returns a **float** in degrees in the range -180 to 180. - -#### LIS2HH12.pitch() - -Read the current pitch from the `LIS2HH12`. Returns a **float** in degrees in the range -90 to 90. Once the board tilts beyond this range the values will repeat. This is due to a lack of yaw measurement, making it not possible to know the exact orientation of the board. - -## GPS with GLONASS (Quectel L76-L GNSS) - -Pytrack has a GPS (with GLONASS) that provides outputs longitude/latitude, speed and other information about the Pytrack's location. - -### Constructors - -#### class L76GNSS(pytrack = None, sda = 'P22', scl = 'P21', timeout = None) - -Creates a `L76GNSS` object, that will return values for longitude and latitude. Constructor must be passed a Pytrack or I2C object to successfully construct. Set the `timeout` to a time period (in seconds) for the GPS to search for a lock. If a lock is not found by the time the `timeout` has expired, the `coordinates` method will return `(None, None)`. - -### Methods - -#### L76GNSS.coordinates(debug = False) - -Read the longitude and latitude from the `L76GNSS`. Returns a **tuple** with the longitude and latitude. With `debug` set to `True` the output from the GPS is verbose. - -{{% hint style="info" %}} -Please note that more functionality is being added weekly to these libraries. If a required feature is not available, feel free to contribute with a pull request at the [Libraries GitHub repository](https://github.com/pycom/pycom-libraries) -{{% /hint %}} - From a80551d0be9325ab6f2c42dadbff487feee93f95 Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Fri, 26 Feb 2021 12:34:26 +0100 Subject: [PATCH 05/22] Completed the Pycoproc API --- .../pycom/expansionboards/pycoproc.md | 77 ++++++++++++++--- .../pycom/expansionboards/pycoproc2.md | 86 ++++++++++++++++--- 2 files changed, 140 insertions(+), 23 deletions(-) diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc.md b/content/firmwareapi/pycom/expansionboards/pycoproc.md index 8b18bd50..1405d9ac 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc.md @@ -2,26 +2,79 @@ Title: "Pycoproc" --- -The `pycoproc.py` file is a supporting python library for the Pysense, Pytrack and Pyscan expansionboards. +The `pycoproc.py` file is a supporting python library for the first version of Pysense Pytrack and Pyscan expansionboards. For version 2.0 X, see [pycoproc2](../pycoproc2/) -## Pytrack class to control supervisor MCU +## Constructors -### Constructors +### class Pycoproc(i2c=None, sda='P22', scl='P21') -#### class Pytrack(i2c=None, sda='P22', scl='P21') +Initialise I2C communication with the supervisor MCU, if no i2c object is passed, the `sda` and `scl` pins are used. On the board, the sensors are connected on these pins. -Initialise I2C communication with the supervisor MCU +## General methods -### Methods +### py.read_fw_version() -#### Pytrack.sd_power(enabled=True) +Read the PIC firmware version. Check the [update firmware](/updatefirmware/expansionboard/) if an update is available. -This command allows switching the power supply for the SD card (VCC + PullUP resistors). +### py.read_hw_version() -#### Pytrack.sensor_power(enabled=True) +Read the hardware version. -This command allows switching the power supply for the GPS module and any sensors connected through the external 6-pin connector. +### py.read_product_id() -#### Pytrack.gps_standby(enabled=True) +Read the product ID -This command allows switching the GPS module into stand-by mode. The GPS module is no longer accessible via I2C in this case. +### py.button_pressed() + +Returns if the on-board `MCLR` button is pressed. + +### py.read_battery_voltage() + +Returns the battery voltage + +### py.reset_cmd() + +Power cycles the development module. + +## Power methods + +### py.sd_power([enabled=True]) + +This command allows switching the power supply for the SD card: +* `True`: the SD card is enabled +* `False`: the SD card is disabled + +### py.sensor_power([enabled=True]) + +This command allows switching the power supply for the GPS module and any sensors connected through the external Pyport: +* `True`: the power is enabled +* `False`: the power is disabled + +### py.gps_standby([enabled=True]) + +This command allows switching the GPS module into stand-by mode. The GPS module is no longer accessible via I2C in this case: +* `True`: the GPS is put in standby mode +* `False`: the GPS is activated. + +### py.setup_sleep(seconds) + +Sets the sleep time in seconds for `py.go_to_sleep(...)`. This method will momentarily release the USB connection, meaning you will have to reconnect the USB in Pymakr after using this method. + +### py.setup_int_wake_up(rising, falling) + +Enables the accelerometer INT pin (PIC - RA5) as a wakeup source, if the [accelerometer interrupt](../lis2hh12/#lis2hh12enable_activity_interruptthreshold-duration-handlernone) is configured. The boolean parameters will indicate rising edge (activity detection) and/or falling edge (inactivity detection) is configured. + +### py.setup_int_pin_wake_up([rising=True]) + +Allow waking up from an interrupt on PIC RC1, or `EXT_IO_0` on the external IO header + +### py.go_to_sleep([gps=True]) + +Puts the board in sleep mode. This sleep mode consumes less power than the `machine.deepsleep()` available from the firmware, as it turns the power to the inserted development module off.This will also disable the power to the sensors, sd card and Pyport, except for the accelerometer. Arguments are: +* `gps`: Keep the GPS (if available) in standby mode while sleeping. This reduces the power consumption, but might extend the time to location fix after wakeup. + +### py.get_sleep_remaining() + +In the event of a sleep session that was awoken by an asynchronous event (Accelerometer, INT pin or Reset button) the approximate sleep remaining interval (expressed in **seconds**) can be found out. The user has to manually use `setup_sleep()` to configure the next sleep interval. + +## Example diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc2.md b/content/firmwareapi/pycom/expansionboards/pycoproc2.md index bc41a3a6..f47eca95 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc2.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc2.md @@ -2,24 +2,88 @@ Title: "Pycoproc2" --- -The `pycoproc2.py` file is a supporting python library for the Pysense 2 and Pytrack 2 expansionboards. +The `pycoproc2.py` file is a supporting python library for the Pysense 2 and Pytrack 2 expansionboards. -### Constructors +## Constructors -#### class Pytrack(i2c=None, sda='P22', scl='P21') +### class Pycoproc(i2c=None, sda='P22', scl='P21') -Initialise I2C communication with the supervisor MCU +Initialise I2C communication with the supervisor MCU, if no i2c object is passed, the `sda` and `scl` pins are used. On a Pysense 2 / Pytrack 2 board, the sensors are connected on these pins. -### Methods +## General methods -#### Pytrack.sd_power(enabled=True) +### py.read_fw_version() -This command allows switching the power supply for the SD card (VCC + PullUP resistors). +Read the PIC firmware version. Check the [update firmware](/updatefirmware/expansionboard/) if an update is available. -#### Pytrack.sensor_power(enabled=True) +### py.read_hw_version() -This command allows switching the power supply for the GPS module and any sensors connected through the external 6-pin connector. +Read the hardware version. -#### Pytrack.gps_standby(enabled=True) +### py.read_product_id() -This command allows switching the GPS module into stand-by mode. The GPS module is no longer accessible via I2C in this case. +Read the product ID + +### py.button_pressed() + +Returns if the on-board `MCLR` button is pressed. + +### py.read_battery_voltage() + +Returns the battery voltage + +### py.reset_cmd() + +Power cycles the development module. + +## Power methods + +### py.sd_power([enabled=True]) + +This command allows switching the power supply for the SD card: +* `True`: the SD card is enabled +* `False`: the SD card is disabled + +### py.sensor_power([enabled=True]) + +This command allows switching the power supply for the GPS module and any sensors connected through the external Pyport: +* `True`: the power is enabled +* `False`: the power is disabled + +### py.gps_standby([enabled=True]) + +This command allows switching the GPS module into stand-by mode. The GPS module is no longer accessible via I2C in this case: +* `True`: the GPS is put in standby mode +* `False`: the GPS is activated. + +### py.setup_sleep(seconds) + +Sets the sleep time in seconds for `py.go_to_sleep(...)`. This method will momentarily release the USB connection, meaning you will have to reconnect the USB in Pymakr after using this method. + +### py.go_to_sleep([gps=True, pycom_module_off=True, accelerometer_off=True, wake_interrupt=False]) + +Puts the board in sleep mode. This sleep mode consumes less power than the `machine.deepsleep()` available from the firmware, as it turns the power to the inserted development module off.This will also disable the power to the sensors, sd card and Pyport, except for the accelerometer. Arguments are: +* `gps`: Keep the GPS (if available) in standby mode while sleeping. This reduces the power consumption, but might extend the time to location fix after wakeup. +* `pycom_module_off`: Turn off the power to the inserted development module. This dramatically reduces the power consumption, but will not allow for wake on accelerometer interrupt. See the example below on how to achieve that. +* `accelerometer_off`: Turn off the power to the accelerometer. +* `wake_interrupt`: Allow waking up from an interrupt on PIC RC1, or `EXT_IO_0` on the external IO header. + +## Example + +Use the following example to wake up from an accelerometer interrupt: + +```python +import machine +import time +from pycoproc import Pycoproc + +py = Pycoproc() +print("enable pycom module to wake up from accelerometer interrupt") +wake_pins = [Pin('P13', mode=Pin.IN, pull=Pin.PULL_DOWN)] +machine.pin_sleep_wakeup(wake_pins, machine.WAKEUP_ANY_HIGH, True) + +print("put pycoproc to sleep and pycom module to deepsleep") +py.setup_sleep(sleep_time_s) +py.go_to_sleep(pycom_module_off=False, accelerometer_off=False, wake_interrupt=True) +machine.deepsleep(sleep_time_s * 1000) +``` \ No newline at end of file From 9bd5377f8ffdde08772693f9cee597c480ab3ceb Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Fri, 26 Feb 2021 12:37:31 +0100 Subject: [PATCH 06/22] fixed naming --- content/firmwareapi/pycom/expansionboards/pycoproc.md | 10 ++++------ content/firmwareapi/pycom/expansionboards/pycoproc2.md | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc.md b/content/firmwareapi/pycom/expansionboards/pycoproc.md index 1405d9ac..ceb10f03 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc.md @@ -10,7 +10,7 @@ The `pycoproc.py` file is a supporting python library for the first version of P Initialise I2C communication with the supervisor MCU, if no i2c object is passed, the `sda` and `scl` pins are used. On the board, the sensors are connected on these pins. -## General methods +## General functions ### py.read_fw_version() @@ -26,7 +26,7 @@ Read the product ID ### py.button_pressed() -Returns if the on-board `MCLR` button is pressed. +Returns `True` if the on-board `MCLR` button is pressed. ### py.read_battery_voltage() @@ -36,7 +36,7 @@ Returns the battery voltage Power cycles the development module. -## Power methods +## Power functions ### py.sd_power([enabled=True]) @@ -75,6 +75,4 @@ Puts the board in sleep mode. This sleep mode consumes less power than the `mach ### py.get_sleep_remaining() -In the event of a sleep session that was awoken by an asynchronous event (Accelerometer, INT pin or Reset button) the approximate sleep remaining interval (expressed in **seconds**) can be found out. The user has to manually use `setup_sleep()` to configure the next sleep interval. - -## Example +In the event of a sleep session that was awoken by an asynchronous event (Accelerometer, INT pin or Reset button) the approximate sleep remaining interval (expressed in **seconds**) can be found out. The user has to manually use `setup_sleep()` to configure the next sleep interval. \ No newline at end of file diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc2.md b/content/firmwareapi/pycom/expansionboards/pycoproc2.md index f47eca95..307477d3 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc2.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc2.md @@ -10,7 +10,7 @@ The `pycoproc2.py` file is a supporting python library for the Pysense 2 and Pyt Initialise I2C communication with the supervisor MCU, if no i2c object is passed, the `sda` and `scl` pins are used. On a Pysense 2 / Pytrack 2 board, the sensors are connected on these pins. -## General methods +## General functions ### py.read_fw_version() @@ -26,7 +26,7 @@ Read the product ID ### py.button_pressed() -Returns if the on-board `MCLR` button is pressed. +Returns `True` if the on-board `MCLR` button is pressed. ### py.read_battery_voltage() @@ -36,7 +36,7 @@ Returns the battery voltage Power cycles the development module. -## Power methods +## Power functions ### py.sd_power([enabled=True]) From 8662306b23f237e6a580048a1e1ba05fb47c3ecc Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Fri, 26 Feb 2021 15:43:54 +0100 Subject: [PATCH 07/22] updated landing page --- config.toml | 14 ++++++- .../pycom/expansionboards/_index.md | 39 +++++++------------ .../pycom/expansionboards/pycoproc.md | 30 +++----------- 3 files changed, 33 insertions(+), 50 deletions(-) diff --git a/config.toml b/config.toml index 4b567e3b..22796125 100644 --- a/config.toml +++ b/config.toml @@ -737,7 +737,7 @@ theme = "doc-theme" weight = 40 [[menu.main]] - name = "Expansion boards" + name = "Pyshields" url = "/firmwareapi/pycom/expansionboards/" identifier = "firmwareapi@pycom@expansionboards" parent = "firmwareapi@pycom" @@ -779,6 +779,18 @@ theme = "doc-theme" identifier = "firmwareapi@pycom@expansionboards@MPL3115A2" parent = "firmwareapi@pycom@expansionboards" weight = 60 + [[menu.main]] + name = "RFID / NFC" + url = "/firmwareapi/pycom/expansionboards/MFRC630/" + identifier = "firmwareapi@pycom@expansionboards@MFRC630" + parent = "firmwareapi@pycom@expansionboards" + weight = 70 +[[menu.main]] + name = "GPS" + url = "/firmwareapi/pycom/expansionboards/L76GNSS/" + identifier = "firmwareapi@pycom@expansionboards@L76GNSS" + parent = "firmwareapi@pycom@expansionboards" + weight = 80 diff --git a/content/firmwareapi/pycom/expansionboards/_index.md b/content/firmwareapi/pycom/expansionboards/_index.md index e30944e1..1d3cb67d 100644 --- a/content/firmwareapi/pycom/expansionboards/_index.md +++ b/content/firmwareapi/pycom/expansionboards/_index.md @@ -1,43 +1,32 @@ --- -title: "Product info & Datasheets" -aliases: - - firmwareapi/introduction.html - - firmwareapi/introduction.md - - product-info - - chapter/firmwareapi +title: "PyShields" --- -As the development for these devices are on going with additional features being added, every week, it is essential to ensure you frequently check for updates on the Pytrack/Pysense/Pyscan. As well as updating the device firmware, it is important to check the [GitHub repository](https://github.com/pycom/pycom-libraries) for the respective library files as they as also being updated, to include additional features/functionality. -> Please note that updated libraries are available for the Pytrack 2.0 X and Pysense 2.0 X in the pytrack-2 and pysense-2 directories on GitHub. -These new libraries will allow you to use the new additional features. +The following shields offer additional functionality through sensors and other peripherals: +* Pysense +* Pysense 2.0 X +* Pytrack +* Pytrack 2.0 X +* Pyscan -## Uploading the Libraries to a Device - -These libraries should be uploaded to a device in the same process as a standard MicroPython library. The various `.py` files should be placed into the `/lib` folder on the device. - -Add as many or as few of the libraries that are required. +These libraries are available from the [GitHub releases](https://github.com/pycom/pycom-libraries/releases) and not built directly into the firmware. You can use the Libraries with the first and second version of the Pysense, Pytrack and Pyscan. You can also download individual libraries from our [Github repository](https://github.com/pycom/pycom-libraries/). -In addition to the Pysense or Pytrack specific libraries, for hardware version 1.x boards you also need to upload the `pycoproc.py` file from the `lib/pycoproc` folder inside the libraries archive. For the Pytrack 2.0 X and Pysense 2.0 X, the pycoproc.py file is included in the pytrack-2 and pysense-2 directories to avoid confusion over which library to use. +The API pages are separated per sensor. On the first hardware version of the pyshields, the `pycoproc` is used. For the second version, we use `pycoproc2`. -For example, if using the Pysense and the user wishes to enable the only Accelerometer and the Light Sensor, they should place the following `.py` files into the device's `/lib` folder: +## Uploading the Libraries to a Device -```text -- pysense.py -- pycoproc.py -- LIS2HH12.py -- LTR329ALS01.py -``` +Place the applicable Python files for your shield into the `/lib` folder of your project. Do not forget to press `upload project to device` in Pymakr to make sure you are able to use them. -## Importing/Using the Libraries +## Importing and using the libraries Once the libraries are uploaded to the device, they can be used/imported as a typical MicroPython library would be. For example, importing and using the light sensor on the Pysense: ```python -from pysense import Pysense +from pycoproc import Pycoproc from LTR329ALS01 import LTR329ALS01 -py = Pysense() +py = Pycoproc() lt = LTR329ALS01(py) print(lt.light()) diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc.md b/content/firmwareapi/pycom/expansionboards/pycoproc.md index ceb10f03..1233a3b9 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc.md @@ -6,9 +6,13 @@ The `pycoproc.py` file is a supporting python library for the first version of P ## Constructors -### class Pycoproc(i2c=None, sda='P22', scl='P21') +### class Pycoproc(board_type, [i2c=None, sda='P22', scl='P21']) + +Initialise I2C communication with the supervisor MCU, if no i2c object is passed, the `sda` and `scl` pins are used. On the shield, the sensors are connected on these pins. Board type can be: +* `Pycoproc.PYSENSE` +* `Pycoproc.PYTRACK` +* `Pycoproc.PYSCAN` -Initialise I2C communication with the supervisor MCU, if no i2c object is passed, the `sda` and `scl` pins are used. On the board, the sensors are connected on these pins. ## General functions @@ -32,30 +36,8 @@ Returns `True` if the on-board `MCLR` button is pressed. Returns the battery voltage -### py.reset_cmd() - -Power cycles the development module. - ## Power functions -### py.sd_power([enabled=True]) - -This command allows switching the power supply for the SD card: -* `True`: the SD card is enabled -* `False`: the SD card is disabled - -### py.sensor_power([enabled=True]) - -This command allows switching the power supply for the GPS module and any sensors connected through the external Pyport: -* `True`: the power is enabled -* `False`: the power is disabled - -### py.gps_standby([enabled=True]) - -This command allows switching the GPS module into stand-by mode. The GPS module is no longer accessible via I2C in this case: -* `True`: the GPS is put in standby mode -* `False`: the GPS is activated. - ### py.setup_sleep(seconds) Sets the sleep time in seconds for `py.go_to_sleep(...)`. This method will momentarily release the USB connection, meaning you will have to reconnect the USB in Pymakr after using this method. From 3b39387695b839fb48f7d442be9f7648cd7b328d Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 1 Mar 2021 12:15:08 +0100 Subject: [PATCH 08/22] renamed to shields --- config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.toml b/config.toml index 22796125..4d320496 100644 --- a/config.toml +++ b/config.toml @@ -737,7 +737,7 @@ theme = "doc-theme" weight = 40 [[menu.main]] - name = "Pyshields" + name = "Shields" url = "/firmwareapi/pycom/expansionboards/" identifier = "firmwareapi@pycom@expansionboards" parent = "firmwareapi@pycom" From c27bbfea2422a2f426ad74e0f46e384b19cf613a Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 1 Mar 2021 12:15:15 +0100 Subject: [PATCH 09/22] added v16 warning --- content/firmwareapi/pycom/expansionboards/pycoproc2.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc2.md b/content/firmwareapi/pycom/expansionboards/pycoproc2.md index 307477d3..185a32bc 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc2.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc2.md @@ -4,6 +4,14 @@ Title: "Pycoproc2" The `pycoproc2.py` file is a supporting python library for the Pysense 2 and Pytrack 2 expansionboards. +> The latest version of `pycoproc2.py` only works with a v16 or later expansionboard-firmware on the Pytrack 2 / Pysense 2. Check whether you have the correct firmware installed by using the following: +> ```python +> from pycoproc import Pycoproc +> py = Pycoproc() +> print(py.read_fw_version()) +> ``` +> If this returns 15 or lower, please update the [expansionboard firmware](/updatefirmware/expansionboard/) + ## Constructors ### class Pycoproc(i2c=None, sda='P22', scl='P21') From 62f804b70ce96cfe921cd95bae385866177af14c Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 22 Feb 2021 15:12:06 +0100 Subject: [PATCH 10/22] restructuring Pycoproc documentation --- .../pycom/expansionboards/L76GNSS.md | 25 +++ .../pycom/expansionboards/LIS2HH12.md | 35 ++++ .../pycom/expansionboards/LTR329ALS01.md | 30 ++++ .../pycom/expansionboards/MFRC630.md | 94 +++++++++++ .../pycom/expansionboards/MPL3115A2.md | 29 ++++ .../pycom/expansionboards/SI7006A20.md | 25 +++ .../pycom/expansionboards/_index.md | 10 +- .../pycom/expansionboards/pycoproc.md | 6 + .../pycom/expansionboards/pycoproc2.md | 6 + .../pycom/expansionboards/pyscan.md | 152 ------------------ .../pycom/expansionboards/pysense.md | 114 ------------- .../pycom/expansionboards/pysense2.md | 130 --------------- 12 files changed, 252 insertions(+), 404 deletions(-) create mode 100644 content/firmwareapi/pycom/expansionboards/L76GNSS.md create mode 100644 content/firmwareapi/pycom/expansionboards/LIS2HH12.md create mode 100644 content/firmwareapi/pycom/expansionboards/LTR329ALS01.md create mode 100644 content/firmwareapi/pycom/expansionboards/MFRC630.md create mode 100644 content/firmwareapi/pycom/expansionboards/MPL3115A2.md create mode 100644 content/firmwareapi/pycom/expansionboards/SI7006A20.md create mode 100644 content/firmwareapi/pycom/expansionboards/pycoproc.md create mode 100644 content/firmwareapi/pycom/expansionboards/pycoproc2.md delete mode 100644 content/firmwareapi/pycom/expansionboards/pyscan.md delete mode 100644 content/firmwareapi/pycom/expansionboards/pysense.md delete mode 100644 content/firmwareapi/pycom/expansionboards/pysense2.md diff --git a/content/firmwareapi/pycom/expansionboards/L76GNSS.md b/content/firmwareapi/pycom/expansionboards/L76GNSS.md new file mode 100644 index 00000000..1318ad12 --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/L76GNSS.md @@ -0,0 +1,25 @@ +--- +Title: "GPS" +--- + +The L76GNSS is the GPS module that can provide location data to your application. + +## Constructors + +### class L76GNSS(pytrack = None, sda = 'P22', scl = 'P21', timeout = None) + +Creates a `L76GNSS` object. Constructor must be passed a Pytrack or I2C object to successfully construct. Set the `timeout` to a time period (in seconds) for the GPS to search for a lock. If a lock is not found by the time the `timeout` has expired, the `coordinates` method will return `(None, None)`. + +## Methods + +### L76GNSS.coordinates(debug = False) + +Read the longitude and latitude from the `L76GNSS`. Returns a tuple with `(longitude, latitude)`. With `debug` set to `True` the output from the GPS is verbose. + +### L76GNSS.dump_nmea() + +Continuously print nmea sentences received from the `L76GNSS` to the REPL. This is useful if you want to use a graphical tool over UART to visualise GPS reception + +### L76GNSS.write() + +Send commands to the `L76GNSS`. See the datasheet of the L76 for more information. Be aware that some commands might break the communication interface. diff --git a/content/firmwareapi/pycom/expansionboards/LIS2HH12.md b/content/firmwareapi/pycom/expansionboards/LIS2HH12.md new file mode 100644 index 00000000..48074f9b --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/LIS2HH12.md @@ -0,0 +1,35 @@ +--- +Title: "Accelerometer" +--- + +The LIS2HH12 is a 3-Axis Accelerometer provides outputs for acceleration as well as roll, pitch and yaw. + +## Constructors + +### class LIS2HH12(pycoproc = None, sda = 'P22', scl = 'P21') + +Creates a `LIS2HH12` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. + +## Methods + +### LIS2HH12.acceleration() + +Read the acceleration from the `LIS2HH12`. Returns a tuple with the 3 values of acceleration in g-force: `(x, y, z)`. + +### LIS2HH12.roll() + +Read the current roll from the `LIS2HH12`. Returns a float in degrees in the range -180 to 180. + +### LIS2HH12.pitch() + +Read the current pitch from the `LIS2HH12`. Returns a float in degrees in the range -90 to 90. Once the board tilts beyond this range the values will repeat. This is due to a lack of yaw measurement, making it not possible to know the exact orientation of the board. + +### LIS2HH12.enable_activity_interrupt(threshold, duration, handler=None) + +Set an activity- and inactivity interrupt for the accelerometer. This takes the arguments: +* `threshold`: the activity threshold in `mg`, between 62 - 4000 +* `duration`: the duration in `ms`, between 160 - 40800 +* `handler`: The interrupt handler. When not given, it will print `Activity interrupt` and `Inactivity interrupt` +The function returns a tuple containing the set values: `(threshold, duration)`. These depend on the resolution. + + diff --git a/content/firmwareapi/pycom/expansionboards/LTR329ALS01.md b/content/firmwareapi/pycom/expansionboards/LTR329ALS01.md new file mode 100644 index 00000000..4f495137 --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/LTR329ALS01.md @@ -0,0 +1,30 @@ +--- +Title: "Ambient Light sensor" +--- + +The LTR329ALS01 is a dual light sensor that provides outputs for external light levels in lux. See the datasheet for more information about the wavelengths of the two sensors. + +### Constructors + +### class LTR329ALS01(pycoproc = None, sda = 'P22', scl = 'P21', gain = LTR329ALS01.ALS_GAIN_1X, integration = LTR329ALS01.ALS_INT_100, rate = LTR329ALS01.ALS_RATE_500) + +Creates a `LTR329ALS01` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. The arguments are: +* `pycoproc`: A pycoproc opbject +* `sda / scl`: If pycoproc is not passed, enter the I2C pins here +* `gain`: The light sensor ADC gain. see the Constants for values +* `integration`: Controls the integration time of the periodic measurement. See the Constants for values +* `rate`: The used sample rate in ms, must be set larger than the integration period. See the Constants for values + +## Methods + +### LTR329ALS01.light() + +Read the light levels of both `LTR329ALS01` sensors. Returns a tuple with two values for light levels in lux: `(blue, red)`, between 0-65535. + +## Constants + +The following arguments may be passed into the constructor. + +* gain: `ALS_GAIN_1X`,`ALS_GAIN_2X`, `ALS_GAIN_4X`, `ALS_GAIN_8X`, `ALS_GAIN_48X`, `ALS_GAIN_96X` +* integration: `ALS_INT_50`, `ALS_INT_100`, `ALS_INT_150`, `ALS_INT_200`, `ALS_INT_250`, `ALS_INT_300`, `ALS_INT_350`, `ALS_INT_400` +* rate: `ALS_RATE_50`, `ALS_RATE_100`, `ALS_RATE_200`, `ALS_RATE_500`, `ALS_RATE_1000`, `ALS_RATE_2000` \ No newline at end of file diff --git a/content/firmwareapi/pycom/expansionboards/MFRC630.md b/content/firmwareapi/pycom/expansionboards/MFRC630.md new file mode 100644 index 00000000..7d2c3ab2 --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/MFRC630.md @@ -0,0 +1,94 @@ +--- +Title: "NFC and RFID reader" +--- + +The MFRC630 is a NFC and RFID card reader. + +## Constructors + +### class MFRC630(pycoproc=None, sda='P22', scl='P21', timeout=None, debug=False) + +Creates a `MFRC630` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. + +## Methods + +### MFRC630.mfrc630_cmd_init() + +Initialises the `MFRC630`. + +### MFRC630.mfrc630_cmd_reset() + +Reset the device. Stops the currently active command and resets device. + +### MFRC630.mfrc630_cmd_idle() + +Set the device into idle mode. Stops the currently active command and return to idle mode. + +### MFRC630.mfrc630_cmd_load_key(key) + +Loads the provided key into the key buffer. + +* `key` Array which holds the MIFARE key, **it is always 6 bytes long** + +#### MFRC630.mfrc630_MF_read_block(block_address, dest) + +Reads a block of memory from an authenticated card. Try to read a block of memory from the card with the appropriate timeouts and error checking. + +* `block_address` The block to read +* `dest` The array in which to write the 16 bytes read from the card + +Returns `0` for failure, otherwise the number of bytes received. + +#### MFRC630.mfrc630_MF_auth(uid, key_type, block) + +Perform a MIFARE authentication procedure. This function is a higher-level wrapper around the MF authenticate command. The result of the authentication is checked to identify whether it appears to have succeeded. The key must be loaded into the key buffer with `MFRC630.mfrc630_cmd_load_key(key)`. + +Once authenticated, the authentication MUST be stopped manually by calling the `mfrc630_MF_deauth()` function or otherwise disabling the `Crypto1 ON` bit in the status register. + +* `key_type`: The MIFARE key A or B (`MFRC630_MF_AUTH_KEY_A` or `MFRC630_MF_AUTH_KEY_B`) to use +* `block`: The block to authenticate +* `uid`: The authentication procedure required the first four bytes of the card's UID to authenticate + +Returns `0` in case of failure, nonzero in case of success. + +#### MFRC630.mfrc630_MF_deauth() + +Disables MIFARE authentication. Disable the `Crypto1` bit from the status register to disable encryption. + +#### MFRC630.mfrc630_iso14443a_WUPA_REQA(instruction) + +Send `WUPA` and `REQA`. Returns the response byte, the answer to request `A` byte (`ATQA`), or `0` in case of no answer. + +* instruction: `MFRC630_ISO14443_CMD_WUPA`, `MFRC630_ISO14443_CMD_REQA` + +#### MFRC630.mfrc630_iso14443a_select(uid) + +Performs the `SELECT` procedure to discover a card's UID. This performs the `SELECT` procedure as explained in _ISO14443A_, this determines the UID of the card, if multiple cards are present, a collision will occur, which is handled according to the norm. + +* `uid`: The UID of the card will be stored into this array. + +Returns the length of the UID in bytes (`4, 7, 10`), or `0` in case of failure. + +#### MFRC630.print_debug(msg) + +Prints debug statements if `DEBUG` is enabled. + +#### MFRC630.format_block(block, length) + +Prints `block` with `length`. + +#### MFRC630.mfrc630_format_block(data, len) + +Converts `data` to hexadecimal format. + +* `data` The array to be formatted +* `len` The number of bytes to format + +#### MFRC630.mfrc630_print_block(data, len) + +Prints the bytes in `data` array in hexadecimal format, separated by spaces using the `mfrc630_format_block` method. + +* `data` The array to be printed +* `len` The number of bytes to print + +## Constants diff --git a/content/firmwareapi/pycom/expansionboards/MPL3115A2.md b/content/firmwareapi/pycom/expansionboards/MPL3115A2.md new file mode 100644 index 00000000..ebede81b --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/MPL3115A2.md @@ -0,0 +1,29 @@ +--- +Title: "Pressure and Altitude sensor" +--- + +## Constructors + +### class MPL3115A2(pycoproc = None, sda = 'P22', scl = 'P21', mode = MPL3115A2.PRESSURE) + +Creates a `MPL3115A2` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. + +## Methods + +### MPL3115A2.pressure() + +Read the atmospheric pressure of the `MPL3115A2`. Returns a float with the pressure in Pascal. + +### MPL3115A2.altitude() + +Read the altitude of the `MPL3115A2`. Returns a float with the altitude in meter. + +### MPL3115A2.temperature() + +Read the temperature of the `MPL3115A2`. Returns a float with the temperature in degrees Celcius. + +## Constants + +The following constants may be passed into the constructor. + +* mode: `PRESSURE`, `ALTITUDE` \ No newline at end of file diff --git a/content/firmwareapi/pycom/expansionboards/SI7006A20.md b/content/firmwareapi/pycom/expansionboards/SI7006A20.md new file mode 100644 index 00000000..8af5e3ed --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/SI7006A20.md @@ -0,0 +1,25 @@ +--- +Title: "Humidity and Temperature Sensor" +--- + +The Humidity and Temperature sensor provides values of relative humidity and external temperature. + +## Constructors + +### class SI7006A20(pycoproc = None, sda = 'P22', scl = 'P21') + +Creates a `SI7006A20` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. + +## Methods + +### SI7006A20.humidity() + +Read the relative humidity of the `SI7006A20`. Returns a float with the percentage relative humidity. + +### SI7006A20.temperature() + +Read the external temperature of the `SI7006A20`. Returns a float with the temperature in degrees Celcius. + +### SI7006A20.dew_point() + +Calculates the dew point temperature for the current temperature and humidity measurement. \ No newline at end of file diff --git a/content/firmwareapi/pycom/expansionboards/_index.md b/content/firmwareapi/pycom/expansionboards/_index.md index 8829d29f..e30944e1 100644 --- a/content/firmwareapi/pycom/expansionboards/_index.md +++ b/content/firmwareapi/pycom/expansionboards/_index.md @@ -8,14 +8,12 @@ aliases: --- As the development for these devices are on going with additional features being added, every week, it is essential to ensure you frequently check for updates on the Pytrack/Pysense/Pyscan. As well as updating the device firmware, it is important to check the [GitHub repository](https://github.com/pycom/pycom-libraries) for the respective library files as they as also being updated, to include additional features/functionality. -{{% hint style="info" %}} -Please note that updated libraries are available for the Pytrack 2.0 X and Pysense 2.0 X in the pytrack-2 and pysense-2 directories on GitHub. +> Please note that updated libraries are available for the Pytrack 2.0 X and Pysense 2.0 X in the pytrack-2 and pysense-2 directories on GitHub. These new libraries will allow you to use the new additional features. -{{% /hint %}} ## Uploading the Libraries to a Device -These libraries should be uploaded to a device (LoPy, SiPy, WiPy 3.0, etc.) in the same process as a standard MicroPython library. The various `.py` files should be placed into the `/lib` folder on the device. +These libraries should be uploaded to a device in the same process as a standard MicroPython library. The various `.py` files should be placed into the `/lib` folder on the device. Add as many or as few of the libraries that are required. @@ -30,10 +28,6 @@ For example, if using the Pysense and the user wishes to enable the only Acceler - LTR329ALS01.py ``` -{{% hint style="info" %}} -The Pytrack and Pysense boards behave the same as the Expansion Board. `Upload`, `Run` and upload code to Pycom modules via the Pymakr Plugin, in exactly the same process. -{{% /hint %}} - ## Importing/Using the Libraries Once the libraries are uploaded to the device, they can be used/imported as a typical MicroPython library would be. For example, importing and using the light sensor on the Pysense: diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc.md b/content/firmwareapi/pycom/expansionboards/pycoproc.md new file mode 100644 index 00000000..8ed4afcf --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/pycoproc.md @@ -0,0 +1,6 @@ +--- +Title: "Pycoproc" +--- + +The `pycoproc.py` file is a supporting python library for the Pysense, Pytrack and Pyscan expansionboards. + diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc2.md b/content/firmwareapi/pycom/expansionboards/pycoproc2.md new file mode 100644 index 00000000..d84e921e --- /dev/null +++ b/content/firmwareapi/pycom/expansionboards/pycoproc2.md @@ -0,0 +1,6 @@ +--- +Title: "Pycoproc2" +--- + + +The `pycoproc2.py` file is a supporting python library for the Pysense 2 and Pytrack 2 expansionboards. diff --git a/content/firmwareapi/pycom/expansionboards/pyscan.md b/content/firmwareapi/pycom/expansionboards/pyscan.md deleted file mode 100644 index 95268327..00000000 --- a/content/firmwareapi/pycom/expansionboards/pyscan.md +++ /dev/null @@ -1,152 +0,0 @@ ---- -title: "Pyscan" -aliases: - - pytrackpysense/apireference/pyscan.html - - pytrackpysense/apireference/pyscan.md - - chapter/pytrackpysense/apireference/pyscan ---- - -This chapter describes the various libraries which are designed for the Pyscan board. This includes details about the various methods and classes available for each of the Pyscan's sensors. - ->Note: follow the guide [here](/firmwareapi/pycom/expansionboards/) to be able to use the functions below - -## 3-Axis Accelerometer (LIS2HH12) - -Pysense has a 3-Axis Accelerometer that provides outputs for acceleration as well as roll, pitch and yaw. - -### Constructors - -#### class LIS2HH12(pysense = None, sda = 'P22', scl = 'P21') - -Creates a `LIS2HH12` object, that will return values for acceleration, roll, pitch and yaw. Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### LIS2HH12.acceleration() - -Read the acceleration from the `LIS2HH12`. Returns a **tuple** with the 3 values of acceleration (G). - -#### LIS2HH12.roll() - -Read the current roll from the `LIS2HH12`. Returns a **float** in degrees in the range -180 to 180. - -#### LIS2HH12.pitch() - -Read the current pitch from the `LIS2HH12`. Returns a **float** in degrees in the range -90 to 90. Once the board tilts beyond this range the values will repeat. This is due to a lack of yaw measurement, making it not possible to know the exact orientation of the board. - -## Digital Ambient Light Sensor (LTR-329ALS-01) - -Pysense has a dual light sensor that provides outputs for external light levels in lux. See the datasheet for more information about the wavelengths of the two sensors. - -### Constructors - -#### class LTR329ALS01(pysense = None, sda = 'P22', scl = 'P21', gain = ALS\_GAIN\_1X, integration = ALS\_INT\_100, rate = ALS\_RATE\_500) - -Creates a `LTR329ALS01` object, that will return values for light in lux. Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### LTR329ALS01.light() - -Read the light levels of both `LTR329ALS01` sensors. Returns a **tuple** with two values for light levels in lux. - -### Arguments - -The following arguments may be passed into the constructor. - -* gain: `ALS_GAIN_1X`,`ALS_GAIN_2X`, `ALS_GAIN_4X`, `ALS_GAIN_8X`, `ALS_GAIN_48X`, `ALS_GAIN_96X` -* integration: `ALS_INT_50`, `ALS_INT_100`, `ALS_INT_150`, `ALS_INT_200`, `ALS_INT_250`, `ALS_INT_300`, `ALS_INT_350`, `ALS_INT_400` -* rate: `ALS_RATE_50`, `ALS_RATE_100`, `ALS_RATE_200`, `ALS_RATE_500`, `ALS_RATE_1000`, `ALS_RATE_2000` - -## Pyscan NFC library (MFRC6300) - -### Constructors - -#### class MFRC630(pyscan=None, sda='P22', scl='P21', timeout=None, debug=False) - -Creates a `MFRC630` object. Constructor must be passed a Pyscan or I2C object to successfully construct. - -### Methods - -#### MFRC630.mfrc630\_cmd\_init() - -Initialise the `MFRC630` with some settings - -#### MFRC630.mfrc630\_cmd\_reset() - -Reset the device. Stops the currently active command and resets device. - -#### MFRC630.mfrc630\_cmd\_idle() - -Set the device into idle mode. Stops the currently active command and return to idle mode. - -#### MFRC630.mfrc630\_cmd\_load\_key(key) - -Loads the provided key into the key buffer. - -* `key` Array which holds the MIFARE key, **it is always 6 bytes long** - -#### MFRC630.mfrc630\_MF\_read\_block(block\_address, dest) - -Reads a block of memory from an authenticated card. Try to read a block of memory from the card with the appropriate timeouts and error checking. - -* `block_address` The block to read -* `dest` The array in which to write the 16 bytes read from the card - -Returns `0` for failure, otherwise the number of bytes received. - -#### MFRC630.mfrc630\_MF\_auth(uid, key\_type, block) - -Perform a MIFARE authentication procedure. This function is a higher-level wrapper around the MF authenticate command. The result of the authentication is checked to identify whether it appears to have succeeded. The key must be loaded into the key buffer with `MFRC630.mfrc630_cmd_load_key(key)`. - -Once authenticated, the authentication MUST be stopped manually by calling the `mfrc630_MF_deauth()` function or otherwise disabling the `Crypto1 ON` bit in the status register. - -* `key_type` The MIFARE key A or B (`MFRC630_MF_AUTH_KEY_A` or `MFRC630_MF_AUTH_KEY_B`) to use -* `block` The block to authenticate -* `uid` The authentication procedure required the first four bytes of the card's UID to authenticate - -Returns `0` in case of failure, nonzero in case of success. - -#### MFRC630.mfrc630\_MF\_deauth() - -Disables MIFARE authentication. Disable the `Crypto1` bit from the status register to disable encryption. - -#### MFRC630.mfrc630\_iso14443a\_WUPA\_REQA(instruction) - -Send `WUPA` and `REQA`. Returns the response byte, the answer to request `A` byte (`ATQA`), or `0` in case of no answer. - -* instruction: `MFRC630_ISO14443_CMD_WUPA`, `MFRC630_ISO14443_CMD_REQA` - -#### MFRC630.mfrc630\_iso14443a\_select(uid) - -Performs the `SELECT` procedure to discover a card's UID. This performs the `SELECT` procedure as explained in _ISO14443A_, this determines the UID of the card, if multiple cards are present, a collision will occur, which is handled according to the norm. - -* `uid`: The UID of the card will be stored into this array. - -Returns the length of the UID in bytes (`4, 7, 10`), or `0` in case of failure. - -#### MFRC630.print\_debug(msg) - -Prints debug statements if `DEBUG` is enabled. - -#### MFRC630.format\_block(block, length) - -Prints `block` with `length`. - -#### MFRC630.mfrc630\_format\_block(data, len) - -Converts `data` to hexadecimal format. - -* `data` The array to be formatted -* `len` The number of bytes to format - -#### MFRC630.mfrc630\_print\_block(data, len) - -Prints the bytes in `data` array in hexadecimal format, separated by spaces using the `mfrc630_format_block` method. - -* `data` The array to be printed -* `len` The number of bytes to print - -{{% hint style="info" %}} -Please note that more functionality is being added weekly to these libraries. If a required feature is not available, feel free to contribute with a pull request at the [Libraries GitHub repository](https://github.com/pycom/pycom-libraries) -{{% /hint %}} diff --git a/content/firmwareapi/pycom/expansionboards/pysense.md b/content/firmwareapi/pycom/expansionboards/pysense.md deleted file mode 100644 index eafc2328..00000000 --- a/content/firmwareapi/pycom/expansionboards/pysense.md +++ /dev/null @@ -1,114 +0,0 @@ ---- -title: "Pysense" -aliases: - - pytrackpysense/apireference/pysense.html - - pytrackpysense/apireference/pysense.md - - chapter/pytrackpysense/apireference/pysense ---- - -This chapter describes the various libraries which are designed for the Pysense board. This includes details about the various methods and classes available for each of the Pysense's sensors. - ->Note: follow the guide [here](/firmwareapi/pycom/expansionboards/) to be able to use the functions below - -## 3-Axis Accelerometer (LIS2HH12) - -Pysense has a 3-Axis Accelerometer that provides outputs for acceleration as well as roll, pitch and yaw. - -### Constructors - -#### class LIS2HH12(pysense = None, sda = 'P22', scl = 'P21') - -Creates a `LIS2HH12` object, that will return values for acceleration, roll, pitch and yaw. Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### LIS2HH12.acceleration() - -Read the acceleration from the `LIS2HH12`. Returns a **tuple** with the 3 values of acceleration (G). - -#### LIS2HH12.roll() - -Read the current roll from the `LIS2HH12`. Returns a **float** in degrees in the range -180 to 180. - -#### LIS2HH12.pitch() - -Read the current pitch from the `LIS2HH12`. Returns a **float** in degrees in the range -90 to 90. Once the board tilts beyond this range the values will repeat. This is due to a lack of yaw measurement, making it not possible to know the exact orientation of the board. - -## Digital Ambient Light Sensor (LTR-329ALS-01) - -Pysense has a dual light sensor that provides outputs for external light levels in lux. See the datasheet for more information about the wavelengths of the two sensors. - -### Constructors - -#### class LTR329ALS01(pysense = None, sda = 'P22', scl = 'P21', gain = ALS\_GAIN\_1X, integration = ALS\_INT\_100, rate = ALS\_RATE\_500) - -Creates a `LTR329ALS01` object, that will return values for light in lux. Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### LTR329ALS01.light() - -Read the light levels of both `LTR329ALS01` sensors. Returns a **tuple** with two values for light levels in lux. - -### Arguments - -The following arguments may be passed into the constructor. - -* gain: `ALS_GAIN_1X`,`ALS_GAIN_2X`, `ALS_GAIN_4X`, `ALS_GAIN_8X`, `ALS_GAIN_48X`, `ALS_GAIN_96X` -* integration: `ALS_INT_50`, `ALS_INT_100`, `ALS_INT_150`, `ALS_INT_200`, `ALS_INT_250`, `ALS_INT_300`, `ALS_INT_350`, `ALS_INT_400` -* rate: `ALS_RATE_50`, `ALS_RATE_100`, `ALS_RATE_200`, `ALS_RATE_500`, `ALS_RATE_1000`, `ALS_RATE_2000` - -## Humidity and Temperature Sensor (SI7006A20) - -Pysense has a Humidity and Temperature sensor that provides values of relative humidity and external temperature. - -### Constructors - -#### class SI7006A20(pysense = None, sda = 'P22', scl = 'P21') - -Creates a `SI7006A20` object, that will return values for humidity (%) and temperature ('C). Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### SI7006A20.humidity() - -Read the relative humidity of the `SI7006A20`. Returns a **float** with the percentage relative humidity. - -#### SI7006A20.temperature() - -Read the external temperature of the `SI7006A20`. Returns a **float** with the temperature. - -## Barometric Pressure Sensor with Altimeter (MPL3115A2) - -Pysense has a Barometric Pressure sensor that provides readings for pressure, altitude as well as an additional temperature sensor. - -### Constructors - -#### class MPL3115A2(pysense = None, sda = 'P22', scl = 'P21', mode = PRESSURE) - -Creates a `MPL3115A2` object, that will return values for pressure (Pa), altitude (m) and temperature ('C). Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### MPL3115A2.pressure() - -Read the atmospheric pressure of the `MPL3115A2`. Returns a **float** with the pressure in (Pa). - -#### MPL3115A2.altitude() - -Read the altitude of the `MPL3115A2`. Returns a **float** with the altitude in (m). - -#### MPL3115A2.temperature() - -Read the temperature of the `MPL3115A2`. Returns a **float** with the temperature in ('C). - -### Arguments - -The following arguments may be passed into the constructor. - -* mode: `PRESSURE`, `ALTITUDE` - -{{% hint style="info" %}} -Please note that more functionality is being added weekly to these libraries. If a required feature is not available, feel free to contribute with a pull request at the [Libraries GitHub repository](https://github.com/pycom/pycom-libraries) -{{% /hint %}} - diff --git a/content/firmwareapi/pycom/expansionboards/pysense2.md b/content/firmwareapi/pycom/expansionboards/pysense2.md deleted file mode 100644 index 56d3a55b..00000000 --- a/content/firmwareapi/pycom/expansionboards/pysense2.md +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: "Pysense 2.0 X" -aliases: - - pytrackpysense/apireference/pysense2.html - - pytrackpysense/apireference/pysense2.md - - chapter/pytrackpysense/apireference/pysense2 ---- - -This chapter describes the various libraries which are designed for the Pysense board. This includes details about the various methods and classes available for each of the Pysense's sensors. - ->Note: follow the guide [here](/firmwareapi/pycom/expansionboards/) to be able to use the functions below - -## 3-Axis Accelerometer (LIS2HH12) - -Pysense has a 3-Axis Accelerometer that provides outputs for acceleration as well as roll, pitch and yaw. - -### Constructors - -#### class LIS2HH12(pysense = None, sda = 'P22', scl = 'P21') - -Creates a `LIS2HH12` object, that will return values for acceleration, roll, pitch and yaw. Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### LIS2HH12.acceleration() - -Read the acceleration from the `LIS2HH12`. Returns a **tuple** with the 3 values of acceleration (G). - -#### LIS2HH12.roll() - -Read the current roll from the `LIS2HH12`. Returns a **float** in degrees in the range -180 to 180. - -#### LIS2HH12.pitch() - -Read the current pitch from the `LIS2HH12`. Returns a **float** in degrees in the range -90 to 90. Once the board tilts beyond this range the values will repeat. This is due to a lack of yaw measurement, making it not possible to know the exact orientation of the board. - -## Digital Ambient Light Sensor (LTR-329ALS-01) - -Pysense has a dual light sensor that provides outputs for external light levels in lux. See the datasheet for more information about the wavelengths of the two sensors. - -### Constructors - -#### class LTR329ALS01(pysense = None, sda = 'P22', scl = 'P21', gain = ALS\_GAIN\_1X, integration = ALS\_INT\_100, rate = ALS\_RATE\_500) - -Creates a `LTR329ALS01` object, that will return values for light in lux. Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### LTR329ALS01.light() - -Read the light levels of both `LTR329ALS01` sensors. Returns a **tuple** with two values for light levels in lux. - -### Arguments - -The following arguments may be passed into the constructor. - -* gain: `ALS_GAIN_1X`,`ALS_GAIN_2X`, `ALS_GAIN_4X`, `ALS_GAIN_8X`, `ALS_GAIN_48X`, `ALS_GAIN_96X` -* integration: `ALS_INT_50`, `ALS_INT_100`, `ALS_INT_150`, `ALS_INT_200`, `ALS_INT_250`, `ALS_INT_300`, `ALS_INT_350`, `ALS_INT_400` -* rate: `ALS_RATE_50`, `ALS_RATE_100`, `ALS_RATE_200`, `ALS_RATE_500`, `ALS_RATE_1000`, `ALS_RATE_2000` - -## Humidity and Temperature Sensor (SI7006A20) - -Pysense has a Humidity and Temperature sensor that provides values of relative humidity and external temperature. - -### Constructors - -#### class SI7006A20(pysense = None, sda = 'P22', scl = 'P21') - -Creates a `SI7006A20` object, that will return values for humidity (%) and temperature ('C). Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### SI7006A20.humidity() - -Read the relative humidity of the `SI7006A20`. Returns a **float** with the percentage relative humidity. - -#### SI7006A20.temperature() - -Read the external temperature of the `SI7006A20`. Returns a **float** with the temperature. - -## Barometric Pressure Sensor with Altimeter (MPL3115A2) - -Pysense has a Barometric Pressure sensor that provides readings for pressure, altitude as well as an additional temperature sensor. - -### Constructors - -#### class MPL3115A2(pysense = None, sda = 'P22', scl = 'P21', mode = PRESSURE) - -Creates a `MPL3115A2` object, that will return values for pressure (Pa), altitude (m) and temperature ('C). Constructor must be passed a Pysense or I2C object to successfully construct. - -### Methods - -#### MPL3115A2.pressure() - -Read the atmospheric pressure of the `MPL3115A2`. Returns a **float** with the pressure in (Pa). - -#### MPL3115A2.altitude() - -Read the altitude of the `MPL3115A2`. Returns a **float** with the altitude in (m). - -#### MPL3115A2.temperature() - -Read the temperature of the `MPL3115A2`. Returns a **float** with the temperature in ('C). - -### Arguments - -The following arguments may be passed into the constructor. - -* mode: `PRESSURE`, `ALTITUDE` - -### Constructors - -#### class Pytrack(i2c=None, sda='P22', scl='P21') - -Initialise I2C communication with the supervisor MCU - -### Methods - -#### Pysense.sd_power(enabled=True) - -This command allows switching the power supply for the SD card (VCC + PullUP resistors) - -#### Pysense.sensor_power(enabled=True) - -This command allows switching the power supply for the onboard sensors and any sensors connected through the external 6-pin connector - - -{{% hint style="info" %}} -Please note that more functionality is being added weekly to these libraries. If a required feature is not available, feel free to contribute with a pull request at the [Libraries GitHub repository](https://github.com/pycom/pycom-libraries) -{{% /hint %}} From 20ae24ed5c0f01ac89bcbfae11909c498ec95aee Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 22 Feb 2021 15:47:44 +0100 Subject: [PATCH 11/22] Fixed formatting --- .../pycom/expansionboards/L76GNSS.md | 2 +- .../pycom/expansionboards/LIS2HH12.md | 10 ++++----- .../pycom/expansionboards/LTR329ALS01.md | 6 ++---- .../pycom/expansionboards/MFRC630.md | 2 +- .../pycom/expansionboards/MPL3115A2.md | 8 +++---- .../pycom/expansionboards/SI7006A20.md | 6 +++--- .../pycom/expansionboards/pycoproc.md | 21 +++++++++++++++++++ .../pycom/expansionboards/pycoproc2.md | 21 ++++++++++++++++++- 8 files changed, 57 insertions(+), 19 deletions(-) diff --git a/content/firmwareapi/pycom/expansionboards/L76GNSS.md b/content/firmwareapi/pycom/expansionboards/L76GNSS.md index 1318ad12..31b1e7e6 100644 --- a/content/firmwareapi/pycom/expansionboards/L76GNSS.md +++ b/content/firmwareapi/pycom/expansionboards/L76GNSS.md @@ -8,7 +8,7 @@ The L76GNSS is the GPS module that can provide location data to your application ### class L76GNSS(pytrack = None, sda = 'P22', scl = 'P21', timeout = None) -Creates a `L76GNSS` object. Constructor must be passed a Pytrack or I2C object to successfully construct. Set the `timeout` to a time period (in seconds) for the GPS to search for a lock. If a lock is not found by the time the `timeout` has expired, the `coordinates` method will return `(None, None)`. +Creates a L76GNSS object. Constructor must be passed a Pytrack or I2C object to successfully construct. Set the `timeout` to a period in seconds for the GPS to search for a lock. If a lock is not found by the time the `timeout` has expired, the `coordinates` method will return `(None, None)`. ## Methods diff --git a/content/firmwareapi/pycom/expansionboards/LIS2HH12.md b/content/firmwareapi/pycom/expansionboards/LIS2HH12.md index 48074f9b..ab1a0bf6 100644 --- a/content/firmwareapi/pycom/expansionboards/LIS2HH12.md +++ b/content/firmwareapi/pycom/expansionboards/LIS2HH12.md @@ -2,27 +2,27 @@ Title: "Accelerometer" --- -The LIS2HH12 is a 3-Axis Accelerometer provides outputs for acceleration as well as roll, pitch and yaw. +The LIS2HH12 is a 3-Axis Accelerometer provides outputs for acceleration, roll and pitch ## Constructors ### class LIS2HH12(pycoproc = None, sda = 'P22', scl = 'P21') -Creates a `LIS2HH12` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. +Creates a LIS2HH12 object. Constructor must be passed a Pycoproc or I2C object to successfully construct. ## Methods ### LIS2HH12.acceleration() -Read the acceleration from the `LIS2HH12`. Returns a tuple with the 3 values of acceleration in g-force: `(x, y, z)`. +Read the acceleration from the accelerometer. Returns a tuple with the 3 values of acceleration in g-force: `(x, y, z)`. ### LIS2HH12.roll() -Read the current roll from the `LIS2HH12`. Returns a float in degrees in the range -180 to 180. +Read the current roll from the accelerometer. Returns a float in degrees in the range -180 to 180. ### LIS2HH12.pitch() -Read the current pitch from the `LIS2HH12`. Returns a float in degrees in the range -90 to 90. Once the board tilts beyond this range the values will repeat. This is due to a lack of yaw measurement, making it not possible to know the exact orientation of the board. +Read the current pitch from the accelerometer. Returns a float in degrees in the range -90 to 90. Once the board tilts beyond this range the values will repeat. This is due to a lack of yaw measurement, making it not possible to know the exact orientation of the board. ### LIS2HH12.enable_activity_interrupt(threshold, duration, handler=None) diff --git a/content/firmwareapi/pycom/expansionboards/LTR329ALS01.md b/content/firmwareapi/pycom/expansionboards/LTR329ALS01.md index 4f495137..ce3b1f31 100644 --- a/content/firmwareapi/pycom/expansionboards/LTR329ALS01.md +++ b/content/firmwareapi/pycom/expansionboards/LTR329ALS01.md @@ -8,9 +8,7 @@ The LTR329ALS01 is a dual light sensor that provides outputs for external light ### class LTR329ALS01(pycoproc = None, sda = 'P22', scl = 'P21', gain = LTR329ALS01.ALS_GAIN_1X, integration = LTR329ALS01.ALS_INT_100, rate = LTR329ALS01.ALS_RATE_500) -Creates a `LTR329ALS01` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. The arguments are: -* `pycoproc`: A pycoproc opbject -* `sda / scl`: If pycoproc is not passed, enter the I2C pins here +Creates a LTR329ALS01 object. Constructor must be passed a Pycoproc or I2C object to successfully construct. The additional arguments are: * `gain`: The light sensor ADC gain. see the Constants for values * `integration`: Controls the integration time of the periodic measurement. See the Constants for values * `rate`: The used sample rate in ms, must be set larger than the integration period. See the Constants for values @@ -19,7 +17,7 @@ Creates a `LTR329ALS01` object. Constructor must be passed a Pycoproc or I2C obj ### LTR329ALS01.light() -Read the light levels of both `LTR329ALS01` sensors. Returns a tuple with two values for light levels in lux: `(blue, red)`, between 0-65535. +Read the light levels of both light sensors. Returns a tuple with two values for light levels in lux: `(blue, red)`, between 0-65535. ## Constants diff --git a/content/firmwareapi/pycom/expansionboards/MFRC630.md b/content/firmwareapi/pycom/expansionboards/MFRC630.md index 7d2c3ab2..7283d74a 100644 --- a/content/firmwareapi/pycom/expansionboards/MFRC630.md +++ b/content/firmwareapi/pycom/expansionboards/MFRC630.md @@ -14,7 +14,7 @@ Creates a `MFRC630` object. Constructor must be passed a Pycoproc or I2C object ### MFRC630.mfrc630_cmd_init() -Initialises the `MFRC630`. +Initialises the MFRC630. ### MFRC630.mfrc630_cmd_reset() diff --git a/content/firmwareapi/pycom/expansionboards/MPL3115A2.md b/content/firmwareapi/pycom/expansionboards/MPL3115A2.md index ebede81b..3435716f 100644 --- a/content/firmwareapi/pycom/expansionboards/MPL3115A2.md +++ b/content/firmwareapi/pycom/expansionboards/MPL3115A2.md @@ -6,21 +6,21 @@ Title: "Pressure and Altitude sensor" ### class MPL3115A2(pycoproc = None, sda = 'P22', scl = 'P21', mode = MPL3115A2.PRESSURE) -Creates a `MPL3115A2` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. +Creates a MPL3115A2 object. Constructor must be passed a Pycoproc or I2C object to successfully construct. ## Methods ### MPL3115A2.pressure() -Read the atmospheric pressure of the `MPL3115A2`. Returns a float with the pressure in Pascal. +Read the atmospheric pressure of the sensor. Returns a float with the pressure in Pascal. ### MPL3115A2.altitude() -Read the altitude of the `MPL3115A2`. Returns a float with the altitude in meter. +Read the altitude of the sensor. Returns a float with the altitude in meter. ### MPL3115A2.temperature() -Read the temperature of the `MPL3115A2`. Returns a float with the temperature in degrees Celcius. +Read the temperature of the sensor. Returns a float with the temperature in degrees Celcius. ## Constants diff --git a/content/firmwareapi/pycom/expansionboards/SI7006A20.md b/content/firmwareapi/pycom/expansionboards/SI7006A20.md index 8af5e3ed..6bfd5f64 100644 --- a/content/firmwareapi/pycom/expansionboards/SI7006A20.md +++ b/content/firmwareapi/pycom/expansionboards/SI7006A20.md @@ -8,17 +8,17 @@ The Humidity and Temperature sensor provides values of relative humidity and ext ### class SI7006A20(pycoproc = None, sda = 'P22', scl = 'P21') -Creates a `SI7006A20` object. Constructor must be passed a Pycoproc or I2C object to successfully construct. +Creates a SI7006A20 object. Constructor must be passed a Pycoproc or I2C object to successfully construct. ## Methods ### SI7006A20.humidity() -Read the relative humidity of the `SI7006A20`. Returns a float with the percentage relative humidity. +Read the relative humidity of the sensor. Returns a float with the percentage relative humidity. ### SI7006A20.temperature() -Read the external temperature of the `SI7006A20`. Returns a float with the temperature in degrees Celcius. +Read the external temperature of the sensor. Returns a float with the temperature in degrees Celcius. ### SI7006A20.dew_point() diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc.md b/content/firmwareapi/pycom/expansionboards/pycoproc.md index 8ed4afcf..8b18bd50 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc.md @@ -4,3 +4,24 @@ Title: "Pycoproc" The `pycoproc.py` file is a supporting python library for the Pysense, Pytrack and Pyscan expansionboards. +## Pytrack class to control supervisor MCU + +### Constructors + +#### class Pytrack(i2c=None, sda='P22', scl='P21') + +Initialise I2C communication with the supervisor MCU + +### Methods + +#### Pytrack.sd_power(enabled=True) + +This command allows switching the power supply for the SD card (VCC + PullUP resistors). + +#### Pytrack.sensor_power(enabled=True) + +This command allows switching the power supply for the GPS module and any sensors connected through the external 6-pin connector. + +#### Pytrack.gps_standby(enabled=True) + +This command allows switching the GPS module into stand-by mode. The GPS module is no longer accessible via I2C in this case. diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc2.md b/content/firmwareapi/pycom/expansionboards/pycoproc2.md index d84e921e..bc41a3a6 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc2.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc2.md @@ -2,5 +2,24 @@ Title: "Pycoproc2" --- - The `pycoproc2.py` file is a supporting python library for the Pysense 2 and Pytrack 2 expansionboards. + +### Constructors + +#### class Pytrack(i2c=None, sda='P22', scl='P21') + +Initialise I2C communication with the supervisor MCU + +### Methods + +#### Pytrack.sd_power(enabled=True) + +This command allows switching the power supply for the SD card (VCC + PullUP resistors). + +#### Pytrack.sensor_power(enabled=True) + +This command allows switching the power supply for the GPS module and any sensors connected through the external 6-pin connector. + +#### Pytrack.gps_standby(enabled=True) + +This command allows switching the GPS module into stand-by mode. The GPS module is no longer accessible via I2C in this case. From 83e0e46dd6b6c88aeca157f28367a6d815e4eb24 Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 22 Feb 2021 15:47:54 +0100 Subject: [PATCH 12/22] added to menu tree --- config.toml | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/config.toml b/config.toml index 0d891501..3118197d 100644 --- a/config.toml +++ b/config.toml @@ -744,47 +744,41 @@ theme = "doc-theme" weight = 50 [[menu.main]] - name = "Pygate" - url = "/firmwareapi/pycom/expansionboards/pygate/" - identifier = "firmwareapi@pycom@expansionboards@pygate" + name = "Pycoproc" + url = "/firmwareapi/pycom/expansionboards/pycoproc/" + identifier = "firmwareapi@pycom@expansionboards@pycoproc" parent = "firmwareapi@pycom@expansionboards" weight = 10 [[menu.main]] - name = "pysense" - url = "/firmwareapi/pycom/expansionboards/pysense/" - identifier = "firmwareapi@pycom@expansionboards@pysense" + name = "Pycoproc2" + url = "/firmwareapi/pycom/expansionboards/pycoproc2/" + identifier = "firmwareapi@pycom@expansionboards@pycoproc2" parent = "firmwareapi@pycom@expansionboards" weight = 20 [[menu.main]] - name = "pysense 2.0 x" - url = "/firmwareapi/pycom/expansionboards/pysense2/" + name = "Accelerometer" + url = "/firmwareapi/pycom/expansionboards/LIS2HH12/" identifier = "firmwareapi@pycom@expansionboards@pysense2" parent = "firmwareapi@pycom@expansionboards" weight = 30 [[menu.main]] - name = "pytrack" - url = "/firmwareapi/pycom/expansionboards/pytrack/" - identifier = "firmwareapi@pycom@expansionboards@pytrack" + name = "Light sensor" + url = "/firmwareapi/pycom/expansionboards/LTR329ALS01/" + identifier = "firmwareapi@pycom@expansionboards@LTR329ALS01" parent = "firmwareapi@pycom@expansionboards" weight = 40 [[menu.main]] - name = "pytrack 2.0 x" - url = "/firmwareapi/pycom/expansionboards/pytrack2/" - identifier = "firmwareapi@pycom@expansionboards@pytrack2" + name = "Temperature sensor" + url = "/firmwareapi/pycom/expansionboards/SI7006A20/" + identifier = "firmwareapi@pycom@expansionboards@SI7006A20" parent = "firmwareapi@pycom@expansionboards" weight = 50 [[menu.main]] - name = "pyscan" - url = "/firmwareapi/pycom/expansionboards/pyscan/" - identifier = "firmwareapi@pycom@expansionboards@pyscan" + name = "Pressure sensor" + url = "/firmwareapi/pycom/expansionboards/MPL3115A2/" + identifier = "firmwareapi@pycom@expansionboards@MPL3115A2" parent = "firmwareapi@pycom@expansionboards" weight = 60 -[[menu.main]] - name = "sleep" - url = "/firmwareapi/pycom/expansionboards/sleep/" - identifier = "firmwareapi@pycom@expansionboards@sleep" - parent = "firmwareapi@pycom@expansionboards" - weight = 70 From 8219d7449c6c37a338c04ad6fcfebe0d2888dac9 Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Fri, 26 Feb 2021 12:33:56 +0100 Subject: [PATCH 13/22] removed the pytrack / pysense layer --- .../pycom/expansionboards/pytrack.md | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 content/firmwareapi/pycom/expansionboards/pytrack.md diff --git a/content/firmwareapi/pycom/expansionboards/pytrack.md b/content/firmwareapi/pycom/expansionboards/pytrack.md deleted file mode 100644 index 1a1380bb..00000000 --- a/content/firmwareapi/pycom/expansionboards/pytrack.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: "Pytrack" -aliases: - - pytrackpysense/apireference/pytrack.html - - pytrackpysense/apireference/pytrack.md - - chapter/pytrackpysense/apireference/pytrack ---- - -This chapter describes the various libraries which are designed for the Pytrack board. This includes details about the various methods and classes available for each of the Pytrack's sensors. - ->Note: follow the guide [here](/firmwareapi/pycom/expansionboards/) to be able to use the functions below - -## 3-Axis Accelerometer (LIS2HH12) - -Pytrack has a 3-Axis Accelerometer that provides outputs for acceleration as well as roll, pitch and yaw. - -### Constructors - -#### class LIS2HH12(pytrack = None, sda = 'P22', scl = 'P21') - -Creates a `LIS2HH12` object, that will return values for acceleration, roll, pitch and yaw. Constructor must be passed a Pytrack or I2C object to successfully construct. - -### Methods - -#### LIS2HH12.acceleration() - -Read the acceleration from the `LIS2HH12`. Returns a **tuple** with the 3 values of acceleration (G). - -#### LIS2HH12.roll() - -Read the current roll from the `LIS2HH12`. Returns a **float** in degrees in the range -180 to 180. - -#### LIS2HH12.pitch() - -Read the current pitch from the `LIS2HH12`. Returns a **float** in degrees in the range -90 to 90. Once the board tilts beyond this range the values will repeat. This is due to a lack of yaw measurement, making it not possible to know the exact orientation of the board. - -## GPS with GLONASS (Quectel L76-L GNSS) - -Pytrack has a GPS (with GLONASS) that provides outputs longitude/latitude, speed and other information about the Pytrack's location. - -### Constructors - -#### class L76GNSS(pytrack = None, sda = 'P22', scl = 'P21', timeout = None) - -Creates a `L76GNSS` object, that will return values for longitude and latitude. Constructor must be passed a Pytrack or I2C object to successfully construct. Set the `timeout` to a time period (in seconds) for the GPS to search for a lock. If a lock is not found by the time the `timeout` has expired, the `coordinates` method will return `(None, None)`. - -### Methods - -#### L76GNSS.coordinates(debug = False) - -Read the longitude and latitude from the `L76GNSS`. Returns a **tuple** with the longitude and latitude. With `debug` set to `True` the output from the GPS is verbose. - -{{% hint style="info" %}} -Please note that more functionality is being added weekly to these libraries. If a required feature is not available, feel free to contribute with a pull request at the [Libraries GitHub repository](https://github.com/pycom/pycom-libraries) -{{% /hint %}} - From 22d11ba0d6f4f1c52fff080960acbfcf00d66e9a Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Fri, 26 Feb 2021 12:34:26 +0100 Subject: [PATCH 14/22] Completed the Pycoproc API --- .../pycom/expansionboards/pycoproc.md | 77 ++++++++++++++--- .../pycom/expansionboards/pycoproc2.md | 86 ++++++++++++++++--- 2 files changed, 140 insertions(+), 23 deletions(-) diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc.md b/content/firmwareapi/pycom/expansionboards/pycoproc.md index 8b18bd50..1405d9ac 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc.md @@ -2,26 +2,79 @@ Title: "Pycoproc" --- -The `pycoproc.py` file is a supporting python library for the Pysense, Pytrack and Pyscan expansionboards. +The `pycoproc.py` file is a supporting python library for the first version of Pysense Pytrack and Pyscan expansionboards. For version 2.0 X, see [pycoproc2](../pycoproc2/) -## Pytrack class to control supervisor MCU +## Constructors -### Constructors +### class Pycoproc(i2c=None, sda='P22', scl='P21') -#### class Pytrack(i2c=None, sda='P22', scl='P21') +Initialise I2C communication with the supervisor MCU, if no i2c object is passed, the `sda` and `scl` pins are used. On the board, the sensors are connected on these pins. -Initialise I2C communication with the supervisor MCU +## General methods -### Methods +### py.read_fw_version() -#### Pytrack.sd_power(enabled=True) +Read the PIC firmware version. Check the [update firmware](/updatefirmware/expansionboard/) if an update is available. -This command allows switching the power supply for the SD card (VCC + PullUP resistors). +### py.read_hw_version() -#### Pytrack.sensor_power(enabled=True) +Read the hardware version. -This command allows switching the power supply for the GPS module and any sensors connected through the external 6-pin connector. +### py.read_product_id() -#### Pytrack.gps_standby(enabled=True) +Read the product ID -This command allows switching the GPS module into stand-by mode. The GPS module is no longer accessible via I2C in this case. +### py.button_pressed() + +Returns if the on-board `MCLR` button is pressed. + +### py.read_battery_voltage() + +Returns the battery voltage + +### py.reset_cmd() + +Power cycles the development module. + +## Power methods + +### py.sd_power([enabled=True]) + +This command allows switching the power supply for the SD card: +* `True`: the SD card is enabled +* `False`: the SD card is disabled + +### py.sensor_power([enabled=True]) + +This command allows switching the power supply for the GPS module and any sensors connected through the external Pyport: +* `True`: the power is enabled +* `False`: the power is disabled + +### py.gps_standby([enabled=True]) + +This command allows switching the GPS module into stand-by mode. The GPS module is no longer accessible via I2C in this case: +* `True`: the GPS is put in standby mode +* `False`: the GPS is activated. + +### py.setup_sleep(seconds) + +Sets the sleep time in seconds for `py.go_to_sleep(...)`. This method will momentarily release the USB connection, meaning you will have to reconnect the USB in Pymakr after using this method. + +### py.setup_int_wake_up(rising, falling) + +Enables the accelerometer INT pin (PIC - RA5) as a wakeup source, if the [accelerometer interrupt](../lis2hh12/#lis2hh12enable_activity_interruptthreshold-duration-handlernone) is configured. The boolean parameters will indicate rising edge (activity detection) and/or falling edge (inactivity detection) is configured. + +### py.setup_int_pin_wake_up([rising=True]) + +Allow waking up from an interrupt on PIC RC1, or `EXT_IO_0` on the external IO header + +### py.go_to_sleep([gps=True]) + +Puts the board in sleep mode. This sleep mode consumes less power than the `machine.deepsleep()` available from the firmware, as it turns the power to the inserted development module off.This will also disable the power to the sensors, sd card and Pyport, except for the accelerometer. Arguments are: +* `gps`: Keep the GPS (if available) in standby mode while sleeping. This reduces the power consumption, but might extend the time to location fix after wakeup. + +### py.get_sleep_remaining() + +In the event of a sleep session that was awoken by an asynchronous event (Accelerometer, INT pin or Reset button) the approximate sleep remaining interval (expressed in **seconds**) can be found out. The user has to manually use `setup_sleep()` to configure the next sleep interval. + +## Example diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc2.md b/content/firmwareapi/pycom/expansionboards/pycoproc2.md index bc41a3a6..f47eca95 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc2.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc2.md @@ -2,24 +2,88 @@ Title: "Pycoproc2" --- -The `pycoproc2.py` file is a supporting python library for the Pysense 2 and Pytrack 2 expansionboards. +The `pycoproc2.py` file is a supporting python library for the Pysense 2 and Pytrack 2 expansionboards. -### Constructors +## Constructors -#### class Pytrack(i2c=None, sda='P22', scl='P21') +### class Pycoproc(i2c=None, sda='P22', scl='P21') -Initialise I2C communication with the supervisor MCU +Initialise I2C communication with the supervisor MCU, if no i2c object is passed, the `sda` and `scl` pins are used. On a Pysense 2 / Pytrack 2 board, the sensors are connected on these pins. -### Methods +## General methods -#### Pytrack.sd_power(enabled=True) +### py.read_fw_version() -This command allows switching the power supply for the SD card (VCC + PullUP resistors). +Read the PIC firmware version. Check the [update firmware](/updatefirmware/expansionboard/) if an update is available. -#### Pytrack.sensor_power(enabled=True) +### py.read_hw_version() -This command allows switching the power supply for the GPS module and any sensors connected through the external 6-pin connector. +Read the hardware version. -#### Pytrack.gps_standby(enabled=True) +### py.read_product_id() -This command allows switching the GPS module into stand-by mode. The GPS module is no longer accessible via I2C in this case. +Read the product ID + +### py.button_pressed() + +Returns if the on-board `MCLR` button is pressed. + +### py.read_battery_voltage() + +Returns the battery voltage + +### py.reset_cmd() + +Power cycles the development module. + +## Power methods + +### py.sd_power([enabled=True]) + +This command allows switching the power supply for the SD card: +* `True`: the SD card is enabled +* `False`: the SD card is disabled + +### py.sensor_power([enabled=True]) + +This command allows switching the power supply for the GPS module and any sensors connected through the external Pyport: +* `True`: the power is enabled +* `False`: the power is disabled + +### py.gps_standby([enabled=True]) + +This command allows switching the GPS module into stand-by mode. The GPS module is no longer accessible via I2C in this case: +* `True`: the GPS is put in standby mode +* `False`: the GPS is activated. + +### py.setup_sleep(seconds) + +Sets the sleep time in seconds for `py.go_to_sleep(...)`. This method will momentarily release the USB connection, meaning you will have to reconnect the USB in Pymakr after using this method. + +### py.go_to_sleep([gps=True, pycom_module_off=True, accelerometer_off=True, wake_interrupt=False]) + +Puts the board in sleep mode. This sleep mode consumes less power than the `machine.deepsleep()` available from the firmware, as it turns the power to the inserted development module off.This will also disable the power to the sensors, sd card and Pyport, except for the accelerometer. Arguments are: +* `gps`: Keep the GPS (if available) in standby mode while sleeping. This reduces the power consumption, but might extend the time to location fix after wakeup. +* `pycom_module_off`: Turn off the power to the inserted development module. This dramatically reduces the power consumption, but will not allow for wake on accelerometer interrupt. See the example below on how to achieve that. +* `accelerometer_off`: Turn off the power to the accelerometer. +* `wake_interrupt`: Allow waking up from an interrupt on PIC RC1, or `EXT_IO_0` on the external IO header. + +## Example + +Use the following example to wake up from an accelerometer interrupt: + +```python +import machine +import time +from pycoproc import Pycoproc + +py = Pycoproc() +print("enable pycom module to wake up from accelerometer interrupt") +wake_pins = [Pin('P13', mode=Pin.IN, pull=Pin.PULL_DOWN)] +machine.pin_sleep_wakeup(wake_pins, machine.WAKEUP_ANY_HIGH, True) + +print("put pycoproc to sleep and pycom module to deepsleep") +py.setup_sleep(sleep_time_s) +py.go_to_sleep(pycom_module_off=False, accelerometer_off=False, wake_interrupt=True) +machine.deepsleep(sleep_time_s * 1000) +``` \ No newline at end of file From a97954d7ac5f36e5dcb00aa14c3b1f34e938ac97 Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Fri, 26 Feb 2021 12:37:31 +0100 Subject: [PATCH 15/22] fixed naming --- content/firmwareapi/pycom/expansionboards/pycoproc.md | 10 ++++------ content/firmwareapi/pycom/expansionboards/pycoproc2.md | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc.md b/content/firmwareapi/pycom/expansionboards/pycoproc.md index 1405d9ac..ceb10f03 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc.md @@ -10,7 +10,7 @@ The `pycoproc.py` file is a supporting python library for the first version of P Initialise I2C communication with the supervisor MCU, if no i2c object is passed, the `sda` and `scl` pins are used. On the board, the sensors are connected on these pins. -## General methods +## General functions ### py.read_fw_version() @@ -26,7 +26,7 @@ Read the product ID ### py.button_pressed() -Returns if the on-board `MCLR` button is pressed. +Returns `True` if the on-board `MCLR` button is pressed. ### py.read_battery_voltage() @@ -36,7 +36,7 @@ Returns the battery voltage Power cycles the development module. -## Power methods +## Power functions ### py.sd_power([enabled=True]) @@ -75,6 +75,4 @@ Puts the board in sleep mode. This sleep mode consumes less power than the `mach ### py.get_sleep_remaining() -In the event of a sleep session that was awoken by an asynchronous event (Accelerometer, INT pin or Reset button) the approximate sleep remaining interval (expressed in **seconds**) can be found out. The user has to manually use `setup_sleep()` to configure the next sleep interval. - -## Example +In the event of a sleep session that was awoken by an asynchronous event (Accelerometer, INT pin or Reset button) the approximate sleep remaining interval (expressed in **seconds**) can be found out. The user has to manually use `setup_sleep()` to configure the next sleep interval. \ No newline at end of file diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc2.md b/content/firmwareapi/pycom/expansionboards/pycoproc2.md index f47eca95..307477d3 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc2.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc2.md @@ -10,7 +10,7 @@ The `pycoproc2.py` file is a supporting python library for the Pysense 2 and Pyt Initialise I2C communication with the supervisor MCU, if no i2c object is passed, the `sda` and `scl` pins are used. On a Pysense 2 / Pytrack 2 board, the sensors are connected on these pins. -## General methods +## General functions ### py.read_fw_version() @@ -26,7 +26,7 @@ Read the product ID ### py.button_pressed() -Returns if the on-board `MCLR` button is pressed. +Returns `True` if the on-board `MCLR` button is pressed. ### py.read_battery_voltage() @@ -36,7 +36,7 @@ Returns the battery voltage Power cycles the development module. -## Power methods +## Power functions ### py.sd_power([enabled=True]) From dfe7ad34153e8beadf7a8e3a9fe44c746954445c Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Fri, 26 Feb 2021 15:43:54 +0100 Subject: [PATCH 16/22] updated landing page --- config.toml | 14 ++++++- .../pycom/expansionboards/_index.md | 39 +++++++------------ .../pycom/expansionboards/pycoproc.md | 30 +++----------- 3 files changed, 33 insertions(+), 50 deletions(-) diff --git a/config.toml b/config.toml index 3118197d..b2cc0621 100644 --- a/config.toml +++ b/config.toml @@ -737,7 +737,7 @@ theme = "doc-theme" weight = 40 [[menu.main]] - name = "Expansion boards" + name = "Pyshields" url = "/firmwareapi/pycom/expansionboards/" identifier = "firmwareapi@pycom@expansionboards" parent = "firmwareapi@pycom" @@ -779,6 +779,18 @@ theme = "doc-theme" identifier = "firmwareapi@pycom@expansionboards@MPL3115A2" parent = "firmwareapi@pycom@expansionboards" weight = 60 + [[menu.main]] + name = "RFID / NFC" + url = "/firmwareapi/pycom/expansionboards/MFRC630/" + identifier = "firmwareapi@pycom@expansionboards@MFRC630" + parent = "firmwareapi@pycom@expansionboards" + weight = 70 +[[menu.main]] + name = "GPS" + url = "/firmwareapi/pycom/expansionboards/L76GNSS/" + identifier = "firmwareapi@pycom@expansionboards@L76GNSS" + parent = "firmwareapi@pycom@expansionboards" + weight = 80 diff --git a/content/firmwareapi/pycom/expansionboards/_index.md b/content/firmwareapi/pycom/expansionboards/_index.md index e30944e1..1d3cb67d 100644 --- a/content/firmwareapi/pycom/expansionboards/_index.md +++ b/content/firmwareapi/pycom/expansionboards/_index.md @@ -1,43 +1,32 @@ --- -title: "Product info & Datasheets" -aliases: - - firmwareapi/introduction.html - - firmwareapi/introduction.md - - product-info - - chapter/firmwareapi +title: "PyShields" --- -As the development for these devices are on going with additional features being added, every week, it is essential to ensure you frequently check for updates on the Pytrack/Pysense/Pyscan. As well as updating the device firmware, it is important to check the [GitHub repository](https://github.com/pycom/pycom-libraries) for the respective library files as they as also being updated, to include additional features/functionality. -> Please note that updated libraries are available for the Pytrack 2.0 X and Pysense 2.0 X in the pytrack-2 and pysense-2 directories on GitHub. -These new libraries will allow you to use the new additional features. +The following shields offer additional functionality through sensors and other peripherals: +* Pysense +* Pysense 2.0 X +* Pytrack +* Pytrack 2.0 X +* Pyscan -## Uploading the Libraries to a Device - -These libraries should be uploaded to a device in the same process as a standard MicroPython library. The various `.py` files should be placed into the `/lib` folder on the device. - -Add as many or as few of the libraries that are required. +These libraries are available from the [GitHub releases](https://github.com/pycom/pycom-libraries/releases) and not built directly into the firmware. You can use the Libraries with the first and second version of the Pysense, Pytrack and Pyscan. You can also download individual libraries from our [Github repository](https://github.com/pycom/pycom-libraries/). -In addition to the Pysense or Pytrack specific libraries, for hardware version 1.x boards you also need to upload the `pycoproc.py` file from the `lib/pycoproc` folder inside the libraries archive. For the Pytrack 2.0 X and Pysense 2.0 X, the pycoproc.py file is included in the pytrack-2 and pysense-2 directories to avoid confusion over which library to use. +The API pages are separated per sensor. On the first hardware version of the pyshields, the `pycoproc` is used. For the second version, we use `pycoproc2`. -For example, if using the Pysense and the user wishes to enable the only Accelerometer and the Light Sensor, they should place the following `.py` files into the device's `/lib` folder: +## Uploading the Libraries to a Device -```text -- pysense.py -- pycoproc.py -- LIS2HH12.py -- LTR329ALS01.py -``` +Place the applicable Python files for your shield into the `/lib` folder of your project. Do not forget to press `upload project to device` in Pymakr to make sure you are able to use them. -## Importing/Using the Libraries +## Importing and using the libraries Once the libraries are uploaded to the device, they can be used/imported as a typical MicroPython library would be. For example, importing and using the light sensor on the Pysense: ```python -from pysense import Pysense +from pycoproc import Pycoproc from LTR329ALS01 import LTR329ALS01 -py = Pysense() +py = Pycoproc() lt = LTR329ALS01(py) print(lt.light()) diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc.md b/content/firmwareapi/pycom/expansionboards/pycoproc.md index ceb10f03..1233a3b9 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc.md @@ -6,9 +6,13 @@ The `pycoproc.py` file is a supporting python library for the first version of P ## Constructors -### class Pycoproc(i2c=None, sda='P22', scl='P21') +### class Pycoproc(board_type, [i2c=None, sda='P22', scl='P21']) + +Initialise I2C communication with the supervisor MCU, if no i2c object is passed, the `sda` and `scl` pins are used. On the shield, the sensors are connected on these pins. Board type can be: +* `Pycoproc.PYSENSE` +* `Pycoproc.PYTRACK` +* `Pycoproc.PYSCAN` -Initialise I2C communication with the supervisor MCU, if no i2c object is passed, the `sda` and `scl` pins are used. On the board, the sensors are connected on these pins. ## General functions @@ -32,30 +36,8 @@ Returns `True` if the on-board `MCLR` button is pressed. Returns the battery voltage -### py.reset_cmd() - -Power cycles the development module. - ## Power functions -### py.sd_power([enabled=True]) - -This command allows switching the power supply for the SD card: -* `True`: the SD card is enabled -* `False`: the SD card is disabled - -### py.sensor_power([enabled=True]) - -This command allows switching the power supply for the GPS module and any sensors connected through the external Pyport: -* `True`: the power is enabled -* `False`: the power is disabled - -### py.gps_standby([enabled=True]) - -This command allows switching the GPS module into stand-by mode. The GPS module is no longer accessible via I2C in this case: -* `True`: the GPS is put in standby mode -* `False`: the GPS is activated. - ### py.setup_sleep(seconds) Sets the sleep time in seconds for `py.go_to_sleep(...)`. This method will momentarily release the USB connection, meaning you will have to reconnect the USB in Pymakr after using this method. From 26720a6f112c9af60d38bc7adb9b138f250d843a Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 1 Mar 2021 12:15:08 +0100 Subject: [PATCH 17/22] renamed to shields --- config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.toml b/config.toml index b2cc0621..7c2d218f 100644 --- a/config.toml +++ b/config.toml @@ -737,7 +737,7 @@ theme = "doc-theme" weight = 40 [[menu.main]] - name = "Pyshields" + name = "Shields" url = "/firmwareapi/pycom/expansionboards/" identifier = "firmwareapi@pycom@expansionboards" parent = "firmwareapi@pycom" From 6440e4b76cb6705a6914672a1545cbf453663a2f Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 1 Mar 2021 12:15:15 +0100 Subject: [PATCH 18/22] added v16 warning --- content/firmwareapi/pycom/expansionboards/pycoproc2.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/content/firmwareapi/pycom/expansionboards/pycoproc2.md b/content/firmwareapi/pycom/expansionboards/pycoproc2.md index 307477d3..185a32bc 100644 --- a/content/firmwareapi/pycom/expansionboards/pycoproc2.md +++ b/content/firmwareapi/pycom/expansionboards/pycoproc2.md @@ -4,6 +4,14 @@ Title: "Pycoproc2" The `pycoproc2.py` file is a supporting python library for the Pysense 2 and Pytrack 2 expansionboards. +> The latest version of `pycoproc2.py` only works with a v16 or later expansionboard-firmware on the Pytrack 2 / Pysense 2. Check whether you have the correct firmware installed by using the following: +> ```python +> from pycoproc import Pycoproc +> py = Pycoproc() +> print(py.read_fw_version()) +> ``` +> If this returns 15 or lower, please update the [expansionboard firmware](/updatefirmware/expansionboard/) + ## Constructors ### class Pycoproc(i2c=None, sda='P22', scl='P21') From 4c43bb074916b0c1e62ede55af3739a8983fa58b Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 8 Mar 2021 11:17:36 +0100 Subject: [PATCH 19/22] added sensor list and changed naming --- .../pycom/expansionboards/_index.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/content/firmwareapi/pycom/expansionboards/_index.md b/content/firmwareapi/pycom/expansionboards/_index.md index 1d3cb67d..c9f8d6a7 100644 --- a/content/firmwareapi/pycom/expansionboards/_index.md +++ b/content/firmwareapi/pycom/expansionboards/_index.md @@ -1,17 +1,27 @@ --- -title: "PyShields" +title: "Shields" --- -The following shields offer additional functionality through sensors and other peripherals: +The API pages in this section explain the additional functionality offered by the following shields: * Pysense * Pysense 2.0 X * Pytrack * Pytrack 2.0 X * Pyscan -These libraries are available from the [GitHub releases](https://github.com/pycom/pycom-libraries/releases) and not built directly into the firmware. You can use the Libraries with the first and second version of the Pysense, Pytrack and Pyscan. You can also download individual libraries from our [Github repository](https://github.com/pycom/pycom-libraries/). +Note that this functionality is not built into the firmware, and you will need to download additional libraries from our [Github libraries repository](https://github.com/pycom/pycom-libraries/tree/master/shields). -The API pages are separated per sensor. On the first hardware version of the pyshields, the `pycoproc` is used. For the second version, we use `pycoproc2`. +The API pages are separated per sensor: +* [Accelerometer](lis2hh12/) (LIS2HH12) +* [Light Sensor](ltr329als01/) (LTR329ALS01) +* [Temperature Sensor](si7005a20/) (SI7006A20) +* [Pressure Sensor](mpl311a2/) (MPL3115A2) +* [RFID / NFC](mfrc630/) (MFRC630) +* [GPS](l76gnss/) (L76GNSS) + +Next to that, you will need either one of the supporting files needed to operate the shield: +* [Pycoproc](pycoproc/) - used on the first version of the Shields +* [Pycoproc2](pycoproc2/) - used on the second version of the Shields ## Uploading the Libraries to a Device From 9738daf77864e9605788e6d97606d57a6e84b043 Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 8 Mar 2021 11:17:52 +0100 Subject: [PATCH 20/22] modified links --- content/gettingstarted/_index.md | 4 ++-- content/tutorials/expansionboards/pysense2.md | 2 +- content/tutorials/expansionboards/pytrack.md | 2 +- content/tutorials/expansionboards/pytrack2.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/content/gettingstarted/_index.md b/content/gettingstarted/_index.md index 20d278de..b1ad6516 100644 --- a/content/gettingstarted/_index.md +++ b/content/gettingstarted/_index.md @@ -16,7 +16,7 @@ In the following guide, we will explain the basic process to get started using y 1. [Setting up the hardware](#step-1-setting-up-the-hardware) 2. [Setting up your computer](#step-2-setting-up-your-computer) 3. [Programming the module](#step-3-programming-your-module) -4. [Using your Expansionboard](#step-4-using-your-expansionboard) +4. [Using your Shield](#step-4-using-your-shield) @@ -127,7 +127,7 @@ If you need to remove files from your device you can use the following commands: >>> os.fsformat('/flash') ``` -## Step 4: Using your expansionboard +## Step 4: Using your shield From here on, you can continue to use the additional features of your expansionboard: >Note The Expansionboard requires no additional libraries and all functions work out of the box! diff --git a/content/tutorials/expansionboards/pysense2.md b/content/tutorials/expansionboards/pysense2.md index 22a785cd..b6a66c85 100644 --- a/content/tutorials/expansionboards/pysense2.md +++ b/content/tutorials/expansionboards/pysense2.md @@ -7,7 +7,7 @@ aliases: --- The Pysense 2.0 X has an external header that allows you to attach all kinds of sensors. ## All sensors ->Note: You can find this example in the [GitHub repository](https://github.com/pycom/pycom-libraries/tree/master/pysense-2). Over there, you can also find the relevant libraries. +>Note: You can find this example in the [GitHub repository](https://github.com/pycom/pycom-libraries/). Over there, you can also find the relevant libraries. ```python #!/usr/bin/env python # diff --git a/content/tutorials/expansionboards/pytrack.md b/content/tutorials/expansionboards/pytrack.md index 56b8ae7f..eaa8a7b9 100644 --- a/content/tutorials/expansionboards/pytrack.md +++ b/content/tutorials/expansionboards/pytrack.md @@ -7,7 +7,7 @@ aliases: --- Both the Pysense and Pytrack use the same accelerometer. Please see the [Pysense Examples](../pysense) to see how to use the accelerometer. ->Note: You can find this example in the [GitHub repository](https://github.com/pycom/pycom-libraries/tree/master/pytrack). Over there, you can also find the relevant libraries. +>Note: You can find this example in the [GitHub repository](https://github.com/pycom/pycom-libraries/). Over there, you can also find the relevant libraries. ## GPS Example diff --git a/content/tutorials/expansionboards/pytrack2.md b/content/tutorials/expansionboards/pytrack2.md index c17b9c0d..32fd2831 100644 --- a/content/tutorials/expansionboards/pytrack2.md +++ b/content/tutorials/expansionboards/pytrack2.md @@ -7,7 +7,7 @@ aliases: --- The Pytrack 2.0 X has an external header that allows you to attach all kinds of sensors. ## All sensors ->Note: You can find this example in the [GitHub repository](https://github.com/pycom/pycom-libraries/tree/master/pytrack-2). Over there, you can also find the relevant libraries. +>Note: You can find this example in the [GitHub repository](https://github.com/pycom/pycom-libraries/). Over there, you can also find the relevant libraries. ```python #!/usr/bin/env python # From 703248e53188a39b2a8e54446a64f9e85a7af2bb Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 8 Mar 2021 11:32:51 +0100 Subject: [PATCH 21/22] changed menu names --- config.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config.toml b/config.toml index 7c2d218f..d5138760 100644 --- a/config.toml +++ b/config.toml @@ -756,37 +756,37 @@ theme = "doc-theme" parent = "firmwareapi@pycom@expansionboards" weight = 20 [[menu.main]] - name = "Accelerometer" + name = "LIS2HH12" url = "/firmwareapi/pycom/expansionboards/LIS2HH12/" identifier = "firmwareapi@pycom@expansionboards@pysense2" parent = "firmwareapi@pycom@expansionboards" weight = 30 [[menu.main]] - name = "Light sensor" + name = "LTR329ALS01" url = "/firmwareapi/pycom/expansionboards/LTR329ALS01/" identifier = "firmwareapi@pycom@expansionboards@LTR329ALS01" parent = "firmwareapi@pycom@expansionboards" weight = 40 [[menu.main]] - name = "Temperature sensor" + name = "SI7006A20" url = "/firmwareapi/pycom/expansionboards/SI7006A20/" identifier = "firmwareapi@pycom@expansionboards@SI7006A20" parent = "firmwareapi@pycom@expansionboards" weight = 50 [[menu.main]] - name = "Pressure sensor" + name = "MPL3115A2" url = "/firmwareapi/pycom/expansionboards/MPL3115A2/" identifier = "firmwareapi@pycom@expansionboards@MPL3115A2" parent = "firmwareapi@pycom@expansionboards" weight = 60 [[menu.main]] - name = "RFID / NFC" + name = "MFRC630" url = "/firmwareapi/pycom/expansionboards/MFRC630/" identifier = "firmwareapi@pycom@expansionboards@MFRC630" parent = "firmwareapi@pycom@expansionboards" weight = 70 [[menu.main]] - name = "GPS" + name = "L76GNSS" url = "/firmwareapi/pycom/expansionboards/L76GNSS/" identifier = "firmwareapi@pycom@expansionboards@L76GNSS" parent = "firmwareapi@pycom@expansionboards" From 73a73497c4cd34f55563d9b3241072f7c026989a Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 8 Mar 2021 12:39:41 +0100 Subject: [PATCH 22/22] updated naming --- config.toml | 2 +- content/tutorials/expansionboards/_index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.toml b/config.toml index d5138760..ea3b4e7b 100644 --- a/config.toml +++ b/config.toml @@ -415,7 +415,7 @@ theme = "doc-theme" weight = 70 [[menu.main]] - name = "Expansion Boards" + name = "Shields" url = "/tutorials/expansionboards/" identifier = "tutorials@expansionboards" parent = "tutorials" diff --git a/content/tutorials/expansionboards/_index.md b/content/tutorials/expansionboards/_index.md index 2fb20d4d..a3adad2a 100644 --- a/content/tutorials/expansionboards/_index.md +++ b/content/tutorials/expansionboards/_index.md @@ -1,5 +1,5 @@ --- -title: "Overview" +title: "Shields" aliases: - tutorials/expansionboards/introduction.html - tutorials/expansionboards/introduction.md