#include "math.h"
/////////////////////////////
#define LED_STATUE 5
#define LED_HEART 6
#define BASE_VALUE_PWM 10*(255/100)
#define FIRST_PEAK 40*(255/100) //relative: %
#define MAIN_PEAK 100*(255/100) //relative: %
#define SECOND_PEAK 50*(255/100) //relative: %
#define FULLTIME_FIRST 180
#define FULLTIME_MAIN 200
#define FULLTIME_SECOND 0
#define FULLTIME_MAIN_2 4
#define SUSPEND_MAIN_PEAK 300
#define PAUSE 1000
#define MODE 1
#define PI 3.141592
#define SW_FREQ_HB 2
#define SW_HB_BRIGHT_P 3
#define SW_HB_BRIGHT_M 4
#define SW_STATUE_BRIGHT_P 7
#define SW_STATUE_BRIGHT_M 8
/////////////////////////////
#define DEBUG
/////////////////////////////
int value;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);
pinMode(SW_FREQ_HB, INPUT_PULLUP);
pinMode(SW_HB_BRIGHT_P, INPUT_PULLUP);
pinMode(SW_HB_BRIGHT_M, INPUT_PULLUP);
pinMode(SW_STATUE_BRIGHT_P, INPUT_PULLUP);
pinMode(SW_STATUE_BRIGHT_M, INPUT_PULLUP);
}
int LedBuiltIn;
char inChar;
int r;
#define MAX_TS 5
#define TEMP_0 500
int TimeStamp[MAX_TS];
/////////////////////////////
bool ButtonActive() {
if (digitalRead(2)==LOW)
return true;
else
return false;
}
/////////////////////////////
void MyDelay(int time){
for (int i=0;i<time;i++) {
if (!ButtonActive()) {
delay(1);
} else {
while (ButtonActive());
}
}
}
//digitalWrite(LED_BUILTIN, LedBuiltIn);
void loop() {
digitalWrite(6, HIGH);
MyDelay(500);
digitalWrite(6, LOW);
MyDelay(500);
}