Hi,
I am looking help to understand following code because I do not understand programming for Arduino
https://tkkrlab.nl/wiki/Arduino_KY-029_Yin_Yi_2-color_LED_module_3MM
I have PIC18F45K80. I am using MPLABX 5.40 and XC8 2.30
There are two for loop in code. I do not understand What's happening inside For loop for Two color LED's?
Thanks for any help
I am looking help to understand following code because I do not understand programming for Arduino
https://tkkrlab.nl/wiki/Arduino_KY-029_Yin_Yi_2-color_LED_module_3MM
I have PIC18F45K80. I am using MPLABX 5.40 and XC8 2.30
Code:
// Arduino test code:
int redpin = 11; // select the pin for the red LED
int bluepin = 10; // select the pin for the blueLED
int val;
void setup () {
pinMode (redpin, OUTPUT);
pinMode (bluepin, OUTPUT);
Serial.begin (9600);
}
void loop () {
for(val=255;val>0;val--) {
analogWrite (11, val);
analogWrite (10, 255 - val);
delay(5);
}
for(val=255;val<255;val++) {
analogWrite (11, val);
analogWrite (10, 255 - val);
delay(5);
}
}
There are two for loop in code. I do not understand What's happening inside For loop for Two color LED's?
Thanks for any help