44 Commits

Author SHA1 Message Date
Scott Allen
82f3863036 Overloaded the widget setValue() function to add a boolean variable which
controls whether the display buffer is updated.

Also changed bool declarations to boolean, for consistency.
2015-03-25 17:51:42 -04: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
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
810a0928cb Add destructor for MicroViewWidget base class
Destructor added to prevent compiler warning for object delete.
2014-09-15 19:32:33 -04: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
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
JP
b64d5e4417 fixed child widget double declare of reDraw() 2014-08-04 21:23:06 +10: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
b109908d28 Fast SPI pin changes
- added defines to map ports and bits for RESET, DC and SS.
- added macros to quickly control RESET, DC and SS using
  the internal weak pullup for high.
2014-07-29 21:26:07 -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
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
e6045dcfa1 added flipVertical and horizontal 2014-02-25 11:58:56 +11:00
JP
93beac25d5 added checkComm() function to communicate with host PC 2014-02-15 10:15:03 +11:00
JP
7fd29e3c92 added Serial command 2014-02-12 20:50:07 +11:00
JP
eaf0862bb5 added invert function, contrast function, changed scrollStop to scrollStop for consistency 2014-02-11 19:43:01 +11:00
JP
ec1c760c7c added round gauge widget 2014-02-08 20:34:28 +11:00
JP
7f15062e58 fixed Slider negative value not working 2014-02-07 14:05:52 +11:00
JP
1fcf3a0839 * changed MICROVIEW class name to MicroView
* created MICROVIEWWIDGET class
* added routines to draw widget
* added slider widget
* merged MicroViewWidget into MicroView
* merged SPI.h into MicroView
2014-02-06 17:39:10 +11:00
JP
d61474cb61 declared permanent uView variable 2014-02-03 10:17:18 +11:00
JP
d1f60ab9e6 fixed font draw XOR mode bug
added analog clock demo
2014-01-30 14:23:57 +11:00
JP
2fab8fe34a font plotting anywhere 2014-01-16 20:29:42 +11:00
JP
c9b1aa3128 added multiple fonts support 2014-01-16 17:13:02 +11:00
JP
e5989baf36 added multiple fonts support 2014-01-15 15:55:39 +11:00
JP
1ab7195db9 added draw char 2014-01-15 11:40:02 +11:00
JP
b5bba50028 added more functions 2014-01-13 21:35:22 +11:00
JP
41ffc5e28e added pixel line clear 2014-01-13 18:02:21 +11:00
JP
89ca5987aa first commit 2014-01-12 21:00:51 +11:00