-
code
01/16/2016 at 14:52 • 0 commentsint wwhite = 0; int cwhite = 1; int ain = A1; void setup() { pinMode(cwhite, OUTPUT); pinMode(wwhite, OUTPUT); pinMode(ain, INPUT); } void loop() { int val = analogRead(ain); val = map(val, 0, 1023, 0, 255); analogWrite(wwhite, val); analogWrite(cwhite, 255-val); }