The sample is not supported in standard 32 Kbytes flash memory modules. To run this sample you need a S2B module with 128 KBytes of flash memory.
In this post we will show how to control a Graphic LCD display using a Programmable Digi XBee module from Digi International. Digi International delivers a SDK for the Programmable Digi XBee for free, you can download it here.
One of the samples Digi delivers in the SDK is the Graphic display example. This example draws different shapes in any graphic display based on the ST7565R chip. Depending on the button pressed from the Digi XBee Interface Board, the display will generate a circle or a rectangle.
You should connect the graphic display to the SPI interface of the Digi XBee module.
Take a look to the “config.xml” file of the sample application to see how each pin of Programmable XBee is configured:
In following schematic you can see each of the connections:
Here's a photo of the sample running:
The Programmable XBee SDK offers following API to control the graphics LCD display:
void lcd_graphic_cmd_write (uint8_t cmd)
Sends the given command to the LCD.
void lcd_graphic_data_write (uint8_t data)
Sends a byte of data to be written in the LCD.
void lcd_graphic_goto_xy (uint8_t x, uint8_t y)
Sets the pointer of the LCD at the specified coordinates.
void lcd_graphic_init (void)
Initializes graphic display with default params.
void lcd_graphic_set_clear_screen (uint8_t data)
Fills all the display with the specified byte mask.
void lcd_graphic_write_box (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, bool_t color)
Draws a filled rectangle in the LCD defined by two points.
void lcd_graphic_write_circle (uint8_t x0, uint8_t y0, uint8_t r, bool_t color)
Draws a circle in the LCD defined by its center point and the radius.
void lcd_graphic_write_line (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, bool_t color)
Draws a line in the LCD defined by two points.
void lcd_graphic_write_pixel (uint8_t x, uint8_t y, bool_t color)
Draws a pixel in the LCD given position (point).
void lcd_graphic_write_rectangle (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, bool_t color)
Draws a rectangle in the LCD defined by two points.
void lcd_graphic_write_text (uint8_t x0, uint8_t y0, uint8_t *textplot, bool_t color)
Writes the given text in the graphic display.
void lcd_graphic_write_tile (uint8_t x, uint8_t y, uint8_t *buf)
Writes a tile (square of 8x8 pixels/bits) at the given point.
The Programmable XBee SDK has plenty of examples and APIs to access to the module interfaces. We will show you more in posts to come.