Library for interfacing to Nokia 5110 LCD display (as found on the SparkFun website).
Diff: Bitmap.cpp
- Revision:
- 41:6c046786be6c
- Parent:
- 40:c9262294f2e1
- Child:
- 42:596c207519de
diff -r c9262294f2e1 -r 6c046786be6c Bitmap.cpp --- a/Bitmap.cpp Wed Mar 08 15:48:48 2017 +0000 +++ b/Bitmap.cpp Wed Mar 08 16:13:08 2017 +0000 @@ -13,10 +13,10 @@ _width(width) { // Perform a quick sanity check of the dimensions - if (_contents.size() != height * height) { + if (_contents.size() != height * width) { std::cerr << "Contents of bitmap has size " << _contents.size() << " pixels, but its dimensions were specified as " - << width << " * " << height << " = " << width * height; + << width << " * " << height << " = " << width * height << std::endl; } for(unsigned int i = 0; i < height*width; ++i) _contents[i] = contents[i]; @@ -33,7 +33,7 @@ { std::cerr << "The requested pixel with index " << row << "," << column << "is outside the bitmap dimensions: " << _width << "," - << _height; + << _height << std::endl; } // Now return the pixel value, using row-major indexing