Commit Graph

69 Commits

Author SHA1 Message Date
jpliew
80a0c70c34 Merge pull request #22 from MLXXXp/widget_protected_variables
Changed private variables in the MicroViewWidget base class to protected, for direct use by child classes
2014-10-04 13:52:36 +10:00
jpliew
c75d14abff Merge pull request #21 from ben-zen/circle_drawing
Improved circleFill() drawing
2014-10-04 13:52:12 +10:00
Scott Allen
5e24583c31 Refactored widget code to eliminate needFirstDraw variable 2014-09-25 16:43:43 -04:00
Scott Allen
b05451f4c6 Use constructor initialisation lists for widget variables 2014-09-25 16:02:47 -04:00
Scott Allen
0d8545d6f8 Changed widget base class variables from private to protected
Base variables are now accessed directly by child widgets instead of
using methods
2014-09-25 12:48:21 -04:00
ben-zen
8ae691c4c2 Fixed whitespace before pull request. 2014-09-23 21:39:06 -07:00
ben-zen
12a9c5c2ac Merged up-to-date geekammo repo with my circleFill() changes. 2014-09-23 21:22:34 -07:00
ben-zen
68f0c20fd5 Replaced body of previous circleFill() method in the MicroView class, in preparation for a pull request. 2014-09-23 21:14:20 -07:00
Scott Allen
38be4163c0 Replaced sprintf calls with dedicated code
Using sprintf generates a large amount of code. By replacing the
sprintf calls with dedicated code, program size is reduced when
widgets are used.

Also:
- Added a getValLen method for widgets which returns the print
length for the current value, similar to the existing getMaxValLen.
- The value for widgets is now initialised to the minimum value,
instead of 0, because 0 could be outside the specified range.
- Added getValLen and getMaxValLen keywords.
- The MicroViewWidgetDemo example sketch was modified to use
the new getValLen method, plus a few other small changes.
2014-09-22 19:16:34 -04:00
Scott Allen
da7579a6e8 Code refactoring for widget pointers
Added private methods to replace duplicated code
2014-09-17 19:50:09 -04:00
Scott Allen
e9584301ab Widget numeric value supression option
The user can add a flag to the style, for all widgets, to supress
the display of the numeric value.

Added new widget method drawNumValue() to simplify the code,
which can also be called by the user, e.g. for a custom numeric
value location.
2014-09-17 16:01:35 -04:00
Scott Allen
4b7b544fa4 Improved drawing of gauge minor ticks
Don't bother drawing gauge minor ticks over major ticks
2014-09-17 11:17:10 -04:00
Scott Allen
13390ca758 Fix compiler warning: signed/unsigned comparison 2014-09-15 19:19:15 -04:00
Esmit Pérez C
df383d88f2 Indentation fixes 2014-09-14 15:09:32 -05:00
Esmit Pérez C
04ed26e2b8 Corrected indentation 2014-09-14 14:56:43 -05:00
Esmit Pérez C
23d05f13ee Indentation fixes 2014-09-14 13:48:53 -05:00
Esmit Pérez C
88116856d4 Code cleanups for previous refactoring 2014-09-14 10:18:00 -05:00
Esmit Pérez C
cc6a702712 removed unneeded comments 2014-09-14 10:07:53 -05:00
Esmit Pérez C
c5cf9692ad Documentation changes
Removed comments regarding design decisions. MicroViewSlider:draw()
retested to ensure refactoring did not introduce regressions.
2014-09-12 23:16:08 -05:00
Esmit Pérez C
63e3228d83 Code refactorings 2014-09-12 20:43:38 -05:00
Emil Ong
9573e7d6cc Fix clipping issue for circleFill when top is offscreen.
Replaced circleFill algorithm with a scanning algorithm. Also fixes
problem with XOR draw mode for filled circles.
2014-08-24 14:28:33 -07:00
jpliew
db155041ff Merge pull request #13 from MLXXXp/user_screen_access
Add uView.screenBuffer() for access to screen RAM.
2014-08-20 20:46:43 +10:00
Scott Allen
ba0b779740 Changed name from screenBuffer to getScreenBuffer 2014-08-20 06:24:57 -04:00
Scott Allen
b0e4a9600f Add uView.screenBuffer() for access to screen RAM.
Returns a pointer to the start of the RAM screen buffer
for direct write and read access.
2014-08-19 10:01:51 -04:00
Scott Allen
c07b86476a Add uView.scrollLeft() function.
Same as existing uView.scrollRight() but in the opposite direction.
2014-08-16 22:58:28 -04:00
Scott Allen
95626610e1 Merge branch 'slider_ticks'.
Simplified slider widget drawFace() function.
2014-08-10 20:33:05 -04:00
Scott Allen
0b56edc962 Handle full signed 16 bit ranges for widgets.
Widgets will now work properly with minimum and maximum values
from −32,768 to 32,767.
Also, place the numeric value field close to sliders
and horizontally centred in gauges.
2014-08-10 20:23:16 -04:00
Scott Allen
4bbfea3cf2 Simplify slider widget drawFace() function.
Use just one loop to draw all minor ticks.
Use a second loop to extend lines for major ticks.
Use totalTicks variable to determine number of ticks to draw.
2014-08-10 15:37:48 -04:00
Scott Allen
cc1d78384a Changed vertical slider direction.
Low values at the bottom. High values at the top.
2014-08-04 19:20:18 -04:00
Scott Allen
77928f1b74 Fixed compiler warning in MicroViewSlider.
In drawFace, majorLine could be left uninitialised if style was invalid
(although this couldn't happen with the current code).
Also cleaned up the WIDGETSTYLE tests.
2014-08-04 17:54:10 -04:00
JP
94fc7e6437 moved reDraw() to parent 2014-08-04 11:00:08 +10:00
JP
7c3ec25d70 added reDraw() 2014-08-04 10:36:33 +10:00
JP
dce58d7069 added reDraw() for MicroViewWidget class 2014-08-04 10:22:47 +10:00
JP
21fa22bec2 Merge branch 'vertical-slider' of https://github.com/czetie/MicroView-Arduino-Library into czetie-vertical-slider 2014-08-03 16:02:51 +10:00
Scott Allen
9c5568418a Improve speed of display() and clear() functions
by using horizontal addressing mode.
2014-08-01 14:10:11 -04:00
Scott Allen
a32fd2c499 Added uView.end() to power off the display.
In uView.begin() don't send commands that default to desired values.
2014-08-01 14:09:58 -04:00
Scott Allen
499594d9de Help further reduce overdriving display inputs
(and fixed a few spelling errors in comments)
- Use fast pin change macros for RESET, SS and DC.
- Implement MVSPI.packetBegin() and MVSPI.packetEnd() to allow sending
  multiple byte "packets" while SS remains enabled.
- Add 2 and 3 byte command() functions to send multiple command bytes in
  one packet.
- Modify clear() and display() functions to send commands and data in
  packets.
- Do the "wait for SPI transfer complete" just before sending the next
  byte (plus after the last or only byte) in a packet, so code can be
  executed while bytes are being sent.
- Disable SPI mode when not transmitting, so MOSI (and SCK) will go low.
- Keep DC low except when sending data bytes.
- Change MVSPI.transfer() to void since nothing can be received from
  the display.
2014-07-30 19:28:39 -04:00
Scott Allen
fa09bdd7aa Eliminate compiler warnings
- Fixed use of = instead of == in "if" statment.
- Fixed uninitialised count variable in "for" loop.
- Removed unused variables.
- Replaced line splice characters (backslash) at end of comments.
2014-07-29 21:27:10 -04:00
Carl Zetie
b5462c5bcb Many bugs fixed
OK, this version is actually worth looking at. Previous had more bugs
than you could shake a stick at.

vert_slider_test.ino illustrates the two slider styles, vertical
versions of the two existing styles
2014-07-14 18:39:13 -04:00
Carl Zetie
7b66741f79 Fixed my typo in MicroView.cpp
Fixed my typo in MicroView.cpp
2014-07-14 07:48:20 -04:00
Carl Zetie
c1e8756c4e Added Vertical Slider styles to Slider widget
Added WIDGETSTYLE2 (like 0, but vertical) and WIDGETSTYLE3 (like 1, but
vertical). NOTE: I don't have a build environment, so I can't even
promise this will compile! So if it's crap, just treat it as a concept
for an enhancement request!
2014-07-13 14:42:34 -04:00
JP Liew
ff388744a6 added more documentation 2014-06-26 21:20:49 +10:00
JP Liew
a7e091c2f9 added comments to support doxygen 2014-06-26 14:38:16 +10:00
JP
90f8e8d606 added Rotating Cube example by Jim Lindblom 2014-06-12 11:17:32 +10:00
JP
73cf96e723 added SparkFun logo 2014-06-09 11:20:56 +10:00
JP
8ebf545e08 added simple tutorials, modified RESET pin 2014-06-09 11:01:47 +10:00
JP
8db48a9538 added GPL V3 License 2014-04-30 10:42:12 +10:00
JP
9ee0b95cf8 changed SS,RESET,DC to use weak pull-up 2014-04-22 22:32:08 +10:00
JP
fb8b9c4a43 added debug messages for doCmd() 2014-04-17 15:49:39 +10:00
JP
e6045dcfa1 added flipVertical and horizontal 2014-02-25 11:58:56 +11:00