This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.

Class

LED

Name

brightness()

Examples
import processing.io.*;
LED greenLed;
boolean ledOn = false;

void setup() {
  // the green LED is led0 on the Raspberry Pi
  greenLed = new LED("led0");
  frameRate(0.5);
}

void draw() {
  ledOn = !ledOn;
  if (ledOn) {
  	greenLed.brightness(1.0);
  } else {
  	greenLed.brightness(0.0);
  }
}

Description Sets the brightness
Syntax
.brightness(bright)
Parameters
bright float: 0.0 (off) to 1.0 (maximum)
Returnsvoid
Updated on October 2, 2018 05:02:13pm EDT

Creative Commons License