0% found this document useful (0 votes)
126 views1 page

Rangefinder C

This document defines code for a range finder that includes header files for the framework and service. It checks for range events by reading the ADC value of the range finder, and if it is above a low bound threshold, it posts a range event to the scene state machine and returns true.

Uploaded by

api-340729449
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views1 page

Rangefinder C

This document defines code for a range finder that includes header files for the framework and service. It checks for range events by reading the ADC value of the range finder, and if it is above a low bound threshold, it posts a range event to the scene state machine and returns true.

Uploaded by

api-340729449
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 1

/* RangeFinder.

c -- This file defines Some Range Finder stuff and range finder
events.
History
When
Who
-------------- --11/14/16 03:25 mep

What/Why
-------Created

*/
/*
*****************************************************************************/
/*----------------------------- Include Files -----------------------------*/
/* include header files for the framework and this service
*/
#include
#include
#include
#include

"ES_Configure.h"
"ES_Framework.h"
"ES_DeferRecall.h"
"ES_ShortTimer.h"

#include
#include
#include
#include
#include
#include
#include
#include
#include

"inc/hw_memmap.h"
"inc/hw_types.h"
"inc/hw_gpio.h"
"inc/hw_sysctl.h"
"driverlib/sysctl.h"
"driverlib/pin_map.h"
"driverlib/gpio.h"
"driverlib/timer.h"
"driverlib/interrupt.h"

// Define PART_TM4C123GH6PM in project

#include "BITDEFS.h"
#include "SceneSM.h"
#include "ADMulti.h"

bool CheckRangeEvents(void){
//Takes no EventParameters, returns true if an event was posted (11/4/11 jec)
bool ReturnVal = false;
ES_Event RangeEvent;
uint32_t LowBound=1500;
uint32_t ADC[2];
//puts("here");
ADC_MultiRead(ADC); //gets value of rangefinder
if(ADC[1] > LowBound){ //if the state of the plant input line is>100
printf("RANGE %u",ADC[1]);
RangeEvent.EventType=ES_WELCOME;
PostSceneSM(RangeEvent);// with EventParameter of the Current
Time //Where too?
ReturnVal = true;
}
return ReturnVal;
}

You might also like