PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Display
liboledc
oledc_drawTriangle.c
1
/*
2
* @file oledc_drawTriangle.c
3
*
4
* @author Matthew Matz
5
*
6
* @version 0.9
7
*
8
* @copyright Copyright (C) Parallax, Inc. 2016. See end of file for
9
* terms of use (MIT License).
10
*
11
* @brief 0.96-inch RGB OLED display bitmap driver, see oledc_h. for documentation.
12
*
13
* @detail Please submit bug reports, suggestions, and improvements to
14
* this code to editor@parallax.com.
15
*/
16
17
18
#include "oledc.h"
19
20
// Draw a triangle
21
void
oledc_drawTriangle(
int
x0,
int
y0,
int
x1,
int
y1,
int
x2,
int
y2,
unsigned
int
color)
22
{
23
while
(oledc_screenLock());
24
oledc_screenLockSet();
25
26
oledc_drawLinePrimative(x0, y0, x1, y1, color);
27
oledc_drawLinePrimative(x1, y1, x2, y2, color);
28
oledc_drawLinePrimative(x2, y2, x0, y0, color);
29
30
oledc_screenLockClr();
31
}
32
33
// Parts of this file are from the Adafruit GFX arduino library
34
35
/***************************************************
36
This is a library for the 0.96" 16-bit Color OLED with SSD1331 driver chip
37
Pick one up today in the adafruit shop!
38
------> http://www.adafruit.com/products/684
39
These displays use SPI to communicate, 4 or 5 pins are required to
40
interface
41
Adafruit invests time and resources providing this open source code,
42
please support Adafruit and open-source hardware by purchasing
43
products from Adafruit!
44
Written by Limor Fried/Ladyada for Adafruit Industries.
45
BSD license, all text above must be included in any redistribution
46
****************************************************/
47
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17