BO.io.LED Class
Creates an interface to an LED. This object provides helpful methods for blinking and fading LEDs. To use the fading methods, the LED must be connected to a PWM pin on the I/O board.
PLEASE NOTE: To use the fade methods, or to use an waveform other
than Oscillator.SQUARE the LED must be connected to a PWM pin.
SOURCE_DRIVE vs SYNC_DRIVE. If the Anode (longer LED pin) is
connected to the microcontroller pin, then it is SOURCE_DRIVE. If the
Cathode is connected to the microcontroller pin, then it is
SYNC_DRIVE.
Constructor
BO.io.LED
    
        - 
                    
                        board
- 
                    
                        ledPin
- 
                    
                        driveMode
Parameters:
- 
                    
                        boardIOBoardA reference to the IOBoard the LED is attached to. 
- 
                    
                        ledPinPinA reference to the Pin the LED is connected to. 
- 
                    
                        driveModeNumberThe drive mode of the LED. Must be set to LED.SOURCE_MODEorLED.SYNC_MODE.SOURCE_MODEis default.
Item Index
Properties
- intensity
- LED.SOURCE_DRIVE static
- LED.SYNC_DRIVE static
Methods
blink
    
        - 
                    
                        interval
- 
                    
                        times
- 
                    
                        wave
Parameters:
- 
                    
                        intervalNumberThe time interval to blink the LED. 
- 
                    
                        timesNumberThe number of times the LED should blink. A value of 0 will blink forever. 
- 
                    
                        waveFunctionThe waveform to apply (default is Oscillator.SQUARE) 
fadeIn
    
        - 
                    
                        time
The LED must be connected to a PWM pin to use this method.
Parameters:
- 
                    
                        timeNumberThe fade-in time (in milliseconds). 
fadeOut
    
        - 
                    
                        time
The LED must be connected to a PWM pin to use this method.
Parameters:
- 
                    
                        timeNumberThe fade-out time (in milliseconds). 
fadeTo
    
        - 
                    
                        to
- 
                    
                        time
The LED must be connected to a PWM pin to use this method.
Parameters:
- 
                    
                        toNumberThe new intensity value to fade to. 
- 
                    
                        timeNumberThe fade time (in milliseconds). 
isOn
    
        ()
    
    
        
            Boolean
        
    
    
    
    
    
    
    
    
    Check if the LED is on.
Returns:
True if the LED is on, false if it is off.
off
    
        ()
    
    
    
    
    
    
    
    
    
    Turn the LED off.
on
    
        ()
    
    
    
    
    
    
    
    
    
    Turn the LED on.
stopBlinking
    
        ()
    
    
    
    
    
    
    
    
    
    Stop the LED blink cycle.
toggle
    
        ()
    
    
    
    
    
    
    
    
    
    Toggle the LED on or off.
Properties
intensity
    Number
    
    
    
    
    
    Get or set the current value (intensity) of the LED.
