Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int rLed = 11;
- int gLed = 10;
- int bLed = 9;
- int wLed = 6;
- void setup() {
- // put your setup code here, to run once:
- pinMode(rLed, OUTPUT);
- pinMode(gLed, OUTPUT);
- pinMode(bLed, OUTPUT);
- pinMode(wLed, OUTPUT);
- }
- void loop() {
- // put your main code here, to run repeatedly:
- //red led Fade
- for(int i = 0; i < 256; i++){
- analogWrite(rLed, i);
- delay(10);
- }
- for(int i = 255; i > 0; i--){
- analogWrite(rLed, i);
- delay(10);
- }
- //green led fade
- for(int i = 0; i < 256; i++){
- analogWrite(gLed, i);
- delay(10);
- }
- for(int i = 255; i > 0; i--){
- analogWrite(gLed, i);
- delay(10);
- }
- for(int i = 0; i < 256; i++){
- analogWrite(bLed, i);
- delay(10);
- }
- for(int i = 255; i > 0; i--){
- analogWrite(bLed, i);
- delay(10);
- }
- for(int i = 0; i < 256; i++){
- analogWrite(wLed, i);
- delay(10);
- }
- for(int i = 255; i > 0; i--){
- analogWrite(wLed, i);
- delay(10);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement