cckiu8
This commit is contained in:
43
firmwareCarroEsp32/src/carroEsp32.h
Normal file
43
firmwareCarroEsp32/src/carroEsp32.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#ifndef CARROESP32_h
|
||||
#define CARROESP32_h
|
||||
#define OUT1 A13
|
||||
#define OUT2 A16
|
||||
#define OUT3 A15
|
||||
#define OUT4 A10
|
||||
#define OUT5 A14
|
||||
|
||||
int sensores[5] = {0, 0, 0, 0, 0};
|
||||
|
||||
void readSensors()
|
||||
{
|
||||
sensores[0] = analogRead(OUT1);
|
||||
sensores[1] = analogRead(OUT2);
|
||||
sensores[2] = analogRead(OUT3);
|
||||
sensores[3] = analogRead(OUT4);
|
||||
sensores[4] = analogRead(OUT5);
|
||||
}
|
||||
|
||||
void printSensores()
|
||||
{
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
Serial.print(sensores[i]);
|
||||
Serial.print(',');
|
||||
}
|
||||
Serial.println();
|
||||
}
|
||||
|
||||
void init_sensores(){
|
||||
pinMode(OUT1, INPUT);
|
||||
pinMode(OUT2, INPUT);
|
||||
pinMode(OUT3, INPUT);
|
||||
pinMode(OUT4, INPUT);
|
||||
pinMode(OUT5, INPUT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# endif
|
||||
Reference in New Issue
Block a user