Repository navigation
Releases
Analog Shield Library v0.1.2
Analog Shield Library v0.1.2
Fixes EXT temperature readings on the Phyduino Pico.
Install: download AnalogShield-0.1.2.zip from this release, then in the Arduino IDE use
Sketch → Include Library → Add .ZIP Library…
Fixed
- EXT temperatures read about 5 °C too hot. The Phyduino Pico has a 100 kΩ pull-down on A3
(R47), in parallel with the shield's R15. That load makes A3 read about 4 % below A0 for the
same temperature.TempCelsius(),TempFahrenheit()andTempKelvin()onTempSource::EXT
now allow for it: on a Phyduino Pico, EXT read 24.2 °C against 24.3 °C on the raw sensor.
Full list of changes: CHANGELOG.md
Analog Shield Library v0.1.1
Analog Shield Library v0.1.1
Fixes temperature and voltage readings on the Phyduino Pico, and adds a plotter example.
Install: download AnalogShield-0.1.1.zip from this release, then in the Arduino IDE use
Sketch → Include Library → Add .ZIP Library…
Documentation: https://perc-sw.github.io/analog_shield_lib/
Upgrading
Phyduino Pico builds now need the board package phyduino_bsp v0.1.0-rc.2 or later, which
provides analogFullScaleMillivolts(). With v0.1.0-alpha.1 every sketch fails to compile.
Fixed
- EXT temperatures:
TempCelsius(),TempFahrenheit()andTempKelvin()on
TempSource::EXTleft out the R15 / 10K divider, so readings came out far too hot. EXT now
undoes the same signal path as MCU and reads the sensor's full -50 to 150 °C range. - Full scale on the Phyduino Pico: millivolt and temperature readings now use each pin's own
full scale: 3.3 V on A0-A2 (RP2040 ADC) and 2.048 V on A3-A5 (MAX11635).
TempMillivolts(TempSource::EXT)andPotMillivolts()were 1.61 times too high. Other boards
still assume 3.3 V. - SerialPlotter documentation: the last value is
Channel(0 for A0, 3 for A3), notSwitch.
Added
| Example | Shows |
|---|---|
plotter |
Port of the MicroPython plotter example: raw and conditioned temperatures, encoder clicks, selected channel, potentiometer and VBUS in the Serial Plotter. The switch selects A0 or A3, shown on D1/D2, and both LEDs light if the MAX11635 stops responding. Phyduino Pico only. |
Full list of changes: CHANGELOG.md
Analog Shield library release v0.1.0
AnalogShield v0.1.0
First release of the Arduino library for the U of T Physics Analog Shield (Rev-C), used in the
Introduction to Electronics course. Developed for the Phyduino Pico (RP2040, board package
phyduino_bsp v0.1.0-alpha.1 or later); also builds for the Arduino Uno R3 and Uno R4 Minima.
Install: download AnalogShield-0.1.0.zip from this release, then in the Arduino IDE use
Sketch → Include Library → Add .ZIP Library…
Documentation: https://perc-sw.github.io/analog_shield_lib/
Library
- Pin map:
AnalogShieldPinsconstants for every shield signal, using Arduino pin names, from the
Rev-C schematic. - Rotary encoder: counted with interrupts from
begin();EncoderCount(),EncoderDetents(),
SetEncoderCount(), and an optional per-step callback (SetEncoderCallback()). - Encoder switch:
SwitchPressed()and an optional press/release callback (SetSwitchCallback()). - Temperature (LMT84):
TempRaw(),TempMillivolts(),TempCelsius(),TempFahrenheit()and
TempKelvin(), on the raw sensor (SENSOR), the conditioned signal for the MCU ADC (MCU) or for an
external ADC (EXT). The shield's signal conditioning is undone before the LMT84 conversion. - Potentiometer:
PotRaw(),PotMillivolts()andPotPercent(). - ADC resolution:
SetAdcResolution()/AdcResolution(), 8 to 12 bits; millivolt and
temperature conversions follow it. - Averaging: every analog reading takes an optional
samplescount to average several ADC reads. - LEDs:
LedON()andLedToggle()for D1 (green) and D2 (red); both LEDs are active low, and the
library handles that. - Version:
ANALOG_SHIELD_VERSION("0.1.0") andANALOG_SHIELD_VERSION_MAJOR/_MINOR/
_PATCH, so a sketch can check which library version it was built with.
Examples
| Example | Shows |
|---|---|
EncoderPolling |
Reading the encoder and switch from loop() |
EncoderInterrupt |
The same, with callbacks |
Temperature |
LMT84 temperature as an ADC reading, mV, °C, °F and K |
SerialPlotter |
Encoder, potentiometer and temperatures in the Serial Plotter; the switch selects the MCU or EXT channel |
LedFade |
PWM fading of D1 and D2 |