We could put several of the drawPixel() function calls together to draw a line, but it would be a lot easier to use the drawLine() function as shown in the following code:
// draw a line display.drawLine(3,3,30,30, BLACK); display.display();
The drawLine() function takes five parameters. The first two parameters are the X/Y coordinates of the starting point for the line. The next two parameters are the X/Y coordinates for the ending point of the line, and the final parameter is the color to draw the line. Since the Nokia 5110 LCD is a monochrome display, the only options here are BLACK or WHITE.
If we ran this code, we would see a line on the display like the one seen in the following photograph: