Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <wiringPi.h>
- #include <softPwm.h>
- #define RANGE 100
- #define RED_PIN 1
- #define GREEN_PIN 4
- #define BLUE_PIN 5
- #define RED_VALUE 50
- #define GREEN_VALUE 255
- #define BLUE_VALUE 50
- int main ()
- {
- wiringPiSetup();
- softPwmCreate(RED_PIN, 0, RANGE);
- softPwmCreate(GREEN_PIN, 0, RANGE);
- softPwmCreate(BLUE_PIN, 0, RANGE);
- for(;;)
- {
- softPwmWrite(RED_PIN, (RED_VALUE*100)/255 );
- softPwmWrite(GREEN_PIN, (GREEN_VALUE*100)/255 );
- softPwmWrite(BLUE_PIN, (BLUE_VALUE*100)/255 );
- delay(10);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement