j5.backends.console.sr.v4.ruggeduino module

Console Backend for the SR v4 Ruggeduino.

class j5.backends.console.sr.v4.ruggeduino.SRV4RuggeduinoConsoleBackend(serial: str, console_class: Type[j5.backends.console.console.Console] = <class 'j5.backends.console.console.Console'>)[source]

Bases: j5.components.string_command.StringCommandComponentInterface, j5.backends.console.j5.arduino.ArduinoConsoleBackend

Console Backend for the SR v4 Ruggeduino.

board

alias of j5.boards.sr.v4.ruggeduino.Ruggeduino

classmethod discover() → Set[j5.boards.board.Board][source]

Discover boards that this backend can control.

Returns:set of boards that this backend can control.
execute_string_command(command: str) → str[source]

Execute the string command and return the result.

This function can be synchronous and blocking.

Parameters:command – command to send.
Returns:result from the command.
get_gpio_pin_digital_state(identifier: int) → bool

Get the last written state of a given GPIO pin.

Parameters:identifier – pin number
Returns:Last known digital state of the pin.
Raises:ValueError – pin is not in correct mode.
get_gpio_pin_mode(identifier: int) → j5.components.gpio_pin.GPIOPinMode

Get the hardware mode of a GPIO pin.

Parameters:identifier – pin number.
Returns:mode of the pin.
get_led_state(identifier: int) → bool

Get the state of an LED.

Parameters:identifier – LED identifier.
Returns:current state of the LED.
Raises:ValueError – invalid LED identifier.
read_gpio_pin_analogue_value(identifier: int) → float

Read the scaled analogue value of a given GPIO pin.

Parameters:identifier – pin number
Returns:scaled analogue value of the pin.
Raises:ValueError – pin is not in correct mode.
read_gpio_pin_digital_state(identifier: int) → bool

Read the digital state of a given GPIO pin.

Parameters:identifier – pin number
Returns:digital state of the pin.
Raises:ValueError – pin is not in correct mode.
set_gpio_pin_mode(identifier: int, pin_mode: j5.components.gpio_pin.GPIOPinMode) → None

Set the hardware mode of a GPIO pin.

Parameters:
  • identifier – pin number to set.
  • pin_mode – mode to set the pin to.
set_led_state(identifier: int, state: bool) → None

Set the state of an LED.

Parameters:
  • identifier – LED identifier.
  • state – desired state of the LED.
Raises:

ValueError – invalid LED identifier.

write_gpio_pin_dac_value(identifier: int, scaled_value: float) → None

Write a scaled analogue value to the DAC on a given GPIO pin.

Parameters:
  • identifier – pin number
  • scaled_value – scaled analogue value to write
Raises:

NotImplementedError – Arduino Uno does not have a DAC.

write_gpio_pin_digital_state(identifier: int, state: bool) → None

Write to the digital state of a GPIO pin.

Parameters:
  • identifier – pin number
  • state – desired digital state.
Raises:

ValueError – pin is not in correct mode.

write_gpio_pin_pwm_value(identifier: int, duty_cycle: float) → None

Write a scaled analogue value to the PWM on a given GPIO pin.

Parameters:
  • identifier – pin number
  • duty_cycle – duty cycle to write
Raises:

NotImplementedError – Not implemented in any supported firmware yet.