Skip to content

Reads proximity sensor value. With DV Run Time output, sends values to MPLAB® Data Visualizer via DVRT 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/avr128db48-i2c-proximity-sensor-callbacks-dvrt

Repository files navigation

Microchip Technologies Inc.

AVR128DB48 I2C_Host Example Component for CNano Explorer: I2C Proximity Sensor (Callbacks, DVRT)

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 DV Run Time (DVRT) visualization.

alt text

This example demonstrates how to read the value of the VCNL4200 proximity sensor on the Curiosity Nano Explorer, with the DV Run Time Visualization Output selected. Every 100 ms, an LED and a Debug I/O pin are toggled. Depending on the DVRT streaming tick setting (default is 100 ms), the appropriately formatted values of the variables added to the DVRT Streaming Table are sent to the MPLAB® Data Visualizer.

Operation

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:

When running the application, using the MPLAB Data Visualizer, you should see something similar to the following: alt text

Setup

The following outlines the complete MPLAB Code Configuration (MCC) Melody configuration, including all the selected tasks implemented in this example.

The following is the required MCC Melody configuration: alt text

alt text

MCC Melody Example Components

Example Components integrate learning material directly into the MCC. This allows the 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 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 CM_icon to verify the MCC Core and MCC Melody Core versions.

alt text

Hardware Used

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •