The I2C Host IO Expander 1 - LEDs Example, of the MCC Melody I2C Example Component (for the Curiosity Nano Explorer), is used here in the Polled implementation, with the Printf visualization.
The example implements an LED chaser, incrementing the binary number on the lower six LEDs every 100 ms. Once the six active-low LEDs are all on, the pattern changes to toggle all eight LEDs every second.
The polled implementation simply uses a delay, first of 100 ms then the delay period is changed to 1s once the LED chaser is finished. The hex and binary values of the I/O expander pins are displayed as a printf message over the Universal Asynchronous Receiver and Transmitter (UART).
When running the application using the MPLAB® Data Visualizer, something similar to the following should display:
Note: the delta 103 ms in the B and the 1.21 s in the C columns, respectively of the time plot. The difference from 100 ms, is simply due to the positioning of the cursor.
The image below outlines the complete MPLAB Code Configurator (MCC) Melody configuration, including all the selected tasks implemented in this example, as seen in the MCC Melody Builder.
Example Components are a tight integration of learning material directly into MCC. This allows users to conveniently place the configuration instructions side-by-side to the components they are configuring. For more information, refer to the MCC Melody Example Components introduction.
-
MPLAB® X IDE v6.25 or newer
-
MPLAB® XC8 v3.00 or newer
-
MPLAB® Code Configurator (MCC) Plug-in Version v5.6.2 or newer (Tools>Plugins>Installed, search: "MCC")
-
MPLAB® Data Visualizer Plug-in Version v1.4.1926 or newer (Tools>Plugins>Installed, search: "Data Visualizer")
-
MCC Melody I2C_Host Example Component for the Curiosity Nano Explorer 1.0.0 or newer
-
MCC Core v5.8.2 or newer
-
Single Page Application (SPA) Host v1.0.0 or newer
-
MCC Melody Core v2.9.1 or newer
Open the MCC Content Manager to verify the MCC Core and MCC Melody Core versions.
- AVR128DB48 Curiosity Nano (EV35L43A)
- Curiosity Nano Explorer (EV58G97A)