hw_led_add
Simulation Instrument Studio 1
Overloads
hw_led_add()

Home›All functions›Hardware
Simulation Instrument Studio 1
How to wire a board and load a sketch is on the hardware setup page. These are the calls.
Simulation Instrument Studio 1
hw_led_add()

Simulation Instrument Studio 1
hw_led_set(hw_led_id, brightness)
A hardware pin call. It talks to a board on USB serial or TCP 4731.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | hw_led_id | String | The is the reference to the LED output. You can get this reference from the hw_led_add function. |
| 2 | brightness | Number/Bool | The initial state of the LED. Ranges from 1.0 or true (full brightness) to 0.0 or false (off). |
-- Pin on the board at 4731
id = hw_led_set(0)

Simulation Instrument Studio 1
hw_dial_add()

Simulation Instrument Studio 1
hw_dial_set_acceleration(hw_dial_id, acceleration)
A hardware pin call. It talks to a board on USB serial or TCP 4731.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | hw_dial_id | id | The is the reference to the rotary encoder. You can get this reference from the hw_dial_add function. |
| 2 | acceleration | Number | A multiplier that will make the dial generate extra callbacks when the dial is being rotated faster. The multiplier is the maximum number of callbacks of one dial tick when this dial is being rotated at maximum speed. |
-- Pin on the board at 4731
id = hw_dial_set_acceleration(0)

Simulation Instrument Studio 1
hw_input_add()

Simulation Instrument Studio 1
hw_input_read(hw_input_id)
A hardware pin call. It talks to a board on USB serial or TCP 4731.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | hw_input_id | String | The is the reference to the input. You can get this reference from the hw_input_add function. |
-- Pin on the board at 4731
id = hw_input_read(0)

Simulation Instrument Studio 1
hw_output_add()

Simulation Instrument Studio 1
hw_output_set(hw_output_id, state)
A hardware pin call. It talks to a board on USB serial or TCP 4731.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | hw_output_id | String | The is the reference to the output. You can get this reference from the hw_output_add function. |
| 2 | state | Boolean | The state to set the output. When true, the pin will be driven high, otherwise low. |
-- Pin on the board at 4731
id = hw_output_set(0)

Simulation Instrument Studio 1
hw_adc_input_add()

Simulation Instrument Studio 1
hw_adc_input_read(hw_adc_input_id)
A hardware pin call. It talks to a board on USB serial or TCP 4731.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | hw_adc_input_id | String | The is the reference to the ADC input. You can get this reference from the hw_adc_input_add function. |
-- Pin on the board at 4731
id = hw_adc_input_read(0)

Simulation Instrument Studio 1
hw_dac_output_add()

Simulation Instrument Studio 1
hw_dac_output_set(hw_dac_output_id, value)
A hardware pin call. It talks to a board on USB serial or TCP 4731.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | hw_dac_output_id | String | The is the reference to the DAC output. You can get this reference from the hw_dac_output_add function. |
| 2 | value | Number | The state to set the output. Ranges from 0.0 (GND) to 1.0 (VCC) |
-- Pin on the board at 4731
id = hw_dac_output_set(0)

Simulation Instrument Studio 1
hw_output_pwm_add()

Simulation Instrument Studio 1
hw_output_pwm_duty_cycle(hw_output_pwm_id, duty_cycle)
A hardware pin call. It talks to a board on USB serial or TCP 4731.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | hw_output_pwm_id | String | The is the reference to the PWM output. You can get this reference from the hw_output_pwm_add function. |
| 2 | duty_cycle | Number | The new PWM duty cycle. Range 0.0 - 1.0, 0.0 being off, and 1.0 on. |
-- Pin on the board at 4731
id = hw_output_pwm_duty_cycle(0)

Simulation Instrument Studio 1
hw_chr_display_add()

Simulation Instrument Studio 1
hw_chr_display_set_text(hw_chr_display_id, text)
hw_chr_display_set_text(hw_chr_display_id, line, text)
hw_chr_display_set_text(hw_chr_display_id, display, line, text)
A hardware pin call. It talks to a board on USB serial or TCP 4731.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | hw_chr_display_id | Object | This is the reference to the character display output. You can get this reference from the hw_chr_display_add function. |
| 2 | display | Number | (Optional) The display where you wish to show the text. This only works with character display types that can be daisy chained. First display is 0. |
| 3 | line | Number | (Optional) The line where you wish to put the text. First line is 0. |
| 4 | text | String | The text. |
-- Pin on the board at 4731
id = hw_chr_display_set_text(0)

Simulation Instrument Studio 1
hw_chr_display_set_brightness(hw_chr_display_id, brightness)
hw_chr_display_set_brightness(hw_chr_display_id, display, brightness)
A hardware pin call. It talks to a board on USB serial or TCP 4731.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | hw_chr_display_id | Object | This is the reference to the character display output. You can get this reference from the hw_chr_display_add function. |
| 2 | display | Number | (Optional) The display where you wish to put the text. This only works with character display types that can be daisy chained. First display is 0. |
| 3 | brightness | Number | The brightness. Ranges from 0.0 (Off) to 1.0 (Full brightness). |
-- Pin on the board at 4731
id = hw_chr_display_set_brightness(0)

Simulation Instrument Studio 1
hw_button_array_add()

Simulation Instrument Studio 1
hw_stepper_motor_add()

Simulation Instrument Studio 1
hw_stepper_motor_calibrate()

Simulation Instrument Studio 1
hw_stepper_motor_position(hw_stepper_motor_id, position)
hw_stepper_motor_position(hw_stepper_motor_id, position, direction)
A hardware pin call. It talks to a board on USB serial or TCP 4731.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | hw_stepper_motor_id | Object | The is the reference to the stepper motor. You can get this reference from the hw_stepper_motor_add function. |
| 2 | position | Number | The desired position, ranging from 0.0 to 1.0. |
| 3 | direction | String | (Optional) The desired direction. Can be 'SLOWEST', 'FASTEST', 'CLOCKWISE', 'COUNTERCLOCKWISE', 'ENDLESS_CLOCKWISE', 'ENDLESS_COUNTERCLOCKWISE' or 'STOP' (from AM/). Defaults to 'FASTEST'. |
-- Pin on the board at 4731
id = hw_stepper_motor_position(0)

Simulation Instrument Studio 1
hw_stepper_motor_speed(hw_stepper_motor_id, speed_rpm)
A hardware pin call. It talks to a board on USB serial or TCP 4731.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | hw_stepper_motor_id | Object | The is the reference to the stepper motor. You can get this reference from the hw_stepper_motor_add function. |
| 2 | speed | rpm | The desired speed in rounds per minute (rpm). |
-- Pin on the board at 4731
id = hw_stepper_motor_speed(0)

Simulation Instrument Studio 1
hw_message_port_add()

Simulation Instrument Studio 1
hw_message_port_send(hw_message_port_id, message_id, payload_type, payload)
A hardware pin call. It talks to a board on USB serial or TCP 4731.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | hw_message_port_id | String | The is the reference to the Message port. You can get this reference from the hw_message_port_add function. |
| 2 | message_id | Integer | The message identifier, this can be an integer ranging from 0 to 65535 (16 bit unsigned int). |
| 3 | payload_type | String | Payload type. Can be 'INT', 'FLOAT, 'BYTE' or 'STRING'. |
| 4 | payload | Object | Send additional values with your message. Max 16 values when using INT or FLOAT. Max 64 bytes with using BYE and max 64 characters when using STRING. |
-- Pin on the board at 4731
id = hw_message_port_send(0)

Simulation Instrument Studio 1
hw_connected(hw_node_id)
hw_connected(hw_id)
A hardware pin call. It talks to a board on USB serial or TCP 4731.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | hw_node_id / hw_id | Hardware node / String | Can be a hw_node_id, which is a reference to a certain hardware node. It is received from the hw_button_add, hw_switch_add, hw_dial_add etc. functions. Alternatively, it can also be a hardware id Hardware ID list. |
-- Pin on the board at 4731
id = hw_connected(0)
