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 Callbacks 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 callbacks implementation uses the Timer driver. To handle the change from 100 to 1000 ms, the timer period is changed and a new timer callback is used. 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, you should see something similar to the following:
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 v5.6.2 or newer (Tools>Plugins>Installed, search: "MCC")
-
MPLAB® Data Visualizer Plug-in v1.4.1926 or newer (Tools>Plugins>Installed, search: "Data Visualizer")
-
MCC Melody I2C_Host Example Component for the Curiosity Nano Explorer v1.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.
- PIC18F57Q43 Curiosity Nano (DM164150)
- Curiosity Nano Explorer (EV58G97A)