RdiaIncVal Macro

Microchip Graphics Library

Microchip Graphics Library
RdiaIncVal Macro
C
#define RdiaIncVal(pDia) RdiaSetVal(pDia, (pDia->val + pDia->res))
Overview

Used to directly increment the value. The delta change used is the resolution setting (res).

Input Parameters
Input Parameters 
Description 
pDia 
Pointer to the object. 
Returns

none

Preconditions

none

Side Effects

none

Example
WORD updatedVal, prevVal;
ROUNDDIAL *pDia;

    // assuming pDia is initialized to an existing dial Object
    // assume GetInput() is a function that retrieves source data
    prevVal = RdiaGetVal(pDia);
    updatedVal = GetInput();
    if (updatedVal > prevVal)
        RdiaIncVal(pDia);
    if (updatedVal < prevVal)
        RdiaDecVal(pDia);
Microchip Graphics Library Version 3.06.02 - October 15, 2012
Copyright © 2012 Microchip Technology, Inc.  All rights reserved