Loading...
Searching...
No Matches
Led Class Reference

One of the shield's LEDs, D1 (green) or D2 (red). More...

Public Member Functions

 on (self)
 Turns the LED on.
 off (self)
 Turns the LED off.
 toggle (self)
 Turns the LED on if it is off, and off if it is on.
 value (self, level=None)
 Reads or sets the LED.

Detailed Description

One of the shield's LEDs, D1 (green) or D2 (red).

Each LED runs from VIO through 1 kOhm to its pin, so the pin turns it on by pulling low. on() and off() hide that: on() drives the pin low. The pin is set up the first time the LED is used, starting with the LED off.

Note
After phyduino's pwm() on the same pin, on() and off() no longer change the LED. Call mcu.pin(name, "out") to free the pin.
shield.green_led.on()
shield.red_led.toggle()

Member Function Documentation

◆ value()

value ( self,
level = None )

Reads or sets the LED.

Parameters
levelNone to read; 1 (on) or 0 (off) to set.
Returns
1 (on) or 0 (off) when reading; None when setting.

The documentation for this class was generated from the following file:
  • analog_shield.py