Skip to content

Class Instantiation

Arnd edited this page Jan 31, 2021 · 1 revision

smoothLED();

The smoothLED class instantiation has no parameters, the LED isn't initialized until the begin() method is called. One instance of the class is declared for each LED, as many as there are pins on the Arduino.


Example:

...    
...    
smoothLED Board;  // Instantiate on-board LED  
...    
...    
Serial.print(F("BOARD LED: "));
if (Board.begin(LED_BUILTIN)) // Start the "Board" instance on pin 13
  Serial.println(F("OK"));
else
  Serial.println(F("ERROR!"));
Board.set(128); // set to 50% duty cycle
...    
...    
Clone this wiki locally