Skip to content

Commit

Permalink
arduino-pulsoxy: Use setup() and loop() functions
Browse files Browse the repository at this point in the history
Split the main() function into setup() and loop() for classical
Arduino feeling. Arduino will provide a main() that calls those.

Signed-off-by: Stefan Nuernberger <[email protected]>
  • Loading branch information
seihan authored and snue committed Mar 14, 2020
1 parent 7d27f53 commit 36ef3f7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Source_codes/SPO2/arduino-pulsoxy/arduino-pulsoxy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ volatile uint8_t calculateSPO2 = 0; //Variable is set to 1 when the buff

uint8_t SPO2 = 0; //Variable for the calculated SpO2-value

int main(void)
void setup()
{
cli(); //Disable all Interrupts

Expand All @@ -61,9 +61,9 @@ int main(void)
init_AGC(GainDelay_p); //Initializes the Auto Gain Control

DDRD |= (1 << PD2); //PIN PD2 Output This Pin is set to HIGH if the LED Brightness is getting adjusted
while (1)
{
}

void loop() {
FingerDetection = FingerIn_Out(); //Testing if the finger is in the Fingerclip or not

if (FingerDetection==0) //If no finger was detected, the measurement is reset
Expand Down Expand Up @@ -130,9 +130,6 @@ int main(void)
}

}


}
}


Expand Down Expand Up @@ -162,4 +159,3 @@ ISR(TIMER2_COMPA_vect)
}
}
}

0 comments on commit 36ef3f7

Please sign in to comment.