PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Examples
Badge
01 Display
03 Screen Numbers.c
1
/*
2
Screen Numbers.c
3
Use formatting flags to make oledprint display values. %d, %f, %x, %b
4
are supported. Leading zero and space padding are also supported.
5
*/
6
7
#include "
simpletools.h
"
// Include simpletools library
8
#include "
badgetools.h
"
// Include badgetools library
9
10
void
main
()
// Main function
11
{
12
badge_setup
();
// Call badge setup
13
oledprint
(
"SECONDS"
);
// Heading
14
for
(
int
i = 1; i <= 10; i++)
// Count 1 to 10
15
{
16
cursor
(3, 1);
// Cursor -> col 3, row 1
17
oledprint
(
"%02d"
, i);
// Display 2-digit integer value
18
pause
(1000);
// Pause 1 second
19
}
20
clear
();
// Clear the screen
21
oledprint
(
" All Done!"
);
// Display done
22
}
23
24
clear
int clear(void)
Clear the display.
Definition:
oled_clear.c:7
pause
void pause(int time)
Delay cog from moving on to the next statement for a certain length of time.
Definition:
libws2812.c:125
cursor
void cursor(int col, int row)
Position the cursor to a certain column and row for printing text on the oLED display....
Definition:
oled_cursor.c:7
simpletools.h
This library provides convenient functions for a variety of microcontroller I/O, timing,...
main
int main(void)
Definition:
GraphicsTest.c:20
oledprint
int oledprint(const char *fmt,...)
Use to display strings on the oLED display in a manner similar to displaying combinations of strings ...
Definition:
peb_text.c:4
badge_setup
int badge_setup(void)
Set up all available badge drivers. Call this function at the start of any given program to allow acc...
Definition:
badgealpha.c:29
badgetools.h
This library provides convenient functions for a variety of Parallax eBadge operations.
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17