/* digout Controls the PWM signal for a fan by reading in a voltage across a potentiometer Liam Maskey Fab Academy 2017 */ int sensorValue =255; int sensorPin = 7; // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin 8 as an output. pinMode(8, OUTPUT); } // the loop function runs over and over again forever void loop() { sensorValue = (analogRead(sensorPin) >>2); /*discard bottom two bits of ADC */ analogWrite(8,sensorValue); }