Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
DigitalSensor.h
Go to the documentation of this file.
1#ifndef RENNSSELAERMOTORSPORT_DIGITALSENSOR_H
2#define RENNSSELAERMOTORSPORT_DIGITALSENSOR_H
3
4#include "Sensor.h"
5#include "../Utils/Constants.h"
6
7#include <stdint.h>
8
9typedef struct {
11 int port;
12 void* child; // Pointer to the child struct
14
16
26void initDigitalSensor(DigitalSensor* digitalsensor, const char* name, int hz,
27 int port, void* child);
28
35int getDigitalSensorReading(DigitalSensor* digitalsensor);
36#endif // RENNSSELAERMOTORSPORT_DIGITALSENSOR_H
#define NUM_DIGITAL_INPUTS
Definition: Constants.h:14
uint8_t digital_in_buffer[NUM_DIGITAL_INPUTS]
Definition: main.c:119
int getDigitalSensorReading(DigitalSensor *digitalsensor)
Gets the reading from the digital sensor.
Definition: DigitalSensor.c:10
void initDigitalSensor(DigitalSensor *digitalsensor, const char *name, int hz, int port, void *child)
Initializes a digital sensor with the given parameters.
Definition: DigitalSensor.c:3
Definition: Sensor.h:14