It's just a loaded program as a graphic demonstration of the 5110 library, the clock at the end is driven by a simple routine I wrote for the demo - it generates a random hour, minute, and second, then it's driven by timer interrupts at one second intervals. I have also had it running using the same hardware from a DS3231 I2C clock module - a similar one second interrupt, but generated by the DS3231, was used to update the clock display.
This is the sine wave part:
Code:
Nokia_ClrScr();
Nokia_DrawRect(0, 0, 83, 47);
Nokia_DrawLine(0, 23, 84, 23);
Nokia_DrawLine(41, 0, 41, 47);
for (c = 0; c < 4; c++) {
for (i = 0; i < 84; i++) {
y = i * 0.017453292519943295769236907684886;
Nokia_InvPixel(i, (sin(y * 6)*20) + 23);
Nokia_Update();
Delay_ms(20);
}
}
I know it's in C, but it's simple to understand - the first four lines clear the screen, and draw the background.
'for (c=' runs the routine four times, and 'for (i+' draws the 84 dots across the screen.
InvPixel inverts a pixel in the buffer (you can't do it on the screen, as it's read only), Update transfers the buffer to the screen.
I've no idea what the scaling value 0.017453292519943295769236907684886 is all about?, it was in the routine when I downloaded the Arduino version.