AVR128DB48 I2C_Host Example Component for CNano Explorer: I2C Proximity Sensor (Callbacks, Data Streamer)
The I2C Proximity Sensor example, of the MCC Melody I2C Example Component (for the Curiosity Nano Explorer), is used here in the Polled implementation with the Data Streamer visualization.
This example demonstrates how to read the value of the VCNL4200 proximity sensor on the Curiosity Nano Explorer, with the Data Streamer Visualization Output selected. Every 100 ms, an LED and a Debug I/O pin are toggled. A Timer overflow callback is used to send a Data Streamer frame every 100 ms.
In the MCC Melody Data Streamer library configuration, the appropriately typed variables are added to the Data Streamer table.
The below image of the MPLAB Data Visualizer shows the application running, where proximityValue and framecount have been added to the DVRT Streaming Table and Time Plot:
Note: An individual Data Streamer Frame is highlighted in red at the bottom of the image in the hex terminal output. The frame can be identified by the StartByte of 0x03 and the EndByte of 0xFC.
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)