From e691958829e9d791f899d9a2961b16b41ba9beba Mon Sep 17 00:00:00 2001 From: JasonHomeWorkstationUbuntu Date: Thu, 29 Oct 2020 23:06:13 +1100 Subject: [PATCH] Moved source code to subdirectory --- src/home_server_pwm.ino | 16 --------------- src/home_server_pwm/home_server_pwm.ino | 27 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 16 deletions(-) delete mode 100644 src/home_server_pwm.ino create mode 100644 src/home_server_pwm/home_server_pwm.ino diff --git a/src/home_server_pwm.ino b/src/home_server_pwm.ino deleted file mode 100644 index fe6ffb4..0000000 --- a/src/home_server_pwm.ino +++ /dev/null @@ -1,16 +0,0 @@ -int pwm_fan = 6; -void setup() { - //Declaring LED pin as output - pinMode(pwm_fan, OUTPUT); -} -void loop() { - //Fading the LED - for(int i=0; i<255; i++){ - analogWrite(pwm_fan, i); - delay(5); - } - for(int i=255; i>0; i--){ - analogWrite(pwm_fan, i); - delay(5); - } -} diff --git a/src/home_server_pwm/home_server_pwm.ino b/src/home_server_pwm/home_server_pwm.ino new file mode 100644 index 0000000..066850e --- /dev/null +++ b/src/home_server_pwm/home_server_pwm.ino @@ -0,0 +1,27 @@ +int pwmFanPin = 6; +int tempSensorPin = 2; + +float sensorValue; + +void setup() { + //Declaring LED pin as output + pinMode(pwmFanPin, OUTPUT); + pinMode(tempSensorPin, INPUT); + Serial.begin(9600); +} +void loop() { + // Read temperature + sensorValue= analogRead(tempSensorPin); + vol + Serial.print( + + //Fading the LED + for(int i=0; i<255; i++){ + analogWrite(pwmFanPin, i); + delay(5); + } + for(int i=255; i>0; i--){ + analogWrite(pwmFanPin, i); + delay(5); + } +}