Skip to content

//code.Node outputs

Control the output devices on a //code.Node using specialized blocks provided in the Code tool.

Speaker

Two blocks are available to control the speaker on a //code.Node. One block sets the speaker frequency and the other simply turns it on when true or off when false. You can also turn off the speaker by setting the frequency to 0.

LED array

Three blocks are available to set the brightness of each LED in the //code.Node LED array. Set the brightness of each LED on a scale from 0 to 10. Select the LED in the array by its x and y coordinate. The top left of the array is defined as the origin (0,0). The x coordinate corresponds to the horizontal direction and the y coordinate corresponds to the vertical direction.

The following block sets the brightness of a single LED on the array.

The next block sets the brightness of a group of LEDs. Define the coordinate of each LED by two consecutive numbers, where the first number is the x coordinate and the second number is the y coordinate. Separate each LED listed by a space. In the following example, we form a diagonal line in the center of the array from the top left to bottom right.

The third block sets each LED by selecting a box. This example draws a happy face.

RGB LED

Control the color of the //code.Node RGB LED by setting the brightness of the red R, green G, and blue B LEDs.