void setup() {
// put your setup code here, to run once:
#define fadeTime 3
Serial.begin(115200);
}
float bright;
long x;
long brightness (long x) {
long v;
bright =(x* 255)/(fadeTime* 1000);
v = (long) bright;
Serial.print ("v value is ");
Serial.print (v) ;
Serial.print('\n');
return v;
}
void loop() {
// put your main code here, to run repeatedly:
x+=1;
Serial.println (x);
brightness(x*20);
delay(500);
}