/usr/share/fritzing/sketches/core/Fritzing Creator Kit DE+EN/creator-kit-en/Fritzing Creator Kit/Exercise6_1/Exercise6_1.ino is in fritzing-data 0.9.2b+dfsg-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | /*
Fading
fading two LEDs slowly on and off
This example is part of the Fritzing Creator Kit: www.fritzing.org/creator-kit.
*/
int led1Pin = 9; // led1Pin is declared
int led2Pin = 10; // led2Pin is declared
void setup(){
// no need to declare the analog output in the setup
}
void loop(){
for(int fadeValue = 0; fadeValue <= 255; fadeValue += 5) { // fadeValue is counted up in steps of five
analogWrite(led1Pin, fadeValue); // and sent to the led as an analog value
analogWrite(led2Pin, 255-fadeValue); // 255-fadeValue produces the opposite fading behavior
delay(2); // short stop
}
for(int fadeValue = 255; fadeValue >= 0; fadeValue -= 5) { // fadeValue is counted down in steps of five
analogWrite(led1Pin, fadeValue); // and sent to the led as an analog value
analogWrite(led2Pin, 255-fadeValue); // 255-fadeValue produces the opposite fading behavior
delay(2); // short stop
}
}
|