Arduino Function: PPI.setCompReference

Name

setCompReference

Description

This function selects an analog reference used when the event is related to the comparator.




Syntax

PPI.setCompReference(reference);

Parameters

reference: reference voltage
- Values:
AREF
REF_VDD_1_8
REF_VDD_1_4
REF_VDD_3_8
REF_VDD_1_2
REF_VDD_5_8
REF_VDD_3_4
REF_VDD_7_8
REF_VDD_1_16
REF_VDD_3_16
REF_VDD_5_16
REF_VDD_7_16
REF_VDD_9_16
REF_VDD_11_16
REF_VDD_13_16
REF_VDD_15_16




Returns

none 

Examples

/*
 LowPowerBlink.ino

 Written by Chiara Ruggeri (chiara@arduino.org)

 This example for the Arduino Primo board shows how to use PPI library.
 With this library is possible to bind an action to a particular event. In this way, when an event occurs, the related peripheral can take the  specified action without the MCU intervention.
 For a complete list of all events and actions that is possible to use, please refer to the library documentation. 

 This example code is in the public domain.
*/

#include <PPI.h>
#include <LowPower.h>

void setup() {
 //bind a timer event to the toggle of the pin
 //set an interval for the timer (in milliseconds)
 PPI.setTimerInterval(1000);
 //select the output pin
 PPI.setOutputPin(13);
 //bind TIMER event to PIN_TOGGLE action
 PPI.setShortcut(TIMER, PIN_TOGGLE);
 //put the board in standby mode to save power
 //use constant latency to have a constant response from PPI action
 LowPower.standby(0, NULL, CONST_LATENCY);
}
void loop() {}

Written by arduino.org