Scroller based on gfxLcd library. See: http://dl.dropbox.com/u/9496739/scroller.m4v Link to the image: http://dl.dropbox.com/u/9496739/file.bmp
main.cpp@0:dbd2fddd0a95, 2011-03-03 (annotated)
- Committer:
- HBP
- Date:
- Thu Mar 03 00:29:11 2011 +0000
- Revision:
- 0:dbd2fddd0a95
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
HBP | 0:dbd2fddd0a95 | 1 | #include "mbed.h" |
HBP | 0:dbd2fddd0a95 | 2 | #include "lcd.h" |
HBP | 0:dbd2fddd0a95 | 3 | #include "bitmap.h" |
HBP | 0:dbd2fddd0a95 | 4 | |
HBP | 0:dbd2fddd0a95 | 5 | LocalFileSystem local("local"); |
HBP | 0:dbd2fddd0a95 | 6 | |
HBP | 0:dbd2fddd0a95 | 7 | int main() { |
HBP | 0:dbd2fddd0a95 | 8 | gfxLcd *glcd = new gfxLcd(); |
HBP | 0:dbd2fddd0a95 | 9 | |
HBP | 0:dbd2fddd0a95 | 10 | bitmapImage *bitmap = new bitmapImage("/local/file.bmp"); |
HBP | 0:dbd2fddd0a95 | 11 | |
HBP | 0:dbd2fddd0a95 | 12 | // Nice scroller |
HBP | 0:dbd2fddd0a95 | 13 | while(1) |
HBP | 0:dbd2fddd0a95 | 14 | { |
HBP | 0:dbd2fddd0a95 | 15 | for(uint32_t i=160; i+bitmap->fileInfo.cols > 0; i--) |
HBP | 0:dbd2fddd0a95 | 16 | { |
HBP | 0:dbd2fddd0a95 | 17 | bitmap->drawImage(glcd, i, 0); |
HBP | 0:dbd2fddd0a95 | 18 | glcd->update(); |
HBP | 0:dbd2fddd0a95 | 19 | } |
HBP | 0:dbd2fddd0a95 | 20 | } |
HBP | 0:dbd2fddd0a95 | 21 | |
HBP | 0:dbd2fddd0a95 | 22 | delete bitmap; |
HBP | 0:dbd2fddd0a95 | 23 | } |