class
#include <pros/adi.hpp>
Led
Constructors, destructors, conversion operators
- Led(std::uint8_t adi_port, std::uint32_t length) explicit
- Configures an ADI port to act as a LED.
-
Led(ext_
adi_ port_ pair_ t port_pair, std::uint32_t length) explicit - Configures an ADI port on a adi_expander to act as a LED.
Public functions
- std::int32_t clear_all()
- Operator overload to access the buffer in the ADILed class, it is recommended that you call .update(); after doing any operations with this.
- std::int32_t clear()
- std::int32_t update() const
- Force the LED strip to update with the current buffered values, this should be called after any changes to the buffer using the [] operator.
- std::int32_t set_all(uint32_t color)
- Set the entire led strip to one color.
- std::int32_t set_pixel(uint32_t color, uint32_t pixel_position)
- Set one pixel on the led strip.
- std::int32_t clear_pixel(uint32_t pixel_position)
- Clear one pixel on the led strip.
- std::int32_t length()
- Get the length of the led strip.
-
ext_
adi_ port_ tuple_ t get_port() const - Gets the port of the sensor.
Function documentation
ext_ adi_ port_ tuple_ t pros:: adi:: Led:: get_port() const
Gets the port of the sensor.
Returns | returns a tuple of integer ports. |
---|
Example
#define DIGITAL_SENSOR_PORT 1 // 'A' void initialize() { pros::adi::AnalogIn sensor (DIGITAL_SENSOR_PORT); // Getting values from the tuple using std::get<index> int sensorSmartPort = std::get<0>(sensor.get_port()); // First value int sensorAdiPort = std::get<1>(sensor.get_port()); // Second value // Prints the first and second value from the port tuple (The Adi Port. The first value is the Smart Port) printf("Sensor Smart Port: %d\n", sensorSmartPort); printf("Sensor Adi Port: %d\n", sensorAdiPort); }