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

Gives control of the built-in LED (D8) on GPIO5. 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

Gives control of the built-in LED (D8) on GPIO5.

Use the class object to control the built-in LED (D8) on GPIO5. When call it sets up the GPIO5 as an OUTPUT and set the drive strength to 12mA. The class will allow you to turn the LED on/off/toggle.

Note
This pin can also be set up as a PWM pin. If you wish to use GPIO again you must call Led() again.
mcu.led.on()
mcu.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:
  • phyduino.py