RaspiGpio class
Properties
hashCode
→ int
The hash code for this object.
no setter inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
Methods
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString ()
→ String
A string representation of this object.
inherited
Static Methods
controlMotor ({required int in1Pin , required int in2Pin , required int enPin , required int speed , required bool direction })
→ Future <void >
Control a motor
in1Pin
is the GPIO pin number for IN1
in2Pin
is the GPIO pin number for IN2
enPin
is the GPIO pin number for EN (PWM)
speed
is the PWM value (0-100)
direction
is true for forward, false for backward
initialize ()
→ Future <void >
Initialize the GPIO pins
listenToButton (int pin )
→ Stream <bool >
Listen to button press events
pin
is the GPIO pin number
Returns a Stream of button states (true for pressed, false for released)
setLedState (int pin , bool state )
→ Future <void >
Set the state of an LED
pin
is the GPIO pin number
state
is true for ON, false for OFF