GroveBaseHat class
SeedStudio Grove Base Hat for Raspberry Pi
Constructors
- GroveBaseHat([int i2cBus = 1])
Properties
Methods
-
changeI2Caddress(
int newI2Caddress) → void - Changes the I2C address of the hat. NOT TESTED!
-
getFirmware(
) → int - Returns the firmware version.
-
getGrovePowerSupplyVoltage(
) → int - Returns the supply voltage.
-
getId(
) → int - Returns the internal hardware id of the hat. RPI_HAT_PID (0x4) for a 'Grove Base Hat RPi', and RPI_ZERO_HAT_PID (0x05) for a 'Grove Base Hat RPi Zero'.
-
getName(
) → String - Returns the name of the hat model.
-
isHatRPiZero(
) → bool - Returns true for the Pi Zero model, false for the Pi model.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readADCraw(
int channel) → int -
Reads the raw data of ADC unit, with 12 bits resolution
from the
channel
0 - 7 and returns a ADC result in the range0 - 4095
. -
readInputVoltage(
int channel) → int -
Reads the voltage data of ADC unit from the
channel
0 - 7 and returns the voltage in mV. -
readRatio(
int channel) → int -
Reads the ratio between channel input voltage and power voltage (most time it's 3.3V).
channel
0 - 7, specify the channel to read, returns the ration in 0.1%. -
resetHat(
) → void - Resets the hat. NOT TESTED!
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited