Loading...
Searching...
No Matches
AnalogShield.h File Reference

Library for the U of T Physics Analog Shield (Introduction to Electronics). More...

#include <Arduino.h>

Go to the source code of this file.

Classes

class  AnalogShield
 Encoder, switch, temperature signals, potentiometer and LEDs on the Analog Shield. More...

Namespaces

namespace  AnalogShieldPins
 Shield signals by Arduino pin, from the Rev-C schematic.

Macros

Library version

Keep equal to version= in library.properties; CI checks that they match.

#define ANALOG_SHIELD_VERSION   "0.1.2"
 Full version, as in library.properties (may carry a suffix such as "-rc.1").
#define ANALOG_SHIELD_VERSION_MAJOR   0
 Major version: incompatible API changes.
#define ANALOG_SHIELD_VERSION_MINOR   1
 Minor version: new features, compatible.
#define ANALOG_SHIELD_VERSION_PATCH   2
 Patch version: fixes only.

Enumerations

enum class  TempSource : uint8_t { SENSOR , MCU , EXT }
 Temperature signal to read with AnalogShield::TempRaw() or AnalogShield::TempMillivolts(). More...

Variables

Analog header (J4)

A2 is not connected.

constexpr uint8_t AnalogShieldPins::TEMP_SIG_MCU = A0
 Conditioned temperature signal, JP2 at Internal (RP2040 ADC).
constexpr uint8_t AnalogShieldPins::SENSOR_IN = A1
 Raw temperature sensor (JP1: Internal U1 or External J1).
constexpr uint8_t AnalogShieldPins::TEMP_SIG_EXT = A3
 Conditioned temperature signal, JP2 at External (MAX11635 ADC on the Phyduino Pico).
constexpr uint8_t AnalogShieldPins::IR_VOUT = A4
 Sharp GP2Y0A21YK0F IR distance sensor (J2).
constexpr uint8_t AnalogShieldPins::POT = A5
 Potentiometer RV1 wiper (0 V to VDD).
Digital header (J7)
constexpr uint8_t AnalogShieldPins::ENC_SW = 2
 Rotary encoder push switch, active low (pulled up to VDD).
constexpr uint8_t AnalogShieldPins::ENC_A = 3
 Rotary encoder channel A, active low (pulled up to VDD).
constexpr uint8_t AnalogShieldPins::ENC_B = 4
 Rotary encoder channel B, active low (pulled up to VDD).
constexpr uint8_t AnalogShieldPins::LED2 = 5
 D2 red LED, active low (anode to VDD).
constexpr uint8_t AnalogShieldPins::LED1 = 6
 D1 green LED, active low (anode to VDD).

Detailed Description

Library for the U of T Physics Analog Shield (Introduction to Electronics).

Hardware reference: https://perc-sw.github.io/analog_shield/

Pins use Arduino names (A0, 2, ...), never MCU GPIO numbers, so the library works on any Uno-style board (Phyduino Pico, Uno R3/R4).

Enumeration Type Documentation

◆ TempSource

enum class TempSource : uint8_t
strong

Temperature signal to read with AnalogShield::TempRaw() or AnalogShield::TempMillivolts().

Enumerator
SENSOR 

Raw sensor output on SENSOR_IN (A1).

MCU 

Conditioned signal on TEMP_SIG_MCU (A0, RP2040 ADC), JP2 at Internal.

EXT 

Conditioned signal on TEMP_SIG_EXT (A3, MAX11635 external ADC on the Phyduino Pico), JP2 at External.

Examples
SerialPlotter.ino, and Temperature.ino.