Skip to content

Commit a4b18a0

Browse files
author
Jim Lindblom
committed
initial commit of Arduino library
1 parent e32653b commit a4b18a0

File tree

17 files changed

+4199
-0
lines changed

17 files changed

+4199
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
MicroView Arduino Library
3+
Copyright (C) 2014 GeekAmmo
4+
5+
This program is free software: you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation, either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
#ifndef FONT7SEGMENT_H
19+
#define FONT7SEGMENT_H
20+
21+
#include <avr/pgmspace.h>
22+
23+
static const unsigned char sevensegment [] PROGMEM = {
24+
// first row defines - FONTWIDTH, FONTHEIGHT, ASCII START CHAR, TOTAL CHARACTERS, FONT MAP WIDTH HIGH, FONT MAP WIDTH LOW (2,56 meaning 256)
25+
10,16,46,12,1,20,
26+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
27+
0x00, 0x00, 0x00, 0x00, 0x78, 0xFC, 0x02, 0x03, 0x03, 0x03, 0x03, 0x02, 0xFC, 0x78, 0x00, 0x00,
28+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x7E, 0x00, 0x00, 0x02, 0x83, 0x83, 0x83, 0x83, 0x02,
29+
0xFC, 0x78, 0x00, 0x00, 0x02, 0x83, 0x83, 0x83, 0x83, 0x02, 0xFC, 0x78, 0x7E, 0xFF, 0x00, 0x80,
30+
0x80, 0x80, 0x80, 0x00, 0xFF, 0x7E, 0x78, 0xFC, 0x02, 0x83, 0x83, 0x83, 0x83, 0x02, 0x00, 0x00,
31+
0x78, 0xFC, 0x02, 0x83, 0x83, 0x83, 0x83, 0x02, 0x00, 0x00, 0x00, 0x02, 0x03, 0x03, 0x03, 0x03,
32+
0x03, 0x02, 0xFC, 0x78, 0x78, 0xFC, 0x02, 0x83, 0x83, 0x83, 0x83, 0x02, 0xFC, 0x78, 0x78, 0xFC,
33+
0x02, 0x83, 0x83, 0x83, 0x83, 0x02, 0xFC, 0x78, 0x00, 0x00, 0x00, 0x60, 0xF0, 0xF0, 0x60, 0x00,
34+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x3F, 0x40, 0xC0,
35+
0xC0, 0xC0, 0xC0, 0x40, 0x3F, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x7E,
36+
0x1C, 0x3E, 0x41, 0xC1, 0xC1, 0xC1, 0xC1, 0x41, 0x00, 0x00, 0x00, 0x00, 0x41, 0xC1, 0xC1, 0xC1,
37+
0xC1, 0x41, 0x3E, 0x1C, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xFF, 0x7E, 0x00, 0x00,
38+
0x41, 0xC1, 0xC1, 0xC1, 0xC1, 0x41, 0x3E, 0x1C, 0x1C, 0x3E, 0x41, 0xC1, 0xC1, 0xC1, 0xC1, 0x41,
39+
0x3E, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x7E, 0x1C, 0x3E, 0x41, 0xC1,
40+
0xC1, 0xC1, 0xC1, 0x41, 0x3E, 0x1C, 0x00, 0x00, 0x41, 0xC1, 0xC1, 0xC1, 0xC1, 0x41, 0x3E, 0x1C
41+
};
42+
#endif
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# MicroView Arduino Library
2+
3+
Developed by [Geek Ammo Pty Ltd](http://www.geekammo.com) based on Arduino and other Open Source libraries.
4+
5+
## Description
6+
7+
Arduino library for MicroView.
8+
9+
## Required Libraries
10+
11+
1. [Time.h](http://www.pjrc.com/teensy/td_libs_Time.html) NOTE: Only required when using clock/time functions. For example the MicroViewDemo in the example folder.
12+
13+
## Installation
14+
15+
1. Change directory to Arduino's main directory
16+
2. cd libraries
17+
3. mkdir MicroView
18+
4. cd MicroView
19+
5. git clone https://github.com/geekammo/MicroView-Arduino-Library.git .
20+
6. Start Arduino IDE.
21+
7. MicroView example is located at, File--->Example--->MicroView--->MicroViewDemo
22+
23+
### Example 1 - Hello World!
24+
<pre><code>
25+
#include &lt;MicroView.h&gt;
26+
27+
void setup() {
28+
uView.begin();
29+
}
30+
31+
void loop() {
32+
uView.print("HelloWorld");
33+
uView.display(); // display current page buffer
34+
}
35+
</code></pre>
36+
37+
### Example 2 - Basic Drawing
38+
<pre><code>
39+
#include &lt;MicroView.h&gt;
40+
41+
void setup() {
42+
uView.begin();
43+
uView.clear(PAGE); // clear the page buffer
44+
}
45+
46+
void loop() {
47+
uView.line(0,0,64,48);
48+
uView.circle(32,24,10);
49+
uView.rect(10,10,20,20);
50+
uView.pixel(50,5);
51+
uView.setCursor(0,40);
52+
uView.print(" MicroView");
53+
uView.display(); // display current page buffer
54+
}
55+
</code></pre>
56+
57+
### Example 3 - Widgets
58+
<pre><code>
59+
#include &lt;MicroView.h&gt;
60+
61+
MicroViewWidget *widget,*widget2;
62+
63+
void setup() {
64+
uView.begin();
65+
uView.clear(PAGE);
66+
widget= new MicroViewGauge(32,30,0,100); // draw Gauge widget at x=32,y=30,min=0, max=100
67+
widget2= new MicroViewSlider(0,0,0,100); // draw Slider widget at x=0,y=0,min=0, max=100
68+
}
69+
70+
void loop() {
71+
for(int i=0; i&lt;=100;i++) {
72+
widget->setValue(i); // give a value to widget
73+
widget2->setValue(i);
74+
uView.display(); // display current page buffer
75+
}
76+
}
77+
</code></pre>
78+
79+
### Example 4 - Communication
80+
<pre><code>
81+
#include &lt;MicroView.h&gt;
82+
83+
void setup() {
84+
uView.begin();
85+
uView.clear(PAGE);
86+
}
87+
88+
void loop() {
89+
uView.checkComm();
90+
}
91+
</code></pre>
92+
93+
## History
94+
**v1.13b: 13th June 2014 by JP Liew**
95+
* added Sine Wave Example
96+
* inserted license to example code
97+
98+
**v1.12b: 11th June 2014 by JP Liew**
99+
* added comments for SparkFun Logo
100+
* added Rotating Cube example by Jim Lindblom @ SparkFun Electronics
101+
* changed git clone instruction to use https
102+
103+
**v1.11b: 9th June 2014 by JP Liew**
104+
* added simple tutorials for production sketch
105+
* modified OLED RESET pin to 7
106+
* added SparkFun Logo
107+
108+
**v1.10b: 22th April 2014 by JP Liew**
109+
* changed SS, RESET, DC pins to use weak internal pull-up resistors
110+
111+
**v1.09b: 17th April 2014 by JP Liew**
112+
* changed verticalFlip() to flipVertical() and horizontalFlip() to flipHorizontal() for consistency
113+
* added debug messages for doCmd()
114+
115+
**v1.08b: 18th February 2014 by JP Liew**
116+
* added verticalFlip(), horizontalFlip()
117+
118+
**v1.07b: 15th February 2014 by JP Liew**
119+
* changed function name stopScroll to scrollStop for consistency
120+
* added contrast function
121+
* added invert function
122+
* added KEYWORD to keywords.txt
123+
* added checkComm() function to communicate with host PC
124+
125+
**v1.06b: 9th February 2014 by JP Liew**
126+
* fixed Slider negative value not working
127+
* added round Gauge widget
128+
* changed Example 3 to show round Gauge
129+
130+
**v1.05b: 6th February 2014 by JP Liew**
131+
* changed MICROVIEW class name to MicroView
132+
* created MICROVIEWWIDGET class
133+
* added routines to draw widget
134+
* added slider widget
135+
* merged MicroViewWidget into MicroView
136+
* merged SPI.h into MicroView
137+
138+
**v1.04b: 3rd February 2014 by JP Liew**
139+
* declared permanent uView variable.
140+
* cleaned code and added some remarks.
141+
* added drawing functions that make use of default color and draw mode.
142+
* added example in README.md
143+
144+
**v1.03b: 1st February 2014 by JP Liew**
145+
* added 7 segment number only font.
146+
147+
**v1.02b: 31th January 2014 by JP Liew**
148+
* added sprite animation demo.
149+
150+
**v1.01b: 30th January 2014 by JP Liew**
151+
* fixed font draw XOR mode bug.
152+
* added analog clock demo.
153+
154+
**v1.00b: 30th January 2014 by JP Liew**
155+
* Initial commit. Beta with minor bugs.
156+
157+
## License
158+
MicroView Arduino Library
159+
Copyright (C) 2014 GeekAmmo
160+
161+
This program is free software: you can redistribute it and/or modify
162+
it under the terms of the GNU General Public License as published by
163+
the Free Software Foundation, either version 3 of the License, or
164+
(at your option) any later version.
165+
166+
This program is distributed in the hope that it will be useful,
167+
but WITHOUT ANY WARRANTY; without even the implied warranty of
168+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
169+
GNU General Public License for more details.
170+
171+
You should have received a copy of the GNU General Public License
172+
along with this program. If not, see <http://www.gnu.org/licenses/>.

0 commit comments

Comments
 (0)