Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: N5110/N5110.cpp
- Revision:
- 6:a0f3dbbc8d33
- Parent:
- 0:fd8eda608206
--- a/N5110/N5110.cpp Wed May 08 21:01:54 2019 +0000 +++ b/N5110/N5110.cpp Wed May 08 23:42:32 2019 +0000 @@ -431,4 +431,26 @@ drawLine(x0,y,x0+(width-1),y,type); // draw line across screen } } +} + +void N5110::drawSprite(int x0, + int y0, + int nrows, + int ncols, + int *sprite) +{ + for (int i = 0; i < nrows; i++) { + for (int j = 0 ; j < ncols ; j++) { + + int pixel = *((sprite+i*ncols)+j); + + if (pixel) { + setPixel(x0+j,y0+i); + } + else { + clearPixel(x0+j,y0+i); + } + + } + } } \ No newline at end of file