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
C++
28 lines
457 B
C++
void GPIO_setup(){
|
|
for (int i = 0; i < Size_DI; i++) {
|
|
pinMode(DiPin[i], INPUT);
|
|
}
|
|
for (int i = 0; i < Size_DO; i++) {
|
|
pinMode(DoPin[i], OUTPUT);
|
|
}
|
|
|
|
analogReference(EXTERNAL);
|
|
}
|
|
|
|
void read_analog(){
|
|
int i = 0;
|
|
|
|
for(i = 0 ; i < Size_AI ; i++){
|
|
Values_AI[i] = analogRead(AiPin[i]);
|
|
}
|
|
}
|
|
|
|
void read_digital(){
|
|
int i = 0;
|
|
|
|
Values_DI = 0;
|
|
for(i = 0 ; i < Size_DI ; i++){
|
|
bitWrite(Values_DI, i, digitalRead(DiPin[i]));
|
|
}
|
|
}
|