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.

33 lines
578 B
Arduino

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]);
for(int j = 0; j < 9; j++) {
Recent_AI[i][j] = Recent_AI[i][j + 1];
}
Recent_AI[i][9] = Values_AI[i];
}
}
void read_digital(){
int i = 0;
Values_DI = 0;
for(i = 0 ; i < Size_DI ; i++){
bitWrite(Values_DI, i, digitalRead(DiPin[i]));
}
}