-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsensors.c
30 lines (23 loc) · 846 Bytes
/
sensors.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Author: Ahmed Sobhy
// Date: 02/08/2018
// Project: UNB SAE EV
// Sensors API
#include <stdbool.h>
#include <stdint.h>
#include "adc_api.h"
/******************************************************************************
Description: contains APIs that interface with several sensors and returns
their readings. Readings are stored into a 32-bits array with their location
from 0 to 3 as follows:
Sensor 1: Analog 0-5V Throttle Sensor connected to PE3 on AIN0 working
Sensor 2: Analog 0-5V Break Pressure Sensor connected to PE1 on AIN2 not working
Sensor 3: Analog 0-5V Steering Sensor connected to PD1 on AIN6 working
******************************************************************************/
void ThrottleSensorInit(void)
{
ADCTimerTriggeredInit();
}
uint32_t ThrottleSensorGetValue(void)
{
return ADCGetSensor2();
}