Advertisement
remcoder

display photo on Sparkfun ColorLCD Shield / Nokia 6100

May 24th, 2013
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <gLCD.h>
  2.  
  3. // pin numbers for the LCD shield
  4. const char RST = 8;
  5. const char CS = 9;
  6. const char Clk = 13;
  7. const char Data = 11;
  8.  
  9. // insert photo data here
  10. // note that if you don't have the RAM, you'll need to store it in ROM
  11. // byte photo[] = { .. }
  12.  
  13. gLCD graphic(RST,CS,Clk,Data,HIGH_SPEED);
  14.  
  15. void setup() {
  16.   graphic.begin(0,0,0,PHILLIPS_1);
  17.   graphic.Window(0,0,127,127);
  18.  
  19.   for(int i=0 ; i<(sizeof photo) ; i+=3) // send 3 bytes in 1 call, will draw 2 pixels
  20.     graphic.twoPixels(photo[i], photo[i+1], photo[i+2]);
  21. }
  22.  
  23. void loop() {
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement