Skip to content

Reads proximity sensor value. With Data Streamer output, sends values to MPLAB® Data Visualizer via protocol every 100 ms. Uses Timer driver callbacks for sampling frequency.

License

Notifications You must be signed in to change notification settings

microchip-pic-avr-examples/pic18f57q43-i2c-proximity-sensor-callbacks-data-streamer

Repository files navigation

Microchip Technologies Inc.

PIC18F57Q43 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 Callbacks implementation, with the Data Streamer visualization.

alt text

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.

alt text

The below image of the MPLAB Data Visualizer shows the application running, where the variable configured in the Data Streamer Table have been imported as a Variable Streamer in the MPLAB® Data Visualizer, via a generated .ds (data streamer file). alt text

The following is a block diagram view of the application, as seen in the MCC Melody Builder.

Data Streamer configuration showing Data Streamer Table and UART pins

MCC Melody Example Components

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.

Related Documentation

Software Used

  • MPLAB® X IDE 6.25 or newer

  • MPLAB® XC8 3.00 or newer

  • MPLAB® Code Configurator (MCC) Plug-in Version 5.6.2 or newer (Tools>Plugins>Installed, search: "MCC")

  • MPLAB® Data Visualizer Plug-in Version 1.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 5.8.2 or newer

  • SPA Host 1.0.0 or newer

  • MCC Melody Core 2.9.1 or newer

Open the MCC Content Manager CM_icon to verify the MCC Core and MCC Melody Core versions.

alt text

Hardware Used

Setup

The following outlines the complete MCC Melody configuration, including all the selected tasks that have been implemented in this example.

alt text

Data Visualizer Setup

To run the example, follow the steps in the Data Visualizer Setup section:

Data Visualizer Setup

Summary

For more example components, follow these steps:

  1. Open the stand-alone Content Manager CM_icon in MPLAB X IDE.
  2. Filter on Melody content.
  3. Filter on MCU device (optional, leave blank to find all).
  4. Expand Examples category under Content Libraries.

Standalone_CM

About

Reads proximity sensor value. With Data Streamer output, sends values to MPLAB® Data Visualizer via protocol every 100 ms. Uses Timer driver callbacks for sampling frequency.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •