C Program RGB led lighting
- if (mode == 1) {
- if (rv == 0 && bv == 0 && gv ==0){
- for (rv == 0; rv <= 254; rv++){
- analogWrite(rp, rv);
- delay(timing);
- }
- }
- }
- if (mode == 1) {
- if (rv == 255 && bv == 0 && gv ==0){
- for (bv == 0; bv <= 254; bv++){
- analogWrite(bp, bv);
- delay(timing);
- }
- }
- }
- if (mode == 1) {
- if (rv == 255 && bv == 255 && gv ==0){
- for (rv == 255; rv >= 1; rv--){
- analogWrite(rp, rv);
- delay(timing);
- }
- }
- }
- if (mode == 1) {
- if (rv == 0 && bv == 255 && gv ==0){
- for (gv == 0; gv <= 254; gv++){
- analogWrite(gp, gv);
- delay(timing);
- }
- }
- }
- if (mode == 1) {
- if (rv == 0 && bv == 255 && gv ==255){
- for (bv == 255; bv >= 1; bv--){
- analogWrite(bp, bv);
- delay(timing);
- }
- }
- }
- if (mode == 1) {
- if (rv == 0 && bv == 0 && gv ==255){
- for (rv == 0; rv <=254; rv++){
- analogWrite(rp, rv);
- delay(timing);
- }
- }
- }
- if (mode == 1) {
- if (rv == 255 && bv == 0 && gv ==255){
- for (bv == 0; bv <=254; bv++){
- analogWrite(bp, bv);
- delay(timing);
- }
- }
- }
- if (mode == 1) {
- if (rv == 255 && bv == 255 && gv ==255){
- for (bv == 255; bv >= 1; bv--){
- rv--;
- gv--;
- analogWrite(rp, rv);
- analogWrite(bp, bv);
- analogWrite(gp, gv);
- delay(timing);
- }
- }
- }