/tessel-nokia5110

Tessel library for interacting with the Nokia 5110 Graphic LCD

Primary LanguageJavaScript

Nokia 5110 Graphic LCD

A simple Tessel library for interacting with the Nokia 5110 display.

Connection Information

The module uses the double-wide proto-module and can be installed on either side of the Tessel. It occupies two ports but only uses one of them (A or D).

Hardware

The module uses the Nokia 5110 display which can be easily acquired online. A few options are:

For connection information I followed the wiring guide from Sparkfun.

Installation

npm install tessel-nokia5110

Example

var tessel = require('tessel');

// Screen is connected to port D
var nokia5110 = require('tessel-nokia5110').use(tessel.port['D']);

nokia5110.on('ready', function(){
	nokia5110.clear(function(){
		nokia5110.string("Hello Tessel!");
	});
});

Event

Nokia5110.on('ready', callback(err, screen)) - Emitted when the screen object is first initialized

Methods

Nokia5110.gotoXY(x,y,[callback(err)]) - Sets the active cursor location to (x,y)

Nokia5110.character(char, [callback(err)]) - Writes a single character to the display

Nokia5110.string(data, [callback(err)]) - Writes a string to the display

Nokia5110.bitmap(bitmapData, [callback(err)]) - Draws a monochrome bitmap from bitmapData

Nokia5110.clear([callback(err)]) - Clears the display

Nokia5110.setBacklight(state) - Turns the backlight on if state is truthy, off otherwise

Further Examples

  • Bitmap Display. Demonstrates how to display a monochrome bitmap on the lcd.

Licensing

Apache 2.0