Browse Source

Update 'Teensy4.1_Datalogger new.ino'

master
Julian Graf 1 year ago
parent
commit
0b00b4d39b
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      Teensy4.1_Datalogger new.ino

+ 4
- 1
Teensy4.1_Datalogger new.ino View File

float wind_summ = 0; float wind_summ = 0;
int values[60]; int values[60];
int saved_minutes = 0; int saved_minutes = 0;
int saved_seconds = 0;


public: public:
void measure() { void measure() {
wind_sec = map(analogRead(Windfahne), 0, 1023, 20, 350); wind_sec = map(analogRead(Windfahne), 0, 1023, 20, 350);
digitalWrite(power_Windfahne, LOW); digitalWrite(power_Windfahne, LOW);
wind_summ += wind_sec; wind_summ += wind_sec;
saved_seconds++;
} }
void calculate() { void calculate() {
values[saved_minutes] = wind_summ;
values[saved_minutes] = wind_summ / saved_seconds;
wind_summ = 0; wind_summ = 0;
saved_minutes++; saved_minutes++;
saved_seconds = 0;
} }
void file_print() { void file_print() {
for (int i = 0; i < saved_minutes; i++) { for (int i = 0; i < saved_minutes; i++) {

Loading…
Cancel
Save