Raspberry
Functions
Has Gpio
Checks if the system has GPIO capabilities.
Return Type: Boolean
Signatures:
bool has_gpio()public static bool Raspberry.HasGpio();public static bool SplashKit.HasGpio();def has_gpio():function HasGpio(): BooleanRaspi Cleanup
This function should be called when you are finished using the GPIO library. It sets all pin modes to INPUT and values to LOW.
Signatures:
void raspi_cleanup()public static void Raspberry.RaspiCleanup();public static void SplashKit.RaspiCleanup();def raspi_cleanup():procedure RaspiCleanup()Raspi Get Mode
This function retrieves the mode of the specified pin.
Parameters:
| Name | Type | Description |
|---|---|---|
| pin | Pins | The pin to get the mode for. |
Return Type: Pin Modes
Signatures:
pin_modes raspi_get_mode(pins pin)public static PinModes Raspberry.RaspiGetMode(Pins pin);public static PinModes SplashKit.RaspiGetMode(Pins pin);def raspi_get_mode(pin):function RaspiGetMode(pin: Pins): PinModesRaspi Init
This function initializes the GPIO library for use. It should be called before any other GPIO functions.
Signatures:
void raspi_init()public static void Raspberry.RaspiInit();public static void SplashKit.RaspiInit();def raspi_init():procedure RaspiInit()Raspi Read
This function reads the value from the specified pin.
Parameters:
| Name | Type | Description |
|---|---|---|
| pin | Pins | The pin to read the value from. |
Return Type: Pin Values
Signatures:
pin_values raspi_read(pins pin)public static PinValues Raspberry.RaspiRead(Pins pin);public static PinValues SplashKit.RaspiRead(Pins pin);def raspi_read(pin):function RaspiRead(pin: Pins): PinValuesRaspi Set Mode
This function sets the mode of the specified pin to the specified mode.
Parameters:
| Name | Type | Description |
|---|---|---|
| pin | Pins | The pin to set the mode for. |
| mode | Pin Modes | The mode to set for the pin. |
Signatures:
void raspi_set_mode(pins pin, pin_modes mode)public static void Raspberry.RaspiSetMode(Pins pin, PinModes mode);public static void SplashKit.RaspiSetMode(Pins pin, PinModes mode);def raspi_set_mode(pin, mode):procedure RaspiSetMode(pin: Pins; mode: PinModes)Raspi Set Pull Up Down
This function sets the pull-up/down mode for the specified pin.
Parameters:
| Name | Type | Description |
|---|---|---|
| pin | Pins | The pin to set the pull up/down mode for. |
| pud | Pull Up Down | The pull up/down mode to set for the pin. |
Signatures:
void raspi_set_pull_up_down(pins pin, pull_up_down pud)public static void Raspberry.RaspiSetPullUpDown(Pins pin, PullUpDown pud);public static void SplashKit.RaspiSetPullUpDown(Pins pin, PullUpDown pud);def raspi_set_pull_up_down(pin, pud):procedure RaspiSetPullUpDown(pin: Pins; pud: PullUpDown)Raspi Set Pwm Dutycycle
This function sets the PWM duty cycle for the specified pin.
Parameters:
| Name | Type | Description |
|---|---|---|
| pin | Pins | The pin to set the PWM duty cycle for. |
| dutycycle | Integer | The PWM duty cycle to set for the pin. |
Signatures:
void raspi_set_pwm_dutycycle(pins pin, int dutycycle)public static void Raspberry.RaspiSetPwmDutycycle(Pins pin, int dutycycle);public static void SplashKit.RaspiSetPwmDutycycle(Pins pin, int dutycycle);def raspi_set_pwm_dutycycle(pin, dutycycle):procedure RaspiSetPwmDutycycle(pin: Pins; dutycycle: Integer)Raspi Set Pwm Frequency
This function sets the PWM frequency for the specified pin.
Parameters:
| Name | Type | Description |
|---|---|---|
| pin | Pins | The pin to set the PWM frequency for. |
| frequency | Integer | The PWM frequency to set for the pin. |
Signatures:
void raspi_set_pwm_frequency(pins pin, int frequency)public static void Raspberry.RaspiSetPwmFrequency(Pins pin, int frequency);public static void SplashKit.RaspiSetPwmFrequency(Pins pin, int frequency);def raspi_set_pwm_frequency(pin, frequency):procedure RaspiSetPwmFrequency(pin: Pins; frequency: Integer)Raspi Set Pwm Range
This function sets the PWM range for the specified pin.
Parameters:
| Name | Type | Description |
|---|---|---|
| pin | Pins | The pin to set the PWM range for. |
| range | Integer | The PWM range to set for the pin. |
Signatures:
void raspi_set_pwm_range(pins pin, int range)public static void Raspberry.RaspiSetPwmRange(Pins pin, int range);public static void SplashKit.RaspiSetPwmRange(Pins pin, int range);def raspi_set_pwm_range(pin, range):procedure RaspiSetPwmRange(pin: Pins; range: Integer)Raspi Write
This function writes the specified value to the specified pin.
Parameters:
| Name | Type | Description |
|---|---|---|
| pin | Pins | The pin to write the value to. |
| value | Pin Values | The value to write to the pin. |
Signatures:
void raspi_write(pins pin, pin_values value)public static void Raspberry.RaspiWrite(Pins pin, PinValues value);public static void SplashKit.RaspiWrite(Pins pin, PinValues value);def raspi_write(pin, value):procedure RaspiWrite(pin: Pins; value: PinValues)