Djsarkar
Member level 3
Hi,
I am looking help to understand following code because I do not understand programming for Arduino
**broken link removed**
I have PIC18F45K80. I am using MPLABX 5.40 and XC8 2.30.
There are two Reverse for loop in code
What's the meaning of following two line in code?
analogWrite (11, val);
analogWrite (10, 255 - val);
I am looking help to understand following code because I do not understand programming for Arduino
**broken link removed**
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 Reverse for loop in code
What's the meaning of following two line in code?
analogWrite (11, val);
analogWrite (10, 255 - val);