Compare commits
2 Commits
dba521933e
...
a58d77de9e
Author | SHA1 | Date | |
---|---|---|---|
a58d77de9e | |||
e691958829 |
@ -5,4 +5,5 @@ This is a repository that containing arduino code to program arduino uno for pwm
|
|||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
* [Arduino Tutorial Foundations: PWM](https://www.arduino.cc/en/Tutorial/Foundations/PWM)
|
* [Arduino Tutorial Foundations: PWM](https://www.arduino.cc/en/Tutorial/Foundations/PWM)
|
||||||
* [Arduino PWM Tutorial](https://create.arduino.cc/projecthub/muhammad-aqib/arduino-pwm-tutorial-ae9d71)
|
* [Arduino PWM Tutorial](https://create.arduino.cc/projecthub/muhammad-aqib/arduino-pwm-tutorial-ae9d71)
|
||||||
|
* [9 Arduino Compatible Temperature Sensors for Your Electronics Projects](https://randomnerdtutorials.com/9-arduino-compatible-temperature-sensors-for-your-electronics-projects/)
|
||||||
|
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
27
src/home_server_pwm/home_server_pwm.ino
Normal file
27
src/home_server_pwm/home_server_pwm.ino
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user