PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Examples
Badge
01 Display
05 Display Upside Down.c
1
/*
2
Display Upside Down.c
3
Rotating the display 180-degrees can be convenient when holding the
4
badge upside down. Note that auto-update is turned off to allow the
5
message to be started right-side up first, then rotated. After those
6
two steps, it's ready and made visible with screen_update.
7
*/
8
9
#include "
simpletools.h
"
// Include simpletools library
10
#include "
badgetools.h
"
// Include badgetools library
11
12
void
main
()
// Main function
13
{
14
badge_setup
();
// Call badge setup
15
oledprint
(
"right- side up"
);
// Up message
16
pause
(2000);
// Wait 2 s
17
clear
();
// Clear the screen
18
screen_auto
(
OFF
);
// Turn off auto-update
19
oledprint
(
"upside down"
);
// Display new message
20
rotate180
();
// Rotate the image
21
screen_update
();
// Make it visible
22
pause
(2000);
// Wait 2 s
23
clear
();
// Back to right-side up
24
screen_auto
(
ON
);
// Resume auto-update
25
oledprint
(
"right- side up"
);
// Last message
26
}
27
28
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
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
rotate180
void rotate180()
Rotate the screen image 180 degrees. See 05 Display Upside- Down.side for example.
Definition:
peb_image180.c:6
screen_auto
void screen_auto(int state)
Cause function calls like oledprint, point, and others to appear immediately after the function is ca...
Definition:
oled_auto.c:7
badgetools.h
This library provides convenient functions for a variety of Parallax eBadge operations.
screen_update
int screen_update(void)
Manually update the screen image after. Typically used after multiple oLED function calls after scree...
Definition:
oled_asmfast.c:426
OFF
#define OFF
OFF can be used in place of zero to enabled parameters in functions like drive_feedback and drive_tri...
Definition:
abdrive.h:204
ON
#define ON
ON can be used in place of a nonzero value to enabled parameters in functions like drive_feedback and...
Definition:
abdrive.h:212
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17