blob: 08ba1dd85afdfb0bbba731047abd1148d0805e13 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
int pin=6; // Pin to which you connect the gate (G) of the MOSFET.
void setup() {
// put your setup code here, to run once:
pinMode(pin,OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
analogWrite(pin, 250); // High Intensity
delay(5000);
analogWrite(pin, 100); // Medium intensity
delay(5000);
analogWrite(pin, 50); // Low intensity
delay(5000);
}
|