Library for drawing on the Hexiwear's OLED - more features being actively worked on

Dependents:   Hexidraw_Demo Hexiwear-FinalProject_v2

Discussion: https://developer.mbed.org/forum/team-4615-Hexiwear-community/topic/26595/

Hexidraw is a library for drawing on the Hexiwear's OLED. Be aware that it is not very optimized, so drawing may be slow, especially when drawing on large areas of the screen.

Please see the wiki for API documentation.

Features:

  • Screen fill with a color
  • Drawing filled rectangles
  • Drawing circles with a set radius and line width
  • Setting individual pixels
  • Turning on and off the OLED's sleep mode
  • Drawing images

Example project: https://developer.mbed.org/users/keithm01/code/Hexidraw_Demo/

Revision:
3:e8bbba5c43ba
Parent:
2:ef14c6dd6b93
Child:
4:9c0b59439725
--- a/hexidraw.cpp	Fri Aug 19 22:12:11 2016 +0000
+++ b/hexidraw.cpp	Fri Aug 19 22:24:54 2016 +0000
@@ -242,12 +242,12 @@
 void OLED::image (uint16_t x, uint16_t y, const uint8_t* image, uint32_t image_data_size)
 {
 //    cursor(x, y);
-
+    
     writeCommand(OLED_CMD_WRITERAM);
     _dc = 1;
     _cs = 0;
 
-    const uint8_t* buffer = image;
+    const uint8_t* buffer = OLED_SKIP_IMAGE_HEADER(image);
 
     for ( uint32_t i = 0; i < image_data_size; i++) {
         _spi.write(*buffer);