You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
457 B
Arduino
28 lines
457 B
Arduino
2 years ago
|
void GPIO_setup(){
|
||
2 years ago
|
for (int i = 0; i < Size_DI; i++) {
|
||
|
pinMode(DiPin[i], INPUT);
|
||
|
}
|
||
|
for (int i = 0; i < Size_DO; i++) {
|
||
|
pinMode(DoPin[i], OUTPUT);
|
||
|
}
|
||
2 years ago
|
|
||
|
analogReference(EXTERNAL);
|
||
2 years ago
|
}
|
||
|
|
||
2 years ago
|
void read_analog(){
|
||
2 years ago
|
int i = 0;
|
||
|
|
||
2 years ago
|
for(i = 0 ; i < Size_AI ; i++){
|
||
2 years ago
|
Values_AI[i] = analogRead(AiPin[i]);
|
||
2 years ago
|
}
|
||
2 years ago
|
}
|
||
|
|
||
|
void read_digital(){
|
||
|
int i = 0;
|
||
|
|
||
|
Values_DI = 0;
|
||
|
for(i = 0 ; i < Size_DI ; i++){
|
||
|
bitWrite(Values_DI, i, digitalRead(DiPin[i]));
|
||
|
}
|
||
|
}
|