GroveBaseHat class
Grove Base Hat RaspberryPi Zero
Parameter | Grove Base Hat |
---|---|
Working Voltage | 3.3V |
MCU | STM32F030F4P6 |
Grove Ports Pi | 6 x Digital(3.3V), 4 x Analog(3.3V) |
3 x I2C(3.3V); 1 x PWM(3.3V) | |
1 x RPISER(UART) connect to Pi(3.3V) | |
Grove Ports Pi Zero | 2 x Digital(3.3V), 3 x Analog(3.3V) |
3 x I2C(3.3V), 1 x PWM(3.3V) | |
1 x RPISER(UART) connect to Pi(3.3V) | |
Grove-Digital | Connect to Raspberry Pi directly |
Grove-Analog | Connect to STM32F030F4P6(12bit ADC |
and then transfer to I2C signal, | |
route to Pi directly | |
Grove-I2C, Grove-PWM | Connect to Raspberry Pi directly |
and RPISER |
- Inheritance
-
- Object
- IsolateAPI
- GroveBaseHat
Constructors
- GroveBaseHat.new([int i2cBus = 1])
- GroveBaseHat.isolate(I2C i2c)
Properties
Methods
-
changeI2Caddress(
int newI2Caddress) → void - Changes the I2C address of the hat. NOT TESTED!
-
fromJson(
String json) → IsolateAPI -
override
-
getFirmware(
) → int - Returns the firmware version.
-
getGrovePowerSupplyVoltage(
) → int - Returns the supply voltage.
-
getHandle(
) → int -
override
-
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 aGrove 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!
-
setHandle(
int handle) → void -
override
-
toJson(
) → String -
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited