Advertisement
Guest User

Untitled

a guest
May 18th, 2013
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <wiringPi.h>
  2. #include <softPwm.h>
  3.  
  4. #define RANGE 100
  5. #define RED_PIN 1
  6. #define GREEN_PIN 4
  7. #define BLUE_PIN 5
  8.  
  9. #define RED_VALUE 50
  10. #define GREEN_VALUE 255
  11. #define BLUE_VALUE 50
  12.  
  13. int main ()
  14. {
  15. wiringPiSetup();
  16. softPwmCreate(RED_PIN, 0, RANGE);
  17. softPwmCreate(GREEN_PIN, 0, RANGE);
  18. softPwmCreate(BLUE_PIN, 0, RANGE);
  19. for(;;)
  20. {
  21. softPwmWrite(RED_PIN, (RED_VALUE*100)/255 );
  22. softPwmWrite(GREEN_PIN, (GREEN_VALUE*100)/255 );
  23. softPwmWrite(BLUE_PIN, (BLUE_VALUE*100)/255 );
  24. delay(10);
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement