     ST();
   }
 
+  analogWrite(pinLed, ledShift + ledAmp * cos(2 * PI / ledPeriod * (millis() - fadeStart)));
+
   delay(50);
 
 }

#define pinIG2 7
#define pinST2 8

// Slow down the automatic calibration cooldown
#define offset 2 // <= 6



bool pressed = false;
unsigned long touchStart = 0;

byte ledAmp = 0;
byte ledShift = 0;
int ledPeriod = 2000;
unsigned long fadeStart = 0;

void setup() {

