PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Examples
Badge
01 Display
02 Screen Character Sizes.c
1
/*
2
Screen Character Sizes.c
3
Use text_size function to switch from default LARGE characters to
4
small ones. LARGE fits 8x2, SMALL fits 16x8.
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
(
"BIG TEXT"
);
// First message
14
text_size
(
SMALL
);
// Enter small text mode
15
cursor
(0, 5);
// Cursor to 5th small row
16
oledprint
(
" Small Text.\n"
);
// Display some small text
17
oledprint
(
"More small text!"
);
// Note \n newline works
18
pause
(3000);
// Delay 2 seconds
19
text_size
(
LARGE
);
// Re-enter large text mode
20
cursor
(0, 1);
// to sedon
21
oledprint
(
" "
);
// Clear line 2
22
cursor
(2, 1);
// Cursor near bottom-center
23
oledprint
(
"DONE"
);
// Last message
24
}
25
26
LARGE
#define LARGE
For setting oLED character size to 32x16 pixels. Example: text_size(LARGE).
Definition:
badgetools.h:192
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.
text_size
void text_size(int size)
Set the text size to either 32x16 pixel (LARGE) or 7x5 (SMALL) characters. Examples: text_size(LARGE)...
Definition:
oled_text_size.c:7
SMALL
#define SMALL
For setting oLED character size to 7x5 pixels. Example: text_size(SMALL).
Definition:
badgetools.h:200
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17