diff --git a/.gitignore b/.gitignore
index 8c7a9389..7da61ffc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,17 +1,13 @@
.pioenvs
+.pio
.clang_complete
.gcc-flags.json
.piolibdeps
-src/main.cpp
/debug
-lib
.travis.yml
!/.travis.yml
-platformio.ini
/TODO.txt
-/classes.odg
.gitignore
!/.gitignore
*.odg
-examples/clickEncoder
-examples/screenNav
+*.ghc
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 00000000..3b482c66
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,6 @@
+[submodule "parts"]
+ path = parts
+ url = https://github.com/neu-rah/parts
+[submodule "tinyTimeUtils"]
+ path = tinyTimeUtils
+ url = https://github.com/neu-rah/tinyTimeUtils
diff --git a/.project b/.project
new file mode 100644
index 00000000..58d95dc3
--- /dev/null
+++ b/.project
@@ -0,0 +1,11 @@
+
+
+ ArduinoMenu
+
+
+
+
+
+
+
+
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 9e869507..00000000
--- a/.travis.yml
+++ /dev/null
@@ -1,70 +0,0 @@
-# Continuous Integration (CI) is the practice, in software
-# engineering, of merging all developer working copies with a shared mainline
-# several times a day < http://docs.platformio.org/en/latest/ci/index.html >
-#
-# Documentation:
-#
-# * Travis CI Embedded Builds with PlatformIO
-# < https://docs.travis-ci.com/user/integration/platformio/ >
-#
-# * PlatformIO integration with Travis CI
-# < http://docs.platformio.org/en/latest/ci/travis.html >
-#
-# * User Guide for `platformio ci` command
-# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html >
-#
-#
-language: python
-python:
- - "2.7"
-
-sudo: false
-cache:
- directories:
- - "~/.platformio"
-
-env:
- - PLATFORMIO_CI_SRC=examples/Blink/Blink/Blink.ino
- - PLATFORMIO_CI_SRC=examples/Serial/serialio/serialio/serialio.ino
- # - PLATFORMIO_CI_SRC=examples/Serial/ansiSerial/ansiSerial/ansiSerial.ino
- - PLATFORMIO_CI_SRC=examples/codeCtrl/codeCtrl/codeCtrl.ino
- - PLATFORMIO_CI_SRC=examples/adafruitGfx/lcdMono/lcdMono/lcdMono.ino
- - PLATFORMIO_CI_SRC=examples/adafruitGfx/tft/tft/tft.ino
- - PLATFORMIO_CI_SRC=examples/U8GLib/U8GLib/U8GLib.ino
-
-install:
- - pip install -U platformio
-
- - wget https://github.com/scottdky/Streaming/archive/master.zip -O /tmp/Streaming.zip
- - unzip /tmp/Streaming.zip -d /tmp/
-
- # - wget https://github.com/nettigo/Assert4a/archive/master.zip -O /tmp/Assert4a.zip
- # - unzip /tmp/Assert4a.zip -d /tmp/
-
- - wget https://github.com/adafruit/Adafruit-GFX-Library/archive/master.zip -O /tmp/Adafruit-GFX-Library-master.zip
- - unzip /tmp/Adafruit-GFX-Library-master.zip -d /tmp/
-
- - wget https://github.com/neu-rah/PCINT/archive/master.zip -O /tmp/PCINT-master.zip
- - unzip /tmp/PCINT-master.zip -d /tmp/
-
- - wget https://github.com/olikraus/U8glib_Arduino/archive/master.zip -O /tmp/U8glib_Arduino-master.zip
- - unzip /tmp/U8glib_Arduino-master.zip -d /tmp/
-
- - wget https://github.com/neu-rah/AnsiStream/archive/master.zip -O /tmp/AnsiStream-master.zip
- - unzip /tmp/AnsiStream-master.zip -d /tmp/
-
- - wget https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/NewliquidCrystal_1.3.4.zip -O /tmp/NewliquidCrystal_1.3.4.zip
- - unzip /tmp/NewliquidCrystal_1.3.4.zip -d /tmp/
-
- - wget https://github.com/adafruit/Adafruit-PCD8544-Nokia-5110-LCD-library/archive/master.zip -O /tmp/Adafruit-PCD8544-Nokia-5110-LCD-library-master.zip
- - unzip /tmp/Adafruit-PCD8544-Nokia-5110-LCD-library-master.zip -d /tmp/
-
- - wget https://github.com/adafruit/Adafruit-ST7735-Library/archive/master.zip -O /tmp/Adafruit-ST7735-Library-master.zip
- - unzip /tmp/Adafruit-ST7735-Library-master.zip -d /tmp/
-
- # - wget https://github.com/PaulStoffregen/SD/archive/master.zip -O /tmp/SD-master.zip
- # - unzip /tmp/SD-master.zip -d /tmp/
-
-script:
- # - platformio ci --lib="." --lib="/tmp/SD-master" --board=nanoatmega328 --board=teensy31
- - platformio ci --lib="." --lib="/tmp/Streaming-master" --lib="/tmp/Adafruit-GFX-Library-master" --lib="/tmp/PCINT-master" --lib="/tmp/U8glib_Arduino-master" --lib="/tmp/AnsiStream-master" --lib="/tmp/NewliquidCrystal" --lib="/tmp/Adafruit-PCD8544-Nokia-5110-LCD-library-master" --lib="/tmp/Adafruit-ST7735-Library-master" --board=nanoatmega328 --board=teensy31 --board=due
diff --git a/AM5.code-workspace b/AM5.code-workspace
new file mode 100644
index 00000000..dc52a093
--- /dev/null
+++ b/AM5.code-workspace
@@ -0,0 +1,31 @@
+{
+ "folders": [
+ {
+ "name": "ArduinoMenu",
+ "path": "."
+ },
+ {
+ "path": "examples/atmega"
+ },
+ {
+ "path": "examples/console"
+ }
+ ],
+ "settings": {
+ "files.associations": {
+ "ostream": "cpp",
+ "*.tcc": "cpp",
+ "limits": "cpp",
+ "typeinfo": "cpp",
+ "cmath": "cpp",
+ "array": "cpp",
+ "chrono": "cpp",
+ "complex": "cpp",
+ "optional": "cpp",
+ "algorithm": "cpp",
+ "numeric": "cpp",
+ "streambuf": "cpp",
+ "thread": "cpp"
+ }
+ }
+}
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 8f65f5df..00000000
--- a/LICENSE
+++ /dev/null
@@ -1,437 +0,0 @@
-Attribution-NonCommercial-ShareAlike 4.0 International
-
-=======================================================================
-
-Creative Commons Corporation ("Creative Commons") is not a law firm and
-does not provide legal services or legal advice. Distribution of
-Creative Commons public licenses does not create a lawyer-client or
-other relationship. Creative Commons makes its licenses and related
-information available on an "as-is" basis. Creative Commons gives no
-warranties regarding its licenses, any material licensed under their
-terms and conditions, or any related information. Creative Commons
-disclaims all liability for damages resulting from their use to the
-fullest extent possible.
-
-Using Creative Commons Public Licenses
-
-Creative Commons public licenses provide a standard set of terms and
-conditions that creators and other rights holders may use to share
-original works of authorship and other material subject to copyright
-and certain other rights specified in the public license below. The
-following considerations are for informational purposes only, are not
-exhaustive, and do not form part of our licenses.
-
- Considerations for licensors: Our public licenses are
- intended for use by those authorized to give the public
- permission to use material in ways otherwise restricted by
- copyright and certain other rights. Our licenses are
- irrevocable. Licensors should read and understand the terms
- and conditions of the license they choose before applying it.
- Licensors should also secure all rights necessary before
- applying our licenses so that the public can reuse the
- material as expected. Licensors should clearly mark any
- material not subject to the license. This includes other CC-
- licensed material, or material used under an exception or
- limitation to copyright. More considerations for licensors:
- wiki.creativecommons.org/Considerations_for_licensors
-
- Considerations for the public: By using one of our public
- licenses, a licensor grants the public permission to use the
- licensed material under specified terms and conditions. If
- the licensor's permission is not necessary for any reason--for
- example, because of any applicable exception or limitation to
- copyright--then that use is not regulated by the license. Our
- licenses grant only permissions under copyright and certain
- other rights that a licensor has authority to grant. Use of
- the licensed material may still be restricted for other
- reasons, including because others have copyright or other
- rights in the material. A licensor may make special requests,
- such as asking that all changes be marked or described.
- Although not required by our licenses, you are encouraged to
- respect those requests where reasonable. More considerations
- for the public:
- wiki.creativecommons.org/Considerations_for_licensees
-
-=======================================================================
-
-Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
-Public License
-
-By exercising the Licensed Rights (defined below), You accept and agree
-to be bound by the terms and conditions of this Creative Commons
-Attribution-NonCommercial-ShareAlike 4.0 International Public License
-("Public License"). To the extent this Public License may be
-interpreted as a contract, You are granted the Licensed Rights in
-consideration of Your acceptance of these terms and conditions, and the
-Licensor grants You such rights in consideration of benefits the
-Licensor receives from making the Licensed Material available under
-these terms and conditions.
-
-
-Section 1 -- Definitions.
-
- a. Adapted Material means material subject to Copyright and Similar
- Rights that is derived from or based upon the Licensed Material
- and in which the Licensed Material is translated, altered,
- arranged, transformed, or otherwise modified in a manner requiring
- permission under the Copyright and Similar Rights held by the
- Licensor. For purposes of this Public License, where the Licensed
- Material is a musical work, performance, or sound recording,
- Adapted Material is always produced where the Licensed Material is
- synched in timed relation with a moving image.
-
- b. Adapter's License means the license You apply to Your Copyright
- and Similar Rights in Your contributions to Adapted Material in
- accordance with the terms and conditions of this Public License.
-
- c. BY-NC-SA Compatible License means a license listed at
- creativecommons.org/compatiblelicenses, approved by Creative
- Commons as essentially the equivalent of this Public License.
-
- d. Copyright and Similar Rights means copyright and/or similar rights
- closely related to copyright including, without limitation,
- performance, broadcast, sound recording, and Sui Generis Database
- Rights, without regard to how the rights are labeled or
- categorized. For purposes of this Public License, the rights
- specified in Section 2(b)(1)-(2) are not Copyright and Similar
- Rights.
-
- e. Effective Technological Measures means those measures that, in the
- absence of proper authority, may not be circumvented under laws
- fulfilling obligations under Article 11 of the WIPO Copyright
- Treaty adopted on December 20, 1996, and/or similar international
- agreements.
-
- f. Exceptions and Limitations means fair use, fair dealing, and/or
- any other exception or limitation to Copyright and Similar Rights
- that applies to Your use of the Licensed Material.
-
- g. License Elements means the license attributes listed in the name
- of a Creative Commons Public License. The License Elements of this
- Public License are Attribution, NonCommercial, and ShareAlike.
-
- h. Licensed Material means the artistic or literary work, database,
- or other material to which the Licensor applied this Public
- License.
-
- i. Licensed Rights means the rights granted to You subject to the
- terms and conditions of this Public License, which are limited to
- all Copyright and Similar Rights that apply to Your use of the
- Licensed Material and that the Licensor has authority to license.
-
- j. Licensor means the individual(s) or entity(ies) granting rights
- under this Public License.
-
- k. NonCommercial means not primarily intended for or directed towards
- commercial advantage or monetary compensation. For purposes of
- this Public License, the exchange of the Licensed Material for
- other material subject to Copyright and Similar Rights by digital
- file-sharing or similar means is NonCommercial provided there is
- no payment of monetary compensation in connection with the
- exchange.
-
- l. Share means to provide material to the public by any means or
- process that requires permission under the Licensed Rights, such
- as reproduction, public display, public performance, distribution,
- dissemination, communication, or importation, and to make material
- available to the public including in ways that members of the
- public may access the material from a place and at a time
- individually chosen by them.
-
- m. Sui Generis Database Rights means rights other than copyright
- resulting from Directive 96/9/EC of the European Parliament and of
- the Council of 11 March 1996 on the legal protection of databases,
- as amended and/or succeeded, as well as other essentially
- equivalent rights anywhere in the world.
-
- n. You means the individual or entity exercising the Licensed Rights
- under this Public License. Your has a corresponding meaning.
-
-
-Section 2 -- Scope.
-
- a. License grant.
-
- 1. Subject to the terms and conditions of this Public License,
- the Licensor hereby grants You a worldwide, royalty-free,
- non-sublicensable, non-exclusive, irrevocable license to
- exercise the Licensed Rights in the Licensed Material to:
-
- a. reproduce and Share the Licensed Material, in whole or
- in part, for NonCommercial purposes only; and
-
- b. produce, reproduce, and Share Adapted Material for
- NonCommercial purposes only.
-
- 2. Exceptions and Limitations. For the avoidance of doubt, where
- Exceptions and Limitations apply to Your use, this Public
- License does not apply, and You do not need to comply with
- its terms and conditions.
-
- 3. Term. The term of this Public License is specified in Section
- 6(a).
-
- 4. Media and formats; technical modifications allowed. The
- Licensor authorizes You to exercise the Licensed Rights in
- all media and formats whether now known or hereafter created,
- and to make technical modifications necessary to do so. The
- Licensor waives and/or agrees not to assert any right or
- authority to forbid You from making technical modifications
- necessary to exercise the Licensed Rights, including
- technical modifications necessary to circumvent Effective
- Technological Measures. For purposes of this Public License,
- simply making modifications authorized by this Section 2(a)
- (4) never produces Adapted Material.
-
- 5. Downstream recipients.
-
- a. Offer from the Licensor -- Licensed Material. Every
- recipient of the Licensed Material automatically
- receives an offer from the Licensor to exercise the
- Licensed Rights under the terms and conditions of this
- Public License.
-
- b. Additional offer from the Licensor -- Adapted Material.
- Every recipient of Adapted Material from You
- automatically receives an offer from the Licensor to
- exercise the Licensed Rights in the Adapted Material
- under the conditions of the Adapter's License You apply.
-
- c. No downstream restrictions. You may not offer or impose
- any additional or different terms or conditions on, or
- apply any Effective Technological Measures to, the
- Licensed Material if doing so restricts exercise of the
- Licensed Rights by any recipient of the Licensed
- Material.
-
- 6. No endorsement. Nothing in this Public License constitutes or
- may be construed as permission to assert or imply that You
- are, or that Your use of the Licensed Material is, connected
- with, or sponsored, endorsed, or granted official status by,
- the Licensor or others designated to receive attribution as
- provided in Section 3(a)(1)(A)(i).
-
- b. Other rights.
-
- 1. Moral rights, such as the right of integrity, are not
- licensed under this Public License, nor are publicity,
- privacy, and/or other similar personality rights; however, to
- the extent possible, the Licensor waives and/or agrees not to
- assert any such rights held by the Licensor to the limited
- extent necessary to allow You to exercise the Licensed
- Rights, but not otherwise.
-
- 2. Patent and trademark rights are not licensed under this
- Public License.
-
- 3. To the extent possible, the Licensor waives any right to
- collect royalties from You for the exercise of the Licensed
- Rights, whether directly or through a collecting society
- under any voluntary or waivable statutory or compulsory
- licensing scheme. In all other cases the Licensor expressly
- reserves any right to collect such royalties, including when
- the Licensed Material is used other than for NonCommercial
- purposes.
-
-
-Section 3 -- License Conditions.
-
-Your exercise of the Licensed Rights is expressly made subject to the
-following conditions.
-
- a. Attribution.
-
- 1. If You Share the Licensed Material (including in modified
- form), You must:
-
- a. retain the following if it is supplied by the Licensor
- with the Licensed Material:
-
- i. identification of the creator(s) of the Licensed
- Material and any others designated to receive
- attribution, in any reasonable manner requested by
- the Licensor (including by pseudonym if
- designated);
-
- ii. a copyright notice;
-
- iii. a notice that refers to this Public License;
-
- iv. a notice that refers to the disclaimer of
- warranties;
-
- v. a URI or hyperlink to the Licensed Material to the
- extent reasonably practicable;
-
- b. indicate if You modified the Licensed Material and
- retain an indication of any previous modifications; and
-
- c. indicate the Licensed Material is licensed under this
- Public License, and include the text of, or the URI or
- hyperlink to, this Public License.
-
- 2. You may satisfy the conditions in Section 3(a)(1) in any
- reasonable manner based on the medium, means, and context in
- which You Share the Licensed Material. For example, it may be
- reasonable to satisfy the conditions by providing a URI or
- hyperlink to a resource that includes the required
- information.
- 3. If requested by the Licensor, You must remove any of the
- information required by Section 3(a)(1)(A) to the extent
- reasonably practicable.
-
- b. ShareAlike.
-
- In addition to the conditions in Section 3(a), if You Share
- Adapted Material You produce, the following conditions also apply.
-
- 1. The Adapter's License You apply must be a Creative Commons
- license with the same License Elements, this version or
- later, or a BY-NC-SA Compatible License.
-
- 2. You must include the text of, or the URI or hyperlink to, the
- Adapter's License You apply. You may satisfy this condition
- in any reasonable manner based on the medium, means, and
- context in which You Share Adapted Material.
-
- 3. You may not offer or impose any additional or different terms
- or conditions on, or apply any Effective Technological
- Measures to, Adapted Material that restrict exercise of the
- rights granted under the Adapter's License You apply.
-
-
-Section 4 -- Sui Generis Database Rights.
-
-Where the Licensed Rights include Sui Generis Database Rights that
-apply to Your use of the Licensed Material:
-
- a. for the avoidance of doubt, Section 2(a)(1) grants You the right
- to extract, reuse, reproduce, and Share all or a substantial
- portion of the contents of the database for NonCommercial purposes
- only;
-
- b. if You include all or a substantial portion of the database
- contents in a database in which You have Sui Generis Database
- Rights, then the database in which You have Sui Generis Database
- Rights (but not its individual contents) is Adapted Material,
- including for purposes of Section 3(b); and
-
- c. You must comply with the conditions in Section 3(a) if You Share
- all or a substantial portion of the contents of the database.
-
-For the avoidance of doubt, this Section 4 supplements and does not
-replace Your obligations under this Public License where the Licensed
-Rights include other Copyright and Similar Rights.
-
-
-Section 5 -- Disclaimer of Warranties and Limitation of Liability.
-
- a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
- EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
- AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
- ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
- IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
- WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
- PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
- ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
- KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
- ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
-
- b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
- TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
- NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
- INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
- COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
- USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
- ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
- DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
- IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
-
- c. The disclaimer of warranties and limitation of liability provided
- above shall be interpreted in a manner that, to the extent
- possible, most closely approximates an absolute disclaimer and
- waiver of all liability.
-
-
-Section 6 -- Term and Termination.
-
- a. This Public License applies for the term of the Copyright and
- Similar Rights licensed here. However, if You fail to comply with
- this Public License, then Your rights under this Public License
- terminate automatically.
-
- b. Where Your right to use the Licensed Material has terminated under
- Section 6(a), it reinstates:
-
- 1. automatically as of the date the violation is cured, provided
- it is cured within 30 days of Your discovery of the
- violation; or
-
- 2. upon express reinstatement by the Licensor.
-
- For the avoidance of doubt, this Section 6(b) does not affect any
- right the Licensor may have to seek remedies for Your violations
- of this Public License.
-
- c. For the avoidance of doubt, the Licensor may also offer the
- Licensed Material under separate terms or conditions or stop
- distributing the Licensed Material at any time; however, doing so
- will not terminate this Public License.
-
- d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
- License.
-
-
-Section 7 -- Other Terms and Conditions.
-
- a. The Licensor shall not be bound by any additional or different
- terms or conditions communicated by You unless expressly agreed.
-
- b. Any arrangements, understandings, or agreements regarding the
- Licensed Material not stated herein are separate from and
- independent of the terms and conditions of this Public License.
-
-
-Section 8 -- Interpretation.
-
- a. For the avoidance of doubt, this Public License does not, and
- shall not be interpreted to, reduce, limit, restrict, or impose
- conditions on any use of the Licensed Material that could lawfully
- be made without permission under this Public License.
-
- b. To the extent possible, if any provision of this Public License is
- deemed unenforceable, it shall be automatically reformed to the
- minimum extent necessary to make it enforceable. If the provision
- cannot be reformed, it shall be severed from this Public License
- without affecting the enforceability of the remaining terms and
- conditions.
-
- c. No term or condition of this Public License will be waived and no
- failure to comply consented to unless expressly agreed to by the
- Licensor.
-
- d. Nothing in this Public License constitutes or may be interpreted
- as a limitation upon, or waiver of, any privileges and immunities
- that apply to the Licensor or You, including from the legal
- processes of any jurisdiction or authority.
-
-=======================================================================
-
-Creative Commons is not a party to its public
-licenses. Notwithstanding, Creative Commons may elect to apply one of
-its public licenses to material it publishes and in those instances
-will be considered the “Licensor.” The text of the Creative Commons
-public licenses is dedicated to the public domain under the CC0 Public
-Domain Dedication. Except for the limited purpose of indicating that
-material is shared under a Creative Commons public license or as
-otherwise permitted by the Creative Commons policies published at
-creativecommons.org/policies, Creative Commons does not authorize the
-use of the trademark "Creative Commons" or any other trademark or logo
-of Creative Commons without its prior written consent including,
-without limitation, in connection with any unauthorized modifications
-to any of its public licenses or any other arrangements,
-understandings, or agreements concerning use of licensed material. For
-the avoidance of doubt, this paragraph does not form part of the
-public licenses.
-
-Creative Commons may be contacted at creativecommons.org.
diff --git a/README.md b/README.md
deleted file mode 100644
index af9a1180..00000000
--- a/README.md
+++ /dev/null
@@ -1,455 +0,0 @@
-# ArduinoMenu 4
-
-**Generic menu/interactivity system for the arduino framework**
-
-[](https://spdx.org/licenses/CC-BY-NC-SA-4.0.html)
-[](https://travis-ci.org/neu-rah/ArduinoMenu)
-[](https://www.paypal.me/ruihfazevedo)
-[](https://gitter.im/ArduinoMenu/Lobby)
-
-## Purpose
-Full automated or user code driven navigation system.
-With this system you can define menus, submenus, input fields and other iteration objects that deal with all input/output and can call user defined handler as a result of user iteration.
-The user function can be operated as a single action called on click/enter or as a event driven function responding to focus In/Out or Enter/Esc events.
-The system is designed as a non blocking polling system, allowing concurrent task to run.
-Optionally the system can be operated in semi-automated mode, issuing navigation command from user code.
-
-See the [wiki](https://github.com/neu-rah/ArduinoMenu/wiki)
-
-## Simple Example
-```c++
-#include
-#include
-#include
-#include
-
-using namespace Menu;
-
-#define LEDPIN LED_BUILTIN
-#define MAX_DEPTH 1
-
-int timeOn=10;
-int timeOff=90;
-
-MENU(mainMenu, "Blink menu", Menu::doNothing, Menu::noEvent, Menu::wrapStyle
- ,FIELD(timeOn,"On","ms",0,100,10,1, Menu::doNothing, Menu::noEvent, Menu::noStyle)
- ,FIELD(timeOff,"Off","ms",0,100,10,1,Menu::doNothing, Menu::noEvent, Menu::noStyle)
- ,EXIT("`
-
-depending on your output driver it may be one of (can install both)
-- https://github.com/neu-rah/streamFlow
-- https://github.com/scottdky/Streaming
-
-### Input devices
-
-Serial https://www.arduino.cc/en/Reference/Serial
-
-quadEncoder - Generic encoder using PCINT (builtin)
-
-Buttons - simple digital keyboard (builtin)
-
-Generic keyboard (no PCINT) - configurable for digital or analog keyboards (builtin)
-
-ClickEncoder https://github.com/0xPIT/encoder
-
-Matrix keypad
-http://playground.arduino.cc/Code/Keypad
-https://github.com/Nullkraft/Keypad
-
-PCF8574 based i2c matrix keypad
-https://github.com/whatnick/i2ckeypad
-
-User defined input calling menu navigation API
-
-Web browser (experimental) when using ESP devices
-
-## Dependencies
-This library depends on the following libraries:
-
-- streamFlow https://github.com/neu-rah/streamFlow (on debug mode)
-
-Depending on the type of input or output, other libraries might be needed. Essentially any library needed for your devices.
-
-## Limits
-
-- when using macros the menu is limited to 16 options (current macro limnit).
-- menus **must** have at least 2 options when built using macros.
-- maximum 127 options.
-- fast access (numeric keys) only supports 9 options (1 to 9)
-- prompts can overflow on panels with less than 4 characters width
-- menu system is character based, so choose monometric font to achieve best results, it will work with any font but the text can overflow.
-
-## Base
-
-- Character based information display.
-- Line based menu organization.
-- Stream IO + specializations.
-
-## info
-
-more info at
-
-[wiki](https://github.com/neu-rah/ArduinoMenu/wiki) pages, [issues](https://github.com/neu-rah/ArduinoMenu/issues?utf8=%E2%9C%93&q=) or [r-site.net](http://www.r-site.net/?lang=en&at=//op%5B@id=%273090%27%5D)
-
-## Errors / Sugestions
-
-Please report errors, problems or enhancement ideas, I apreciate the feedback. Thanks.
-
-On issues report please specify the input and output drivers or devices as well as target platform.
-
-## notes
-
-encoder now needs begin() to be called on setup (2.x)
-
-input is read from generic streams, included simple streams for encoders and keyboards
- - provided encoder driver uses internal pull-ups and reverse logic
-
-multiple stream packing for input to mix encoder stream with encoder keyboard (usually 1 or 2 keys)
-
-## History
-
-### 4.0
- - SdFat plugin and example
- - EscControl examle
- - support Bodmer/TFT_eSPI
- - SDCard file picker plugin
- - Allow virtual/dynamic data custom menus
- - alternative key driver with explicit pin modes
- - More examples
- - Text edit fields with validation *
- - Pad style menus (horizontal list)
- - inline pad menus can input custom formats like IP/Date/Time, experimental and just for devices that can position a cursor
- - Plugins, alternative menu items potentially device specific
- - Allow multiple concurrent menus
- - Support UCGLib displays
- - Support U8x8 displays
- - Support Arduino TFT
- - Support PCF8574 I2C LCD
- - Support Analog Joystick input
- - Added input burst config option
- - VALUEOBJ macro, user allocated values
- - menuIn class for menu inputs (allows device field invertion) *
- - some options have been distributed to some other classes
- - allow dynamic menu construction (ram) even for AVR's
-
-#### * API changes
-
-##### Options
-
-**invertFieldKeys** option removed, invertion is now supported by specific menuIn objects.
-
-_regression: still needed to ease simple input cases._
-
-**numValueInput** moved to menuIn object
-
-**navRoot** extra options, previously on global options object
-```c++
-bool nav2D=false;//not used
-bool canExit=true;//v4.0 moved from global options
-bool useUpdateEvent=false;//if false, use enterEvent when field value is changed.
-idx_t inputBurst=1;//limit of inputs that can be processed before output
-```
-
-##### Serial input
-
-Serial is no longer accepted as an input directly, use serialIn instead
-
-##### prompt base API
-
-printTo member function changed from:
-
-```c++
-Used printTo(navRoot&,bool,menuOut&,idx_t,idx_t);
-```
-
-to
-
-```c++
-Used printTo(navRoot&,bool,menuOut&,idx_t,idx_t,idx_t=0);
-```
-
-_this should only affect customized components_
-
-inputs are now from class menuIn, derived from Stream but including flag functions for field axis inversion per input class.
-
-### 3.0
- - complete revision of menu control system
- - menu structure separated in ram objects and flash objects
- - using separate navigation control objects **navNode**
- - central navigation control object **navRoot**
- - using event for all menu objects (focus, blur, enter, exit).
- - multiple panels
- - color enumeration at base level
- - multiple output devices in parallel
- - define exit as regular option
- - limiting text width to prevent overflow
-
-### 2.4
- - support for teensy (tested on 3.2)
- - new field type SELECT
- - reflexivity, fields reflect external changes to values
- - store field strings to progmem
- - automatic use of RAM on system without PROGMEM
-
-### 2.3
-
- - action functions now need to return bool (only affects menus)
-
- >**false** = continue menu
- >
- >**true** = exit menu
-
- - Support for U8GLib screens
- - alternative use ClickEncoder
- - using flash memory to store menu strings and lists (PROGMEM)
-
-### 2.0
-
- - non-blocking menu main cycle
- - Menufields as menu prompts with associated value
- values can be:
- numeric withing range
- list of values toggled on click (for small lists)
- list of values selected as submenu (for longer lists)
- - PCINT now supports Mega/2560 and possibly others
-
-### 1.x
- - basic menu functionality
diff --git a/classes.odg b/classes.odg
deleted file mode 100644
index 2eb0cb9a..00000000
Binary files a/classes.odg and /dev/null differ
diff --git a/examples/Blink/.gitignore b/examples/Blink/.gitignore
deleted file mode 100644
index e05273b2..00000000
--- a/examples/Blink/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.pioenvs
-.clang_complete
-.gcc-flags.json
-.piolibdeps
\ No newline at end of file
diff --git a/examples/Blink/.travis.yml b/examples/Blink/.travis.yml
deleted file mode 100644
index 72c6e43f..00000000
--- a/examples/Blink/.travis.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-# Continuous Integration (CI) is the practice, in software
-# engineering, of merging all developer working copies with a shared mainline
-# several times a day < http://docs.platformio.org/en/stable/ci/index.html >
-#
-# Documentation:
-#
-# * Travis CI Embedded Builds with PlatformIO
-# < https://docs.travis-ci.com/user/integration/platformio/ >
-#
-# * PlatformIO integration with Travis CI
-# < http://docs.platformio.org/en/stable/ci/travis.html >
-#
-# * User Guide for `platformio ci` command
-# < http://docs.platformio.org/en/stable/userguide/cmd_ci.html >
-#
-#
-# Please choice one of the following templates (proposed below) and uncomment
-# it (remove "# " before each line) or use own configuration according to the
-# Travis CI documentation (see above).
-#
-
-
-#
-# Template #1: General project. Test it using existing `platformio.ini`.
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio run
-
-
-#
-# Template #2: The project is intended to by used as a library with examples
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# env:
-# - PLATFORMIO_CI_SRC=path/to/test/file.c
-# - PLATFORMIO_CI_SRC=examples/file.ino
-# - PLATFORMIO_CI_SRC=path/to/test/directory
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
diff --git a/examples/Blink/Blink/Blink.ino b/examples/Blink/Blink/Blink.ino
deleted file mode 100644
index 7f09afd5..00000000
--- a/examples/Blink/Blink/Blink.ino
+++ /dev/null
@@ -1,56 +0,0 @@
-/********************
-Arduino generic menu system
-control led on/off delays
-
-Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-
-output: Serial
-input: Serial
-mcu: nano328p
-*/
-
-#include
-#include
-#include
-#include
-
-using namespace Menu;
-
-#define LEDPIN LED_BUILTIN
-#define MAX_DEPTH 1
-
-int timeOn=10;
-int timeOff=90;
-
-MENU(mainMenu, "Blink menu", Menu::doNothing, Menu::noEvent, Menu::wrapStyle
- ,FIELD(timeOn,"On","ms",0,100,10,1, Menu::doNothing, Menu::noEvent, Menu::noStyle)
- ,FIELD(timeOff,"Off","ms",0,100,10,1,Menu::doNothing, Menu::noEvent, Menu::noStyle)
- ,EXIT("
-#include
-#include
-#include
-
-using namespace Menu;
-
-#define LEDPIN LED_BUILTIN
-#define MAX_DEPTH 1
-
-int timeOn=10;
-int timeOff=90;
-
-MENU(mainMenu, "Blink menu", Menu::doNothing, Menu::noEvent, Menu::wrapStyle
- ,FIELD(timeOn,"On","ms",0,100,10,1, Menu::doNothing, Menu::noEvent, Menu::noStyle)
- ,FIELD(timeOff,"Off","ms",0,100,10,1,Menu::doNothing, Menu::noEvent, Menu::noStyle)
- ,EXIT("
-#
-# Documentation:
-#
-# * Travis CI Embedded Builds with PlatformIO
-# < https://docs.travis-ci.com/user/integration/platformio/ >
-#
-# * PlatformIO integration with Travis CI
-# < http://docs.platformio.org/page/ci/travis.html >
-#
-# * User Guide for `platformio ci` command
-# < http://docs.platformio.org/page/userguide/cmd_ci.html >
-#
-#
-# Please choice one of the following templates (proposed below) and uncomment
-# it (remove "# " before each line) or use own configuration according to the
-# Travis CI documentation (see above).
-#
-
-
-#
-# Template #1: General project. Test it using existing `platformio.ini`.
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio run
-
-
-#
-# Template #2: The project is intended to by used as a library with examples
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# env:
-# - PLATFORMIO_CI_SRC=path/to/test/file.c
-# - PLATFORMIO_CI_SRC=examples/file.ino
-# - PLATFORMIO_CI_SRC=path/to/test/directory
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
diff --git a/examples/Confirm/Confirm/Confirm.ino b/examples/Confirm/Confirm/Confirm.ino
deleted file mode 100644
index af7635c8..00000000
--- a/examples/Confirm/Confirm/Confirm.ino
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-
-Custom sub-menu prompt used as exit confirmation
-the Exit option on this example presents only the "Exit" text
-but the submenu really as an "Exit?" text for confirmation
-choosing "Yes" will suspend the menu and possibly do other stuff
-while "Cancel" will just return to previous menu.
-
-*/
-
-#include
-#include
-#include
-
-using namespace Menu;
-
-//customizing a menu prompt look
-class confirmExit:public menu {
-public:
- confirmExit(constMEM menuNodeShadow& shadow):menu(shadow) {}
- Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t p) override {
- return idx<0?//idx will be -1 when printing a menu title or a valid index when printing as option
- menu::printTo(root,sel,out,idx,len,p)://when printing title
- out.printRaw((constText*)F("Exit"),len);//when printing as regular option
- }
-};
-
-// this function is defined below because we need to refer
-// to the navigation system (suspending the menu)
-result systemExit();
-
-//using the customized menu class
-//note that first parameter is the class name
-altMENU(confirmExit,subMenu,"Exit?",doNothing,noEvent,wrapStyle,(Menu::_menuData|Menu::_canNav)
- ,OP("Yes",systemExit,enterEvent)
- ,EXIT("Cancel")
-);
-
-MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
- ,OP("Op1",doNothing,noEvent)
- ,SUBMENU(subMenu)
-);
-
-#define MAX_DEPTH 2
-
-MENU_OUTPUTS(out,MAX_DEPTH
- ,SERIAL_OUT(Serial)
- ,NONE//must have 2 items at least
-);
-
-serialIn serial(Serial);
-NAVROOT(nav,mainMenu,MAX_DEPTH,serial,out);
-
-bool running=true;//lock menu if false
-
-result systemExit() {
- Serial.println();
- Serial.println("Terminating...");
- //do some termiination stuff here
- running=false;//prevents the menu from running again!
- Serial.println("done.");
- nav.idleOn();//suspend the menu system
- return quit;
-}
-
-void setup() {
- Serial.begin(115200);
- while(!Serial);
- Serial.println("menu 4.x custom sub-menu prompt example");Serial.flush();
-}
-
-void loop() {
- if (running) nav.poll();
- delay(100);//simulate a delay when other tasks are done
-}
diff --git a/examples/Confirm/platformio.ini b/examples/Confirm/platformio.ini
deleted file mode 100644
index d7211182..00000000
--- a/examples/Confirm/platformio.ini
+++ /dev/null
@@ -1,34 +0,0 @@
-; PlatformIO Project Configuration File
-;
-; Build options: build flags, source filter
-; Upload options: custom upload port, speed and extra flags
-; Library options: dependencies, extra library storages
-; Advanced options: extra scripting
-;
-; Please visit documentation for the other options and examples
-; http://docs.platformio.org/page/projectconf.html
-
-[platformio]
-src_dir=Confirm
-lib_dir=~/Arduino/Libraries
-
-[env:nanoatmega328]
-platform = atmelavr
-board = nanoatmega328
-framework = arduino
-upload_port=/dev/ttyUSB*
-upload_flags=-V
-build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined
-
-; [env:teensy31]
-; platform = teensy
-; board = teensy31
-; framework = arduino
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -Wno-switch
-
-; [env:esp12e]
-; platform = espressif8266
-; board = esp12e
-; framework = arduino
-; upload_speed=921600
-; build_flags = -Wno-comment -Wno-strict-aliasing -Wno-builtin-macro-redefined -DNODEBUG
diff --git a/examples/CustomPrompt/.gitignore b/examples/CustomPrompt/.gitignore
deleted file mode 100644
index 5dac9f52..00000000
--- a/examples/CustomPrompt/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.pioenvs
-.piolibdeps
-.clang_complete
-.gcc-flags.json
diff --git a/examples/CustomPrompt/.travis.yml b/examples/CustomPrompt/.travis.yml
deleted file mode 100644
index 2c4ff5c9..00000000
--- a/examples/CustomPrompt/.travis.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-# Continuous Integration (CI) is the practice, in software
-# engineering, of merging all developer working copies with a shared mainline
-# several times a day < http://docs.platformio.org/page/ci/index.html >
-#
-# Documentation:
-#
-# * Travis CI Embedded Builds with PlatformIO
-# < https://docs.travis-ci.com/user/integration/platformio/ >
-#
-# * PlatformIO integration with Travis CI
-# < http://docs.platformio.org/page/ci/travis.html >
-#
-# * User Guide for `platformio ci` command
-# < http://docs.platformio.org/page/userguide/cmd_ci.html >
-#
-#
-# Please choice one of the following templates (proposed below) and uncomment
-# it (remove "# " before each line) or use own configuration according to the
-# Travis CI documentation (see above).
-#
-
-
-#
-# Template #1: General project. Test it using existing `platformio.ini`.
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio run
-
-
-#
-# Template #2: The project is intended to by used as a library with examples
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# env:
-# - PLATFORMIO_CI_SRC=path/to/test/file.c
-# - PLATFORMIO_CI_SRC=examples/file.ino
-# - PLATFORMIO_CI_SRC=path/to/test/directory
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
diff --git a/examples/CustomPrompt/CustomPrompt/CustomPrompt.ino b/examples/CustomPrompt/CustomPrompt/CustomPrompt.ino
deleted file mode 100644
index 6e290c0c..00000000
--- a/examples/CustomPrompt/CustomPrompt/CustomPrompt.ino
+++ /dev/null
@@ -1,136 +0,0 @@
-/********************
-Aug. 2017 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-
-Self update custom field
-output: Serial
-input: Serial
-www.r-site.net
-
-***/
-#include
-#include
-#include
-
-using namespace Menu;
-
-#define LEDPIN LED_BUILTIN
-
-result myLedOn() {
- digitalWrite(LEDPIN, HIGH);
- return proceed;
-}
-result myLedOff() {
- digitalWrite(LEDPIN, LOW);
- return proceed;
-}
-
-
-//customizing a prompt look!
-//by extending the prompt class
-//this prompt will count seconds and update himself on the screen.
-class altPrompt:public prompt {
-public:
- unsigned int t=0;
- unsigned int last=0;
- altPrompt(constMEM promptShadow& p):prompt(p) {}
- Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t) override {
- last=t;
- return out.printRaw(String(t).c_str(),len);
- }
- virtual bool changed(const navNode &nav,const menuOut& out,bool sub=true) {
- t=millis()/1000;
- return last!=t;
- }
-};
-
-MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
- ,altOP(altPrompt,"",doNothing,noEvent)
- ,OP("LED On",myLedOn,enterEvent)
- ,OP("LED Off",myLedOff,enterEvent)
- ,EXIT(" will select first option on main menu,
- // then the second option (eventually a field)
- // and finally set the field value to 12 (or select 13th position on a menu)
- //
- // note that this is menu position starting at zero (not accel keys)
- // this is experimental API base for web interface
- // for(int c=0;c<3;c++) {//using the menu to blink the led
- // nav.async("/1");
- // delay(1000);
- // nav.async("/2");
- // delay(1000);
- // }
-
- //there is also the possibility of navigating the menu by calling api functions
- //this is however indicated if you have custom input devices
- //or building a driver for a new input.
-
- for(int c=0;c<10;c++) {//using the menu to blink the led
- nav.doNav(navCmd(idxCmd,1));
- nav.doNav(navCmd(enterCmd));
- delay(300);
- nav.doNav(navCmd(idxCmd,3));
- nav.doNav(navCmd(enterCmd));
- delay(300);
- }
-
-}
-
-void loop() {
-
- nav.poll();
-
-}
diff --git a/examples/CustomPrompt/platformio.ini b/examples/CustomPrompt/platformio.ini
deleted file mode 100644
index 23b8c14e..00000000
--- a/examples/CustomPrompt/platformio.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-; PlatformIO Project Configuration File
-;
-; Build options: build flags, source filter
-; Upload options: custom upload port, speed and extra flags
-; Library options: dependencies, extra library storages
-; Advanced options: extra scripting
-;
-; Please visit documentation for the other options and examples
-; http://docs.platformio.org/page/projectconf.html
-
-[platformio]
-src_dir=CustomPrompt
-lib_dir=~/Arduino/Libraries
-
-; [env:esp12e]
-; platform=espressif8266
-; board=esp12e
-; framework=arduino
-
-; [env:uno]
-; platform = atmelavr
-; board = uno
-; framework = arduino
-
-; [env:nanoatmega328]
-; platform = atmelavr
-; board = nanoatmega328
-; framework = arduino
-; upload_port=/dev/ttyUSB*
-; upload_flags=-V
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -DNODEBUG
-
-; [env:teensy31]
-; platform = teensy
-; board = teensy31
-; framework = arduino
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -Wno-switch -lstdc++
-
-[env:esp12e]
-platform = espressif8266
-board = esp12e
-framework = arduino
-upload_speed=921600
-build_flags = -Wno-comment -Wno-strict-aliasing -Wno-builtin-macro-redefined -DNODEBUG
diff --git a/examples/LCDs/LiquidCrystal/LiquidCrystal/LiquidCrystal.ino b/examples/LCDs/LiquidCrystal/LiquidCrystal/LiquidCrystal.ino
deleted file mode 100644
index e9fe9fc1..00000000
--- a/examples/LCDs/LiquidCrystal/LiquidCrystal/LiquidCrystal.ino
+++ /dev/null
@@ -1,212 +0,0 @@
-#include
-
-/********************
-Sept. 2014 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-
-menu output to standard arduino LCD (LiquidCrystal)
-output: LCD
-input: encoder and Serial
-www.r-site.net
-***/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-using namespace Menu;
-
-// LCD /////////////////////////////////////////
-#define RS 8
-#define RW 3
-#define EN 9
-LiquidCrystal lcd(RS, RW, EN, 4, 5, 6, 7);
-
-// Encoder /////////////////////////////////////
-#define encA A2
-#define encB A1
-//this encoder has a button here
-#define encBtn A3
-
-encoderIn encoder;//simple quad encoder driver
-encoderInStream encStream(encoder,4);// simple quad encoder fake Stream
-
-//a keyboard with only one key as the encoder button
-keyMap encBtn_map[]={{-encBtn,defaultNavCodes[enterCmd].ch}};//negative pin numbers use internal pull-up, this is on when low
-keyIn<1> encButton(encBtn_map);//1 is the number of keys
-
-//input from the encoder + encoder button + serial
-serialIn serial(Serial);
-menuIn* inputsList[]={&encStream,&encButton,&serial};
-chainStream<3> in(inputsList);//3 is the number of inputs
-
-#define LEDPIN 13
-
-result doAlert(eventMask e, prompt &item);
-
-result showEvent(eventMask e,navNode& nav,prompt& item) {
- Serial.print("event: ");
- Serial.println(e);
- return proceed;
-}
-
-int test=55;
-
-result action1(eventMask e,navNode& nav, prompt &item) {
- Serial.print("action1 event: ");
- Serial.print(e);
- Serial.println(", proceed menu");
- Serial.flush();
- return proceed;
-}
-
-result action2(eventMask e,navNode& nav, prompt &item) {
- Serial.print("action2 event: ");
- Serial.print(e);
- Serial.print(", quiting menu.");
- Serial.flush();
- return quit;
-}
-
-int ledCtrl=LOW;
-
-result myLedOn() {
- ledCtrl=HIGH;
- return proceed;
-}
-result myLedOff() {
- ledCtrl=LOW;
- return proceed;
-}
-
-TOGGLE(ledCtrl,setLed,"Led: ",doNothing,noEvent,noStyle//,doExit,enterEvent,noStyle
- ,VALUE("On",HIGH,doNothing,noEvent)
- ,VALUE("Off",LOW,doNothing,noEvent)
-);
-
-int selTest=0;
-SELECT(selTest,selMenu,"Select",doNothing,noEvent,noStyle
- ,VALUE("Zero",0,doNothing,noEvent)
- ,VALUE("One",1,doNothing,noEvent)
- ,VALUE("Two",2,doNothing,noEvent)
-);
-
-int chooseTest=-1;
-CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
- ,VALUE("First",1,doNothing,noEvent)
- ,VALUE("Second",2,doNothing,noEvent)
- ,VALUE("Third",3,doNothing,noEvent)
- ,VALUE("Last",-1,doNothing,noEvent)
-);
-
-//customizing a prompt look!
-//by extending the prompt class
-class altPrompt:public prompt {
-public:
- altPrompt(constMEM promptShadow& p):prompt(p) {}
- Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t) override {
- return out.printRaw(F("special prompt!"),len);;
- }
-};
-
-MENU(subMenu,"Sub-Menu",showEvent,anyEvent,noStyle
- ,OP("Sub1",showEvent,anyEvent)
- ,OP("Sub2",showEvent,anyEvent)
- ,OP("Sub3",showEvent,anyEvent)
- ,altOP(altPrompt,"",showEvent,anyEvent)
- ,EXIT("
-
-/********************
-Arduino generic menu system
-Arduino menu on I2C LCD example
-http://www.r-site.net/?at=//op%5B%40id=%273090%27%5D
-
-Sep.2014 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-
-LCD library:
-https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home
-http://playground.arduino.cc/Code/LCD3wires
-*/
-#ifndef ARDUINO_SAM_DUE
-
- #include
- #include //F. Malpartida LCD's driver
- #include //menu macros and objects
- #include //malpartidas lcd menu output
- #include //Serial input
- #include //quadrature encoder driver and fake stream
- #include //keyboard driver and fake stream (for the encoder button)
- #include // concatenate multiple input streams (this allows adding a button to the encoder)
-
- using namespace Menu;
-
- //LiquidCrystal_I2C lcd(0x27);//, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
- LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address and pinout
-
- // Encoder /////////////////////////////////////
- #define encA 2
- #define encB 3
- //this encoder has a button here
- #define encBtn 4
-
- encoderIn encoder;//simple quad encoder driver
- #define ENC_SENSIVITY 4
- encoderInStream encStream(encoder,ENC_SENSIVITY);// simple quad encoder fake Stream
-
- //a keyboard with only one key as the encoder button
- keyMap encBtn_map[]={{-encBtn,defaultNavCodes[enterCmd].ch}};//negative pin numbers use internal pull-up, this is on when low
- keyIn<1> encButton(encBtn_map);//1 is the number of keys
-
- serialIn serial(Serial);
-
- //input from the encoder + encoder button + serial
- menuIn* inputsList[]={&encStream,&encButton,&serial};
- chainStream<3> in(inputsList);//3 is the number of inputs
-
- #define LEDPIN A3
-
- result doAlert(eventMask e, prompt &item);
-
- result showEvent(eventMask e,navNode& nav,prompt& item) {
- Serial.print("event: ");
- Serial.println(e);
- return proceed;
- }
-
- int test=55;
-
- result action1(eventMask e,navNode& nav, prompt &item) {
- Serial.print("action1 event: ");
- Serial.print(e);
- Serial.println(", proceed menu");
- Serial.flush();
- return proceed;
- }
-
- result action2(eventMask e,navNode& nav, prompt &item) {
- Serial.print("action2 event: ");
- Serial.print(e);
- Serial.println(", quiting menu.");
- Serial.flush();
- return quit;
- }
-
- int ledCtrl=LOW;
-
- result myLedOn() {
- ledCtrl=HIGH;
- return proceed;
- }
- result myLedOff() {
- ledCtrl=LOW;
- return proceed;
- }
-
- TOGGLE(ledCtrl,setLed,"Led: ",doNothing,noEvent,noStyle//,doExit,enterEvent,noStyle
- ,VALUE("On",HIGH,doNothing,noEvent)
- ,VALUE("Off",LOW,doNothing,noEvent)
- );
-
- int selTest=0;
- SELECT(selTest,selMenu,"Select",doNothing,noEvent,noStyle
- ,VALUE("Zero",0,doNothing,noEvent)
- ,VALUE("One",1,doNothing,noEvent)
- ,VALUE("Two",2,doNothing,noEvent)
- );
-
- int chooseTest=-1;
- CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
- ,VALUE("First",1,doNothing,noEvent)
- ,VALUE("Second",2,doNothing,noEvent)
- ,VALUE("Third",3,doNothing,noEvent)
- ,VALUE("Last",-1,doNothing,noEvent)
- );
-
- //customizing a prompt look!
- //by extending the prompt class
- class altPrompt:public prompt {
- public:
- altPrompt(constMEM promptShadow& p):prompt(p) {}
- Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t) override {
- return out.printRaw(F("special prompt!"),len);;
- }
- };
-
- MENU(subMenu,"Sub-Menu",showEvent,anyEvent,noStyle
- ,OP("Sub1",showEvent,anyEvent)
- ,OP("Sub2",showEvent,anyEvent)
- ,OP("Sub3",showEvent,anyEvent)
- ,altOP(altPrompt,"",showEvent,anyEvent)
- ,EXIT("
-
-/********************
-Arduino generic menu system
-
-Sep.2017 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-
-LCD library:
-Matthias Hertel driver https://github.com/mathertel/LiquidCrystal_PCF8574
-
-Output: I2C LCD
-Inpout: encoder + serial
-*/
-#include
-#include
-#include //menu macros and objects
-#include //arduino I2C LCD
-#include //quadrature encoder driver and fake stream
-#include //keyboard driver and fake stream (for the encoder button)
-#include // concatenate multiple input streams (this allows adding a button to the encoder)
-#include
-
-using namespace Menu;
-
-//using Matthias Hertel driver https://github.com/mathertel/LiquidCrystal_PCF8574
-LiquidCrystal_PCF8574 lcd(0x27); // set the LCD address to 0x27 for a 16 chars and 2 line display
-
-// Encoder /////////////////////////////////////
-#define encA 2
-#define encB 3
-//this encoder has a button here
-#define encBtn 4
-
-encoderIn encoder;//simple quad encoder driver
-#define ENC_SENSIVITY 4
-encoderInStream encStream(encoder,ENC_SENSIVITY);// simple quad encoder fake Stream
-
-//a keyboard with only one key as the encoder button
-keyMap encBtn_map[]={{-encBtn,defaultNavCodes[enterCmd].ch}};//negative pin numbers use internal pull-up, this is on when low
-keyIn<1> encButton(encBtn_map);//1 is the number of keys
-
-//input from the encoder + encoder button + serial
-serialIn serial(Serial);
-menuIn* inputsList[]={&encStream,&encButton,&serial};
-chainStream<3> in(inputsList);//3 is the number of inputs
-
-#define LEDPIN A3
-
-result doAlert(eventMask e, prompt &item);
-
-result showEvent(eventMask e,navNode& nav,prompt& item) {
- Serial.print("event: ");
- Serial.println(e);
- return proceed;
-}
-
-int test=55;
-
-result action1(eventMask e,navNode& nav, prompt &item) {
- Serial.print("action1 event: ");
- Serial.print(e);
- Serial.println(", proceed menu");
- Serial.flush();
- return proceed;
-}
-
-result action2(eventMask e,navNode& nav, prompt &item) {
- Serial.print("action2 event: ");
- Serial.print(e);
- Serial.println(", quiting menu.");
- Serial.flush();
- return quit;
-}
-
-int ledCtrl=LOW;
-
-result myLedOn() {
- ledCtrl=HIGH;
- return proceed;
-}
-result myLedOff() {
- ledCtrl=LOW;
- return proceed;
-}
-
-TOGGLE(ledCtrl,setLed,"Led: ",doNothing,noEvent,noStyle//,doExit,enterEvent,noStyle
- ,VALUE("On",HIGH,doNothing,noEvent)
- ,VALUE("Off",LOW,doNothing,noEvent)
-);
-
-int selTest=0;
-SELECT(selTest,selMenu,"Select",doNothing,noEvent,noStyle
- ,VALUE("Zero",0,doNothing,noEvent)
- ,VALUE("One",1,doNothing,noEvent)
- ,VALUE("Two",2,doNothing,noEvent)
-);
-
-int chooseTest=-1;
-CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
- ,VALUE("First",1,doNothing,noEvent)
- ,VALUE("Second",2,doNothing,noEvent)
- ,VALUE("Third",3,doNothing,noEvent)
- ,VALUE("Last",-1,doNothing,noEvent)
-);
-
-//customizing a prompt look!
-//by extending the prompt class
-class altPrompt:public prompt {
-public:
- altPrompt(constMEM promptShadow& p):prompt(p) {}
- Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t) override {
- return out.printRaw(F("special prompt!"),len);
- }
-};
-
-MENU(subMenu,"Sub-Menu",showEvent,anyEvent,noStyle
- ,OP("Sub1",showEvent,anyEvent)
- ,OP("Sub2",showEvent,anyEvent)
- ,OP("Sub3",showEvent,anyEvent)
- ,altOP(altPrompt,"",showEvent,anyEvent)
- ,EXIT("
-#include "OzOLED.h"
-
-#include
-#include
-#include
-using namespace Menu;
-
-//Redefine already existing object
-#define oled OzOled
-
-result doAlert(eventMask e, prompt &item);
-
-result showEvent(eventMask e,navNode& nav,prompt& item) {
- Serial.print("event: ");
- Serial.println(e);
- return proceed;
-}
-
-int test=55;
-
-result action1(eventMask e) {
- Serial.print(e);
- Serial.println(" action1 executed, proceed menu");Serial.flush();
- return proceed;
-}
-
-result action2(eventMask e,navNode& nav, prompt &item) {
- Serial.print(e);
- Serial.println(" action2 executed, quiting menu");
- return quit;
-}
-
-int ledCtrl=LOW;
-
-result ledOn() {
- ledCtrl=HIGH;
- return proceed;
-}
-result ledOff() {
- ledCtrl=LOW;
- return proceed;
-}
-
-TOGGLE(ledCtrl,setLed,"Led: ",doNothing,noEvent,noStyle//,doExit,enterEvent,noStyle
- ,VALUE("On",HIGH,doNothing,noEvent)
- ,VALUE("Off",LOW,doNothing,noEvent)
-);
-
-int selTest=0;
-SELECT(selTest,selMenu,"Select",doNothing,noEvent,noStyle
- ,VALUE("Zero",0,doNothing,noEvent)
- ,VALUE("One",1,doNothing,noEvent)
- ,VALUE("Two",2,doNothing,noEvent)
-);
-
-int chooseTest=-1;
-CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
- ,VALUE("First",1,doNothing,noEvent)
- ,VALUE("Second",2,doNothing,noEvent)
- ,VALUE("Third",3,doNothing,noEvent)
- ,VALUE("Last",-1,doNothing,noEvent)
-);
-
-//customizing a prompt look!
-//by extending the prompt class
-class altPrompt:public prompt {
-public:
- altPrompt(constMEM promptShadow& p):prompt(p) {}
- Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t) override {
- return out.printRaw(F("special prompt!"),len);
- }
-};
-
-MENU(subMenu,"Sub-Menu",showEvent,anyEvent,noStyle
- ,OP("Sub1",showEvent,anyEvent)
- ,OP("Sub2",showEvent,anyEvent)
- ,OP("Sub3",showEvent,anyEvent)
- ,altOP(altPrompt,"",showEvent,anyEvent)
- ,EXIT("
-#include
-#include
-#include
-#include
-
-using namespace Menu;
-
-//from: https://www.arduino.cc/en/Tutorial/listfiles
-// The circuit:
-// * SD card attached to SPI bus as follows:
-// ** MOSI - pin 11
-// ** MISO - pin 12
-// ** CLK - pin 13
-// ** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)
-//this is for my due tft+sd shield
-#define SDCARD_SS 53
-
-//function to handle file select
-// declared here and implemented bellow because we need
-// to give it as event handler for `filePickMenu`
-// and we also need to refer to `filePickMenu` inside the function
-result filePick(eventMask event, navNode& nav, prompt &item);
-
-
-// SDMenu filePickMenu("SD Card","/",filePick,enterEvent);
-//caching 32 file entries
-CachedSDMenu<32> filePickMenu("SD Card","/",filePick,enterEvent);
-
-//implementing the handler here after filePick is defined...
-result filePick(eventMask event, navNode& nav, prompt &item) {
- // switch(event) {//for now events are filtered only for enter, so we dont need this checking
- // case enterCmd:
- if (nav.root->navFocus==(navTarget*)&filePickMenu) {
- Serial.println();
- Serial.print("selected file:");
- Serial.println(filePickMenu.selectedFile);
- Serial.print("from folder:");
- Serial.println(filePickMenu.selectedFolder);
- }
- // break;
- // }
- return proceed;
-}
-
-#define MAX_DEPTH 2
-
-MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
- ,SUBMENU(filePickMenu)
- ,OP("Something else...",doNothing,noEvent)
- ,EXIT("=nextPool) {
- nav.poll();
- nextPool=now+1000/menuFPS;
- }
-}
diff --git a/examples/SSD1306Ascii/.gitignore b/examples/SSD1306Ascii/.gitignore
deleted file mode 100644
index 5dac9f52..00000000
--- a/examples/SSD1306Ascii/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.pioenvs
-.piolibdeps
-.clang_complete
-.gcc-flags.json
diff --git a/examples/SSD1306Ascii/.travis.yml b/examples/SSD1306Ascii/.travis.yml
deleted file mode 100644
index 2c4ff5c9..00000000
--- a/examples/SSD1306Ascii/.travis.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-# Continuous Integration (CI) is the practice, in software
-# engineering, of merging all developer working copies with a shared mainline
-# several times a day < http://docs.platformio.org/page/ci/index.html >
-#
-# Documentation:
-#
-# * Travis CI Embedded Builds with PlatformIO
-# < https://docs.travis-ci.com/user/integration/platformio/ >
-#
-# * PlatformIO integration with Travis CI
-# < http://docs.platformio.org/page/ci/travis.html >
-#
-# * User Guide for `platformio ci` command
-# < http://docs.platformio.org/page/userguide/cmd_ci.html >
-#
-#
-# Please choice one of the following templates (proposed below) and uncomment
-# it (remove "# " before each line) or use own configuration according to the
-# Travis CI documentation (see above).
-#
-
-
-#
-# Template #1: General project. Test it using existing `platformio.ini`.
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio run
-
-
-#
-# Template #2: The project is intended to by used as a library with examples
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# env:
-# - PLATFORMIO_CI_SRC=path/to/test/file.c
-# - PLATFORMIO_CI_SRC=examples/file.ino
-# - PLATFORMIO_CI_SRC=path/to/test/directory
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
diff --git a/examples/SSD1306Ascii/Button_Navigation/Button_Navigation.ino b/examples/SSD1306Ascii/Button_Navigation/Button_Navigation.ino
deleted file mode 100644
index 99bbc3eb..00000000
--- a/examples/SSD1306Ascii/Button_Navigation/Button_Navigation.ino
+++ /dev/null
@@ -1,229 +0,0 @@
-/**************************************************************************
- Sketch: MENU NAVIGATION WITH JUST 4 BUTTONS
-
- This Sketch displays Menu without any Serial Communication and the
- navigation is performed by 4 buttons attached to D3, D8, D4 and D1.
- Also, attach led on D11 to control brightness from menu.
- Default brightness is 15% (check line 78)
-
- NOTE: By default, navigation buttons use INTERNAL_PULLUP feature.
- This can be changed by commenting the line 45 in "config.h" file
-
- Uses SSD1306Ascii Library(https://github.com/greiman/SSD1306Ascii)
- by Bill Grieman
-
- Created by Tamojit Saha
- Github: https://github.com/TamojitSaha
- Website: https://www.tamojitsaha.info/
-***************************************************************************/
-#include
-
-// #include
-#include "SSD1306Ascii.h"
-#include "SSD1306AsciiWire.h"
-
-#include
-#include
-#include
-//#include
-using namespace Menu;
-
-SSD1306AsciiWire oled;
-
-#include "config.h"
-
-int ledCtrl = HIGH; //Default LED State of LED at D11 is LOW
-
-result doAlert(eventMask e, prompt &item);
-
-result showEvent(eventMask e, navNode& nav, prompt& item) {
-
- return proceed;
-}
-
-
-
-result action1(eventMask e) {
-
- return proceed;
-}
-
-result action2(eventMask e, navNode& nav, prompt &item) {
- //Serial.print(e);
- //Serial.println(" action2 executed, quiting menu");
- return quit;
-}
-
-
-result ledOn() {
- ledCtrl = HIGH;
- analogWrite(LED_PIN, 255);
- return proceed;
-}
-result ledOff() {
- ledCtrl = LOW;
- analogWrite(LED_PIN, 0);
- return proceed;
-}
-
-
-result internalLedOn() {
- digitalWrite(LED_BUILTIN, HIGH);
- return proceed;
-}
-result internalLedOff() {
- analogWrite(LED_BUILTIN, LOW);
- return proceed;
-}
-
-int brightnessValue = 15; //Default LED brightness value
-result adjustBrightness() {
- if (ledCtrl == HIGH) {
- int pwm = int(2.55 * float(brightnessValue));
- analogWrite(LED_PIN, pwm);
- }
-}
-
-
-TOGGLE(ledCtrl, setLed, "Led: ", doNothing, noEvent, noStyle //,doExit,enterEvent,noStyle
- , VALUE("On", HIGH, ledOn, enterEvent)//ledOn function is called
- , VALUE("Off", LOW, ledOff, enterEvent)//ledOff function is called
- );
-
-int selTest = 0;
-SELECT(selTest, selMenu, "Select", doNothing, noEvent, noStyle
- , VALUE("Zero", 0, doNothing, noEvent)
- , VALUE("One", 1, doNothing, noEvent)
- , VALUE("Two", 2, doNothing, noEvent)
- );
-
-int chooseTest = -1;
-CHOOSE(chooseTest, chooseMenu, "Choose", doNothing, noEvent, noStyle
- , VALUE("First", 1, doNothing, noEvent)
- , VALUE("Second", 2, doNothing, noEvent)
- , VALUE("Third", 3, doNothing, noEvent)
- , VALUE("Last", -1, doNothing, noEvent)
- );
-
-//customizing a prompt look!
-//by extending the prompt class
-class altPrompt: public prompt {
- public:
- altPrompt(constMEM promptShadow& p): prompt(p) {}
- Used printTo(navRoot &root, bool sel, menuOut& out, idx_t idx, idx_t len, idx_t) override {
- return out.printRaw(F("special prompt!"), len);
- }
-};
-
-MENU(subMenu, "Sub-Menu", showEvent, anyEvent, noStyle
- , OP("Sub1", showEvent, anyEvent)
- , OP("Sub2", showEvent, anyEvent)
- , OP("Sub3", showEvent, anyEvent)
- , altOP(altPrompt, "", showEvent, anyEvent)
- , EXIT(" joystickBtns(joystickBtn_map);//the input driver
-#else
-//build a map of keys to menu commands
-keyMap joystickBtn_map[] = {
- { BTN_SEL, defaultNavCodes[enterCmd].ch} ,
- { BTN_UP, defaultNavCodes[upCmd].ch} ,
- { BTN_DOWN, defaultNavCodes[downCmd].ch} ,
- { BTN_ESC, defaultNavCodes[escCmd].ch},
-};
-keyIn joystickBtns(joystickBtn_map);//the input driver
-#endif
-
-NAVROOT(nav, mainMenu, MAX_DEPTH, joystickBtns, out);
-
-result alert(menuOut& o, idleEvent e) {
- if (e == idling) {
- o.setCursor(0, 0);
- o.print("alert test");
- o.setCursor(0, 1);
- o.print("press [select]");
- o.setCursor(0, 2);
- o.print("to continue...");
- }
- return proceed;
-}
-
-result doAlert(eventMask e, prompt &item) {
- nav.idleOn(alert);
- return proceed;
-}
-
-//when menu is suspended
-result idle(menuOut &o, idleEvent e) {
- o.clear();
- switch (e) {
- case idleStart: o.println("suspending menu!"); break;
- case idling: o.println("suspended..."); break;
- case idleEnd: o.println("resuming menu."); break;
- }
- return proceed;
-}
-
-void setup() {
- joystickBtns.begin();
- pinMode(LED_PIN, OUTPUT);
- pinMode(LED_BUILTIN, OUTPUT);
- Wire.begin();
- oled.begin(&Adafruit128x64, OLED_I2C_ADDRESS); //check config
- oled.setFont(menuFont);
- oled.clear();
- nav.idleTask = idle; //point a function to be used when menu is suspended
-}
-
-void loop() {
- nav.poll();
- delay(1);//simulate a delay when other tasks are done
-}
diff --git a/examples/SSD1306Ascii/Button_Navigation/config.h b/examples/SSD1306Ascii/Button_Navigation/config.h
deleted file mode 100644
index 7a414c41..00000000
--- a/examples/SSD1306Ascii/Button_Navigation/config.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*config.h*/
-
-/* List of Supported Fonts
- *
- Arial14,
- Arial_bold_14,
- Callibri11,
- Callibri11_bold,
- Callibri11_italic,
- Callibri15,
- Corsiva_12,
- fixed_bold10x15,
- font5x7, //Do not use in LARGE_FONT, can use as default font
- font8x8,
- Iain5x7, //Do not use in LARGE_FONT, can use as default font
- lcd5x7, //Do not use in LARGE_FONT, can use as default font
- Stang5x7, //Do not use in LARGE_FONT, can use as default font
- System5x7, //Do not use in LARGE_FONT, can use as default font
- TimesNewRoman16,
- TimesNewRoman16_bold,
- TimesNewRoman16_italic,
- utf8font10x16,
- Verdana12,
- Verdana12_bold,
- Verdana12_italic,
- X11fixed7x14,
- X11fixed7x14B,
- ZevvPeep8x16
- *
- */
-
-#define OLED_I2C_ADDRESS 0x3C //Defined OLED I2C Address
-
-/*
- * Define your font from the list.
- * Default font: lcd5x7
- * Comment out the following for using the default font.
- */
-#define LARGE_FONT Verdana12
-
-//Navigate buttons
-#define BTN_SEL 3 // Select button
-#define BTN_UP 8 // Up Button
-#define BTN_DOWN 4 // Down Button
-#define BTN_ESC 1 // Exit Button
-// Comment the following to disable internal pullup for Navigate buttons
-#define NAV_BUTTONS_INPUT_PULLUP
-
-#define TOTAL_NAV_BUTTONS 4 // Total Navigation Button used
-
-/*Demonstrate PWM with LED on D11*/
-#define LED_PIN 11 //Defined LED Pin to D11
-
-#define MAX_DEPTH 2
-
-#ifdef LOC
-// #define LARGE_FONT
-#define INV
-#endif
-
- /*Do not change the values(recomended)*/
-#ifdef LARGE_FONT
-#define menuFont LARGE_FONT
-#define fontW 8
-#define fontH 16
-#else
-// #define menuFont System5x7
-#define menuFont lcd5x7
-#define fontW 5
-#define fontH 8
-#endif
diff --git a/examples/SSD1306Ascii/SSD1306Ascii/SSD1306Ascii.ino b/examples/SSD1306Ascii/SSD1306Ascii/SSD1306Ascii.ino
deleted file mode 100644
index 33f855d4..00000000
--- a/examples/SSD1306Ascii/SSD1306Ascii/SSD1306Ascii.ino
+++ /dev/null
@@ -1,227 +0,0 @@
-/* List of Supported Fonts
-
- Arial14,
- Arial_bold_14,
- Callibri11,
- Callibri11_bold,
- Callibri11_italic,
- Callibri15,
- Corsiva_12,
- fixed_bold10x15,
- font5x7,
- font8x8,
- Iain5x7,
- lcd5x7,
- Stang5x7,
- System5x7,
- TimesNewRoman16,
- TimesNewRoman16_bold,
- TimesNewRoman16_italic,
- utf8font10x16,
- Verdana12,
- Verdana12_bold,
- Verdana12_italic,
- X11fixed7x14,
- X11fixed7x14B,
- ZevvPeep8x16
-
-*/
-
-//Library Dependency : SSD1306Ascii by Bill Greiman
-//Link : https://github.com/greiman/SSD1306Ascii
-// Modified sketch by Tamojit Saha(https://github.com/TamojitSaha)
-
-
-#include
-
-constexpr int OLED_SDA=4;
-constexpr int OLED_SDC=5;
-
-#define I2C_ADDRESS 0x3C
-// #include
-#include "SSD1306Ascii.h"
-#include "SSD1306AsciiWire.h"
-
-#include
-#include
-#include
-//enable this include if using esp8266
-// #include
-using namespace Menu;
-
-//Define your font here. Default font: lcd5x7
-#define menuFont X11fixed7x14
-#define fontW 7
-#define fontH 15
-
-// #define menuFont System5x7
-// #define menuFont lcd5x7
-// #define fontW 5
-// #define fontH 8
-
-SSD1306AsciiWire oled;
-
-result doAlert(eventMask e, prompt &item);
-
-result showEvent(eventMask e, navNode& nav, prompt& item) {
- Serial.print("event: ");
- Serial.println(e);
- return proceed;
-}
-
-int test = 55;
-
-result action1(eventMask e) {
- Serial.print(e);
- Serial.println(" action1 executed, proceed menu"); Serial.flush();
- trace(if (e == enterEvent) oled.clear(0, oled.displayWidth(), 2, 3));
- return proceed;
-}
-
-result action2(eventMask e, navNode& nav, prompt &item) {
- Serial.print(e);
- Serial.println(" action2 executed, quiting menu");
- return quit;
-}
-
-int ledCtrl = LOW;
-
-result myLedOn() {
- ledCtrl = HIGH;
- return proceed;
-}
-result myLedOff() {
- ledCtrl = LOW;
- return proceed;
-}
-
-TOGGLE(ledCtrl, setLed, "Led: ", doNothing, noEvent, noStyle //,doExit,enterEvent,noStyle
- , VALUE("On", HIGH, doNothing, noEvent)
- , VALUE("Off", LOW, doNothing, noEvent)
- );
-
-int selTest = 0;
-SELECT(selTest, selMenu, "Select", doNothing, noEvent, noStyle
- , VALUE("Zero", 0, doNothing, noEvent)
- , VALUE("One", 1, doNothing, noEvent)
- , VALUE("Two", 2, doNothing, noEvent)
- );
-
-int chooseTest = -1;
-CHOOSE(chooseTest, chooseMenu, "Choose", doNothing, noEvent, noStyle
- , VALUE("First", 1, doNothing, noEvent)
- , VALUE("Second", 2, doNothing, noEvent)
- , VALUE("Third", 3, doNothing, noEvent)
- , VALUE("Last", -1, doNothing, noEvent)
- );
-
-//customizing a prompt look!
-//by extending the prompt class
-class altPrompt: public prompt {
- public:
- altPrompt(constMEM promptShadow& p): prompt(p) {}
- Used printTo(navRoot &root, bool sel, menuOut& out, idx_t idx, idx_t len, idx_t) override {
- return out.printRaw(F( "special prompt!"), len);
- }
-};
-
-MENU(subMenu, "Sub-Menu", showEvent, anyEvent, noStyle
- , OP("Sub1", showEvent, anyEvent)
- , OP("Sub2", showEvent, anyEvent)
- , OP("Sub3", showEvent, anyEvent)
- , altOP(altPrompt, "", showEvent, anyEvent)
- , EXIT(">3) ); //oled output device menu driver
-menuOut* constMEM outputs[] MEMMODE = {&outOLED, &outSerial}; //list of output devices
-outputsList out(outputs, sizeof(outputs) / sizeof(menuOut*)); //outputs list
-
-//macro to create navigation control root object (nav) using mainMenu
-serialIn serial(Serial);
-NAVROOT(nav, mainMenu, MAX_DEPTH, serial, out);
-
-result alert(menuOut& o, idleEvent e) {
- if (e == idling) {
- o.setCursor(0, 0);
- o.print("alert test");
- o.setCursor(0, 1);
- o.print("press [select]");
- o.setCursor(0, 2);
- o.print("to continue...");
- }
- return proceed;
-}
-
-result doAlert(eventMask e, prompt &item) {
- nav.idleOn(alert);
- return proceed;
-}
-
-//when menu is suspended
-result idle(menuOut &o, idleEvent e) {
- o.clear();
- if (&o==&outOLED) {
- if (e==idling) {
- o.println("OLED");
- o.println("Suspended menu");
- }
- } else
- switch (e) {
- case idleStart: o.println("suspending menu!"); break;
- case idling: o.println("suspended..."); break;
- case idleEnd: o.println("resuming menu."); break;
- }
- return proceed;
-}
-
-void setup() {
- Serial.begin(115200);
- while (!Serial);
- Serial.println("menu 4.x test"); Serial.flush();
- pinMode(A0, INPUT);
- Wire.begin();
- oled.begin(&Adafruit128x64, I2C_ADDRESS);
- oled.setFont(menuFont);
-
- oled.clear();
- oled.setCursor(0, 0);
- oled.print("menu 4.x test");
- oled.setCursor(0, 2);
- oled.print("SSD1306Ascii");
- delay(2000);
- oled.clear();
- nav.idleTask = idle; //point a function to be used when menu is suspended
-}
-
-void loop() {
- //if (!digitalRead(A0)) action1(enterEvent);
- nav.poll();
- delay(100);//simulate a delay when other tasks are done
-}
diff --git a/examples/SSD1306Ascii/platformio.ini b/examples/SSD1306Ascii/platformio.ini
deleted file mode 100644
index a3b6b3a7..00000000
--- a/examples/SSD1306Ascii/platformio.ini
+++ /dev/null
@@ -1,43 +0,0 @@
-; PlatformIO Project Configuration File
-;
-; Build options: build flags, source filter
-; Upload options: custom upload port, speed and extra flags
-; Library options: dependencies, extra library storages
-; Advanced options: extra scripting
-;
-; Please visit documentation for the other options and examples
-; http://docs.platformio.org/page/projectconf.html
-
-[platformio]
-; src_dir=Button_Navigation
-src_dir=SSD1306Ascii
-
-[env:nanoatmega328]
-platform = atmelavr
-board = nanoatmega328
-framework = arduino
-upload_port=/dev/ttyUSB*
-upload_flags=-V
-upload_speed=57600
-build_flags = -DMENU_DEBUG
-src_build_flags = !echo "-Wno-write-strings -Wno-reorder -fno-strict-aliasing -DLOC="$PLATFORMIO_LOC
-
-; [env:teensy31]
-; platform = teensy
-; board = teensy31
-; framework = arduino
-;; build_flags = -lstdc++
-
-; [env:esp12e]
-; platform = espressif8266
-; board = esp12e
-; framework = arduino
-; upload_speed=921600
-; build_flags = -lstdc++ -DDEBUG
-
-; [env:wemos]
-; platform = espressif8266
-; board = d1_mini_pro
-; framework = arduino
-; ; upload_speed=1500000
-; upload_speed=921600
diff --git a/examples/SdFat/SdFat/SdFat.ino b/examples/SdFat/SdFat/SdFat.ino
deleted file mode 100644
index 27e3c832..00000000
--- a/examples/SdFat/SdFat/SdFat.ino
+++ /dev/null
@@ -1,76 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-//enable this include if using esp8266
-#include
-
-using namespace Menu;
-
-//esp8266 SS (wemos mini)
-#define SDCARD_SS SS
-SdFat sd;
-
-//function to handle file select
-// declared here and implemented bellow because we need
-// to give it as event handler for `filePickMenu`
-// and we also need to refer to `filePickMenu` inside the function
-result filePick(eventMask event, navNode& nav, prompt &item);
-
-
-SDMenuT> filePickMenu(sd,"SD Card","/",filePick,enterEvent);
-
-//implementing the handler here after filePick is defined...
-result filePick(eventMask event, navNode& nav, prompt &item) {
- // switch(event) {//for now events are filtered only for enter, so we dont need this checking
- // case enterCmd:
- if (nav.root->navFocus==(navTarget*)&filePickMenu) {
- Serial.println();
- Serial.print("selected file:");
- Serial.println(filePickMenu.selectedFile);
- Serial.print("from folder:");
- Serial.println(filePickMenu.selectedFolder);
- }
- // break;
- // }
- return proceed;
-}
-
-#define MAX_DEPTH 2
-
-MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
- ,SUBMENU(filePickMenu)
- ,OP("Something else...",doNothing,noEvent)
- ,EXIT("=nextPool) {
- nav.poll();
- nextPool=now+1000/menuFPS;
- }
-}
diff --git a/examples/Serial/ansiSerial/.gitignore b/examples/Serial/ansiSerial/.gitignore
deleted file mode 100644
index e05273b2..00000000
--- a/examples/Serial/ansiSerial/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.pioenvs
-.clang_complete
-.gcc-flags.json
-.piolibdeps
\ No newline at end of file
diff --git a/examples/Serial/ansiSerial/.travis.yml b/examples/Serial/ansiSerial/.travis.yml
deleted file mode 100644
index 72c6e43f..00000000
--- a/examples/Serial/ansiSerial/.travis.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-# Continuous Integration (CI) is the practice, in software
-# engineering, of merging all developer working copies with a shared mainline
-# several times a day < http://docs.platformio.org/en/stable/ci/index.html >
-#
-# Documentation:
-#
-# * Travis CI Embedded Builds with PlatformIO
-# < https://docs.travis-ci.com/user/integration/platformio/ >
-#
-# * PlatformIO integration with Travis CI
-# < http://docs.platformio.org/en/stable/ci/travis.html >
-#
-# * User Guide for `platformio ci` command
-# < http://docs.platformio.org/en/stable/userguide/cmd_ci.html >
-#
-#
-# Please choice one of the following templates (proposed below) and uncomment
-# it (remove "# " before each line) or use own configuration according to the
-# Travis CI documentation (see above).
-#
-
-
-#
-# Template #1: General project. Test it using existing `platformio.ini`.
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio run
-
-
-#
-# Template #2: The project is intended to by used as a library with examples
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# env:
-# - PLATFORMIO_CI_SRC=path/to/test/file.c
-# - PLATFORMIO_CI_SRC=examples/file.ino
-# - PLATFORMIO_CI_SRC=path/to/test/directory
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
diff --git a/examples/Serial/ansiSerial/ansiSerial/ansiSerial.ino b/examples/Serial/ansiSerial/ansiSerial/ansiSerial.ino
deleted file mode 100644
index 1cda842d..00000000
--- a/examples/Serial/ansiSerial/ansiSerial/ansiSerial.ino
+++ /dev/null
@@ -1,344 +0,0 @@
-#include
-
-/********************
-Oct. 2016 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-
-menu to ANSI serial terminal
-output: ANSI Serial terminal
-input: Serial
-
-draw color menu on ansi serial device
-to see the result on linux machines use:
-
-screen /dev/ttyUSBn 115200
-
-replace the port (/dev/ttyUSBn) with your appropriate port
-screen utility exits with [Ctrl+A \ y]
-
-www.r-site.net
-***/
-#include
-#include
-#include
-// #include
-#include
-
-using namespace Menu;
-using namespace ANSI;
-
-#ifdef DEBUG
-Print& operator<<(Print&o, Menu::prompt&p) {
- print_P(o,p.getText());
- return o;
-}
-#endif
-
-#define LEDPIN LED_BUILTIN
-
-// define menu colors --------------------------------------------------------
-//each color is in the format:
-// {{disabled normal,disabled selected},{enabled normal,enabled selected, enabled editing}}
-const colorDef colors[] MEMMODE={
- {{BLUE,WHITE} ,{BLUE,WHITE,WHITE}},//bgColor
- {{BLACK,BLACK} ,{WHITE,BLUE,BLUE}},//fgColor
- {{BLACK,BLACK} ,{YELLOW,YELLOW,RED}},//valColor
- {{BLACK,BLACK} ,{WHITE,BLUE,YELLOW}},//unitColor
- {{BLACK,BLACK} ,{BLACK,BLUE,RED}},//cursorColor
- {{BLACK,BLACK} ,{BLUE,RED,BLUE}},//titleColor
-};
-
-//define menu outputs ------------------------------------------------
-#define MAX_DEPTH 4
-// const panel panels[] MEMMODE={{1,1,16,10},{18,1,16,10},{36,1,16,10}};
-// navNode* nodes[sizeof(panels)/sizeof(panel)];
-// panelsList pList(panels,nodes,sizeof(panels)/sizeof(panel));
-// idx_t ansi_tops[MAX_DEPTH];
-// ansiSerialOut ansi(Serial,colors,ansi_tops,pList);//the output device, ansi-terminal Cols x Rows
-// menuOut* constMEM outputs[] MEMMODE={&ansi};
-// outputsList out(outputs,1);
-
-MENU_OUTPUTS(out,MAX_DEPTH
- ,ANSISERIAL_OUT(Serial,colors,{1,1,26,10},{28,1,16,10},{46,1,16,10})
- ,NONE//must have 2 items at least
-);
-
-result doAlert(eventMask e, prompt &item);
-
-void putColor(
- menuOut& out,
- colorDefs def,
- bool selected,
- status stat,
- bool edit
- ,int x,int y
-) {
- out.fill(x,y,x+8,y,' ',bgColor,selected,stat,edit);
- out.setColor(def,selected,stat,edit);
- out.setCursor(x,y-1);
- out<<"XX";
-}
-
-void showColorDef(menuOut& out,colorDefs def,int x,int y) {
- out<idleOn(showChars);}
-
-void showOutColors(eventMask event, navNode& nav) {nav.root->idleOn(showColors);}
-
-//menu definition ------------------------------------
-// menu aux functions and vars ------------------------------------------------
-result showEvent(eventMask e,navNode& nav,prompt& item) {
- Serial
- <showTitle);
- #ifdef DEBUG
- Serial<-
-#
-# Documentation:
-#
-# * Travis CI Embedded Builds with PlatformIO
-# < https://docs.travis-ci.com/user/integration/platformio/ >
-#
-# * PlatformIO integration with Travis CI
-# < http://docs.platformio.org/en/stable/ci/travis.html >
-#
-# * User Guide for `platformio ci` command
-# < http://docs.platformio.org/en/stable/userguide/cmd_ci.html >
-#
-#
-# Please choice one of the following templates (proposed below) and uncomment
-# it (remove "# " before each line) or use own configuration according to the
-# Travis CI documentation (see above).
-#
-
-
-#
-# Template #1: General project. Test it using existing `platformio.ini`.
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio run
-
-
-#
-# Template #2: The project is intended to by used as a library with examples
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# env:
-# - PLATFORMIO_CI_SRC=path/to/test/file.c
-# - PLATFORMIO_CI_SRC=examples/file.ino
-# - PLATFORMIO_CI_SRC=path/to/test/directory
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
diff --git a/examples/Serial/serialio/include/readme.txt b/examples/Serial/serialio/include/readme.txt
deleted file mode 100644
index 194dcd43..00000000
--- a/examples/Serial/serialio/include/readme.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-
-This directory is intended for project header files.
-
-A header file is a file containing C declarations and macro definitions
-to be shared between several project source files. You request the use of a
-header file in your project source file (C, C++, etc) located in `src` folder
-by including it, with the C preprocessing directive `#include'.
-
-```src/main.c
-
-#include "header.h"
-
-int main (void)
-{
- ...
-}
-```
-
-Including a header file produces the same results as copying the header file
-into each source file that needs it. Such copying would be time-consuming
-and error-prone. With a header file, the related declarations appear
-in only one place. If they need to be changed, they can be changed in one
-place, and programs that include the header file will automatically use the
-new version when next recompiled. The header file eliminates the labor of
-finding and changing all the copies as well as the risk that a failure to
-find one copy will result in inconsistencies within a program.
-
-In C, the usual convention is to give header files names that end with `.h'.
-It is most portable to use only letters, digits, dashes, and underscores in
-header file names, and at most one dot.
-
-Read more about using header files in official GCC documentation:
-
-* Include Syntax
-* Include Operation
-* Once-Only Headers
-* Computed Includes
-
-https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
diff --git a/examples/Serial/serialio/platformio.ini b/examples/Serial/serialio/platformio.ini
deleted file mode 100644
index b846d8c6..00000000
--- a/examples/Serial/serialio/platformio.ini
+++ /dev/null
@@ -1,80 +0,0 @@
-; PlatformIO Project Configuration File
-;
-; Build options: build flags, source filter, extra scripting
-; Upload options: custom port, speed and extra flags
-; Library options: dependencies, extra library storages
-;
-; Please visit documentation for the other options and examples
-; http://docs.platformio.org/en/stable/projectconf.html
-
-[platformio]
-src_dir=serialio
-; lib_dir=~/Arduino/Libraries
-
-; [env:yun]
-; platform = atmelavr
-; board=yun
-; framework = arduino
-; build_flags = -DNODEBUG
-;
-; [env:mzeropro]
-; platform = atmelsam
-; board=mzeropro
-; framework = arduino
-; build_flags = -DNODEBUG
-;
-; [env:mzeroproUSB]
-; platform = atmelsam
-; board=mzeroproUSB
-; framework = arduino
-; build_flags = -DNODEBUG
-;
-; [env:mzeroUSB]
-; platform = atmelsam
-; board=mzeroUSB
-; framework = arduino
-; build_flags = -DNODEBUG
-;
-[env:nanoatmega328]
-platform = atmelavr
-board = nanoatmega328
-framework = arduino
-upload_port=/dev/ttyUSB*
-upload_flags=-V
-build_flags = -DNO_MENU_DEBUG -Wno-strict-aliasing -Wno-sign-compare -Wno-write-strings
-;
-; [env:teensy31]
-; platform = teensy
-; board = teensy31
-; framework = arduino
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -lstdc++
-;
-; [env:due]
-; platform = atmelsam
-; board = due
-; framework = arduino
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -DNODEBUG -DNOTRACE
-;
-; [env:esp01_1m]
-; platform = espressif8266
-; board = esp01_1m
-; framework = arduino
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -lstdc++
-;
-; [env:uno]
-; platform = atmelavr
-; board = uno
-; framework = arduino
-; upload_speed=921600
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -lstdc++ -DDEBUG
-
-; [env:uno]
-; platform = atmelavr
-; board = uno
-; framework = arduino
-;
-; [env:redbear_blenano2]
-; platform = nordicnrf52
-; board = redbear_blenano2
-; framework = arduino
-; build_flags =-DNODEBUG -DARDUINO=10805
diff --git a/examples/Serial/serialio/serialio/serialio.ino b/examples/Serial/serialio/serialio/serialio.ino
deleted file mode 100644
index ca8febe8..00000000
--- a/examples/Serial/serialio/serialio/serialio.ino
+++ /dev/null
@@ -1,186 +0,0 @@
-/********************
-Arduino generic menu system
-
-Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-
-output: Serial
-input: Serial
-*/
-
-#include
-#include
-#include
-
-using namespace Menu;
-
-#define LEDPIN LED_BUILTIN
-
-result zZz() {Serial.println("zZz");return proceed;}
-
-result showEvent(eventMask e,navNode& nav,prompt& item) {
- Serial.print("event: ");
- Serial.println(e);
- return proceed;
-}
-
-float test=55;
-
-result action1(eventMask e) {
- Serial.print(e);
- Serial.println(" action1 executed, proceed menu");
- Serial.flush();
- return proceed;
-}
-
-result action2(eventMask e, prompt &item) {
- Serial.print(e);
- Serial.print(" action2 executed, quiting menu");
- return quit;
-}
-
-int ledCtrl=LOW;
-
-result myLedOn() {
- ledCtrl=HIGH;
- return proceed;
-}
-result myLedOff() {
- ledCtrl=LOW;
- return proceed;
-}
-
-TOGGLE(ledCtrl,setLed,"Led: ",doNothing,noEvent,noStyle//,doExit,enterEvent,noStyle
- ,VALUE("On",HIGH,doNothing,noEvent)
- ,VALUE("Off",LOW,doNothing,noEvent)
-);
-
-int selTest=0;
-SELECT(selTest,selMenu,"Select",doNothing,noEvent,noStyle
- ,VALUE("Zero",0,doNothing,noEvent)
- ,VALUE("One",1,doNothing,noEvent)
- ,VALUE("Two",2,doNothing,noEvent)
-);
-
-int chooseTest=-1;
-CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
- ,VALUE("First",1,doNothing,noEvent)
- ,VALUE("Second",2,doNothing,noEvent)
- ,VALUE("Third",3,doNothing,noEvent)
- ,VALUE("Last",-1,doNothing,noEvent)
-);
-
-//customizing a prompt look!
-//by extending the prompt class
-class altPrompt:public prompt {
-public:
- // altPrompt(constMEM promptShadow& p):prompt(p) {}
- using prompt::prompt;
- Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t) override {
- return out.printRaw(F("special prompt!"),len);
- }
-};
-
-MENU(subMenu,"Sub-Menu",showEvent,anyEvent,noStyle
- ,OP("Sub1",showEvent,anyEvent)
- ,OP("Sub2",showEvent,anyEvent)
- ,OP("Sub3",showEvent,anyEvent)
- ,altOP(altPrompt,"",showEvent,anyEvent)
- ,EXIT(" // Hardware-specific library
-#include
-#include
-#include
-#include
-
-using namespace Menu;
-
-//display size
-#define TFT_Width 160
-#define TFT_Height 128
-
-//font size plus margins
-#define fontX 6
-#define fontY 9
-
-#define CS A1
-#define DC A0
-#define RST A2
-
-TFT tft(CS, DC, RST);
-
-char* constMEM hexDigit MEMMODE="0123456789ABCDEF";
-char* constMEM hexNr[] MEMMODE={"0","x",hexDigit,hexDigit};
-char buf1[]="0x11";//<-- menu will edit this text
-
-MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
- ,OP("Op1",doNothing,noEvent)
- ,EDIT("Hex",buf1,hexNr,doNothing,noEvent,noStyle)
- ,EXIT(" colors[] MEMMODE={
- {{ST7735_BLACK,ST7735_BLACK},{ST7735_BLACK,ST7735_BLUE,ST7735_BLUE}},//bgColor
- {{ST7735_GRAY,ST7735_GRAY},{ST7735_WHITE,ST7735_WHITE,ST7735_WHITE}},//fgColor
- {{ST7735_WHITE,ST7735_BLACK},{ST7735_YELLOW,ST7735_YELLOW,ST7735_RED}},//valColor
- {{ST7735_WHITE,ST7735_BLACK},{ST7735_WHITE,ST7735_YELLOW,ST7735_YELLOW}},//unitColor
- {{ST7735_WHITE,ST7735_GRAY},{ST7735_BLACK,ST7735_BLUE,ST7735_WHITE}},//cursorColor
- {{ST7735_WHITE,ST7735_YELLOW},{ST7735_BLUE,ST7735_RED,ST7735_RED}},//titleColor
-};
-
-//initializing output and menu nav without macros
-const panel default_serial_panels[] MEMMODE={{0,0,40,10}};
-navNode* default_serial_nodes[sizeof(default_serial_panels)/sizeof(panel)];
-panelsList default_serial_panel_list(
- default_serial_panels,
- default_serial_nodes,
- sizeof(default_serial_panels)/sizeof(panel)
-);
-
-//define output device
-idx_t serialTops[MAX_DEPTH]={0};
-serialOut outSerial(*(Print*)&Serial,serialTops);
-
-//define outputs controller
-idx_t ucg_tops[MAX_DEPTH];
-PANELS(ucgPanels,{0,0,TFT_Width/fontX,TFT_Height/fontY});
-TFTOut tftOut(tft,colors,ucg_tops,ucgPanels,fontX,fontY);
-
-menuOut* const outputs[] MEMMODE={&outSerial,&tftOut};//list of output devices
-outputsList out(outputs,2);//outputs list controller
-
-serialIn serial(Serial);
-
-//define navigation root and aux objects
-navNode nav_cursors[MAX_DEPTH];//aux objects to control each level of navigation
-navRoot nav(mainMenu, nav_cursors, MAX_DEPTH, serial, out);
-
-void setup(){
- Serial.begin(115200);
- while(!Serial);
- Serial.println("Menu 4.x");
- tft.begin();
- tft.background(0,0,0); // clear the screen with black
- tft.setRotation(3);
- tft.setTextWrap(false);
- tft.println("Menu 4.x");
- delay(1000); // pause for dramatic effect
-}
-
-void loop(){
- nav.poll();
-}
diff --git a/examples/TFT_HX8257/TFT_HX8257/TFT_HX8257.ino b/examples/TFT_HX8257/TFT_HX8257/TFT_HX8257.ino
deleted file mode 100644
index ef8dcf25..00000000
--- a/examples/TFT_HX8257/TFT_HX8257/TFT_HX8257.ino
+++ /dev/null
@@ -1,225 +0,0 @@
-#include
-
-/********************
-Feb.2018 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-
-menu with TFT_HX8357 driver https://github.com/Bodmer/TFT_HX8357
-output: not sure yet... ;)
-input: Serial + encoder
-www.r-site.net
-
-alternative encoder (clickEncoder) uses:
-https://github.com/0xPIT/encoder
-https://github.com/PaulStoffregen/TimerOne
-***/
-
-//removed as extra libs are not included into travis
-// #define USE_CLICK_ENCODER
-
-// #include
-// #include // included by menu driver
-#include
-#include
-#define USE_CLICK_ENCODER
-#ifdef USE_CLICK_ENCODER
- #include
- #include
- #include
-#else
- #include
-#endif
-#include
-#include
-#include
-
-using namespace Menu;
-
-#define fontW 16
-#define fontH 16
-
-TFT_HX8357 tft = TFT_HX8357(); // Invoke custom library
-
-#define LEDPIN LED_BUILTIN
-
-// rotary encoder pins
-#define encA 2
-#define encB 3
-#define encBtn 4
-
-result doAlert(eventMask e, prompt &item);
-
-int test=55;
-
-int ledCtrl=LOW;
-
-result myLedOn() {
- ledCtrl=HIGH;
- return proceed;
-}
-result myLedOff() {
- ledCtrl=LOW;
- return proceed;
-}
-
-TOGGLE(ledCtrl,setLed,"Led: ",doNothing,noEvent,noStyle//,doExit,enterEvent,noStyle
- ,VALUE("On",HIGH,doNothing,noEvent)
- ,VALUE("Off",LOW,doNothing,noEvent)
-);
-
-int selTest=0;
-SELECT(selTest,selMenu,"Select",doNothing,noEvent,noStyle
- ,VALUE("Zero",0,doNothing,noEvent)
- ,VALUE("One",1,doNothing,noEvent)
- ,VALUE("Two",2,doNothing,noEvent)
-);
-
-int chooseTest=-1;
-CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
- ,VALUE("First",1,doNothing,noEvent)
- ,VALUE("Second",2,doNothing,noEvent)
- ,VALUE("Third",3,doNothing,noEvent)
- ,VALUE("Last",-1,doNothing,noEvent)
-);
-
-//customizing a prompt look!
-//by extending the prompt class
-class altPrompt:public prompt {
-public:
- altPrompt(constMEM promptShadow& p):prompt(p) {}
- Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t) override {
- return out.printRaw(F("special prompt!"),len);;
- }
-};
-
-MENU(subMenu,"Sub-Menu",doNothing,noEvent,noStyle
- ,altOP(altPrompt,"",doNothing,noEvent)
- ,OP("Op",doNothing,noEvent)
- ,EXIT(" colors[] MEMMODE={
- {{TFT_BLACK,TFT_BLACK},{TFT_BLACK,TFT_BLUE,TFT_BLUE}},//bgColor
- {{TFT_GREY,TFT_GREY},{TFT_WHITE,TFT_WHITE,TFT_WHITE}},//fgColor
- {{TFT_WHITE,TFT_BLACK},{TFT_YELLOW,TFT_YELLOW,TFT_RED}},//valColor
- {{TFT_WHITE,TFT_BLACK},{TFT_WHITE,TFT_YELLOW,TFT_YELLOW}},//unitColor
- {{TFT_WHITE,TFT_GREY},{TFT_BLACK,TFT_BLUE,TFT_WHITE}},//cursorColor
- {{TFT_WHITE,TFT_YELLOW},{TFT_BLUE,TFT_RED,TFT_RED}},//titleColor
-};
-
-serialIn serial(Serial);
-
-#ifdef USE_CLICK_ENCODER
- ClickEncoder clickEncoder(encA,encB,encBtn);
- ClickEncoderStream encStream(clickEncoder,1);
- MENU_INPUTS(in,&encStream,&serial);
- void timerIsr() {clickEncoder.service();}
-#else
- encoderIn encoder;//simple quad encoder driver
- encoderInStream encStream(encoder,4);// simple quad encoder fake Stream
- //a keyboard with only one key as the encoder button
- keyMap encBtn_map[]={{-encBtn,defaultNavCodes[enterCmd].ch}};//negative pin numbers use internal pull-up, this is on when low
- keyIn<1> encButton(encBtn_map);//1 is the number of keys
- MENU_INPUTS(in,&encStream,&encButton,&serial);
-#endif
-
-#define MAX_DEPTH 4
-
-//define output device
-idx_t serialTops[MAX_DEPTH]={0};
-serialOut outSerial(Serial,serialTops);
-
-constMEM panel panels[] MEMMODE={{0,0,480/fontW,320/fontH}};
-navNode* nodes[sizeof(panels)/sizeof(panel)];//navNodes to store navigation status
-panelsList pList(panels,nodes,1);//a list of panels and nodes
-idx_t gfxTops[MAX_DEPTH]={0};
-tftHX8257Out tftOut(tft,colors,gfxTops,pList,fontW,fontH);
-
-//define outputs controller
-menuOut* constMEM outputs[] MEMMODE={&outSerial,&tftOut};//list of output devices
-outputsList out(outputs,2);//outputs list controller
-
-//define navigation root and aux objects
-navNode nav_cursors[MAX_DEPTH];//aux objects to control each level of navigation
-navRoot nav(mainMenu, nav_cursors, MAX_DEPTH, in, out);
-
-// MENU_OUTPUTS(out,MAX_DEPTH
-// ,ADAGFX_OUT(tft,colors,6*textScale,9*textScale,{0,0,14,8},{14,0,14,8})
-// ,SERIAL_OUT(Serial)
-// );
-//
-// NAVROOT(nav,mainMenu,MAX_DEPTH,in,out);
-
-//when menu is suspended
-result idle(menuOut& o,idleEvent e) {
- if (e==idling) {
- o.println(F("suspended..."));
- o.println(F("press [select]"));
- o.println(F("to continue"));
- }
- return proceed;
-}
-
-//config myOptions('*','-',defaultNavCodes,false);
-
-void setup() {
- //options=&myOptions;//can customize options
- pinMode(LEDPIN,OUTPUT);
- Serial.begin(115200);
- while(!Serial);
- Serial.println("menu 4.x test");
- Serial.flush();
- nav.idleTask=idle;//point a function to be used when menu is suspended
- mainMenu[1].disable();
- //outGfx.usePreview=true;//reserve one panel for preview?
- //nav.showTitle=false;//show menu title?
-
- //pinMode(encBtn, INPUT_PULLUP);
- #ifdef USE_CLICK_ENCODER
- Timer1.initialize(1000);
- Timer1.attachInterrupt(timerIsr);
- #else
- encButton.begin();
- encoder.begin();
- #endif
-
- //SPI.begin();
- tft.init();
- tft.setRotation(1);
- // tft.setTextSize(textScale);//test scalling
- // tft.setTextWrap(false);
- tft.fillScreen(TFT_BLACK);
- // tft.setTextColor(TFT_RED,TFT_BLACK);
- tft.println("Menu 4.x test HX8257");
- delay(1000);
-}
-
-void loop() {
- nav.poll();//this device only draws when needed
- digitalWrite(LEDPIN, ledCtrl);
- delay(100);//simulate a delay when other tasks are done
-}
diff --git a/examples/TextField/.gitignore b/examples/TextField/.gitignore
deleted file mode 100644
index 5dac9f52..00000000
--- a/examples/TextField/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.pioenvs
-.piolibdeps
-.clang_complete
-.gcc-flags.json
diff --git a/examples/TextField/.travis.yml b/examples/TextField/.travis.yml
deleted file mode 100644
index 2c4ff5c9..00000000
--- a/examples/TextField/.travis.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-# Continuous Integration (CI) is the practice, in software
-# engineering, of merging all developer working copies with a shared mainline
-# several times a day < http://docs.platformio.org/page/ci/index.html >
-#
-# Documentation:
-#
-# * Travis CI Embedded Builds with PlatformIO
-# < https://docs.travis-ci.com/user/integration/platformio/ >
-#
-# * PlatformIO integration with Travis CI
-# < http://docs.platformio.org/page/ci/travis.html >
-#
-# * User Guide for `platformio ci` command
-# < http://docs.platformio.org/page/userguide/cmd_ci.html >
-#
-#
-# Please choice one of the following templates (proposed below) and uncomment
-# it (remove "# " before each line) or use own configuration according to the
-# Travis CI documentation (see above).
-#
-
-
-#
-# Template #1: General project. Test it using existing `platformio.ini`.
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio run
-
-
-#
-# Template #2: The project is intended to by used as a library with examples
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# env:
-# - PLATFORMIO_CI_SRC=path/to/test/file.c
-# - PLATFORMIO_CI_SRC=examples/file.ino
-# - PLATFORMIO_CI_SRC=path/to/test/directory
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
diff --git a/examples/TextField/TextField/TextField.ino b/examples/TextField/TextField/TextField.ino
deleted file mode 100644
index d5d71838..00000000
--- a/examples/TextField/TextField/TextField.ino
+++ /dev/null
@@ -1,71 +0,0 @@
-#include
-#include
-#include
-//#include
-
-using namespace Menu;
-
-#define LEDPIN LED_BUILTIN
-
-//list of allowed characters
-char* const digit="0123456789";
-char* const hexChars MEMMODE="0123456789ABCDEF";
-char* const alphaNum[] MEMMODE = {" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.,+-_"};
-//individual character validators
-char* constMEM validData[] MEMMODE={hexChars,hexChars,hexChars,hexChars};
-
-char* constMEM validIP[] MEMMODE = {"012",digit,digit,"."};
-char buf0[]="000.000.000.000";
-
-//define "Op 0" without macro
-constMEM char op1Text[] MEMMODE="IP";//field name
-constMEM textFieldShadowRaw op1InfoRaw MEMMODE={
- (callback)doNothing,
- (Menu::systemStyles)(_noStyle|_canNav|_parentDraw),
- op1Text,
- enterEvent,
- noStyle,
- buf0,//edit buffer
- validIP,
- 4//this is the number of entries on validators array, not th efield length
-};//MEMMODE static stuff
-constMEM textFieldShadow& op1Info=*(textFieldShadow*)&op1InfoRaw;//hacking c++ to use progmem (hugly)
-textField option0(op1Info);
-
-char buf1[]="0000";
-char name[]=" ";//field will initialize its size by this string length
-MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
- ,OBJ(option0)
- ,EDIT("Hex",buf1,validData,doNothing,noEvent,noStyle)
- ,EDIT("Name",name,alphaNum,doNothing,noEvent,noStyle)
- ,EXIT("buffer,HEX);
- Serial.println((uint16_t)memPtr(((textFieldShadow*)mainMenu[1].shadow)->buffer),HEX);
- dumpRam(Serial,buf1,4);
- dumpPgm(Serial,buf1,4);
- dumpPgm(Serial,(textFieldShadowRaw*)mainMenu[1].shadow,sizeof(textFieldShadowRaw));*/
-}
-
-void loop() {
- nav.poll();
- delay(100);//delay to simulate other tasks
-}
diff --git a/examples/TextField/platformio.ini b/examples/TextField/platformio.ini
deleted file mode 100644
index 30e66d18..00000000
--- a/examples/TextField/platformio.ini
+++ /dev/null
@@ -1,42 +0,0 @@
-; PlatformIO Project Configuration File
-;
-; Build options: build flags, source filter
-; Upload options: custom upload port, speed and extra flags
-; Library options: dependencies, extra library storages
-; Advanced options: extra scripting
-;
-; Please visit documentation for the other options and examples
-; http://docs.platformio.org/page/projectconf.html
-
-[platformio]
-src_dir=TextField
-lib_dir=~/Arduino/Libraries
-
-[env:nanoatmega328]
-platform = atmelavr
-board = nanoatmega328
-framework = arduino
-upload_port=/dev/ttyUSB*
-upload_flags=-V
-build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -DNODEBUG
-
-; [env:atmega328_8]
-; platform=atmelavr
-; board=pro8MHzatmega328
-; framework=arduino
-; upload_protocol = usbasp
-; upload_flags = -Pusb
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -DNODEBUG
-
-; [env:teensy31]
-; platform = teensy
-; board = teensy31
-; framework = arduino
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -lstdc++
-
-; [env:esp12e]
-; platform = espressif8266
-; board = esp12e
-; framework = arduino
-; upload_speed=921600
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -lstdc++ -DDEBUG
diff --git a/examples/U8G2/U8G2/U8G2.ino b/examples/U8G2/U8G2/U8G2.ino
deleted file mode 100644
index c6a35a2a..00000000
--- a/examples/U8G2/U8G2/U8G2.ino
+++ /dev/null
@@ -1,258 +0,0 @@
-#include
-
-/********************
-Arduino generic menu system
-U8G2 menu example
-U8G2: https://github.com/olikraus/u8g2
-
-Oct. 2016 Stephen Denne https://github.com/datacute
-Based on example from Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-Original from: https://github.com/christophepersoz
-
-menu on U8G2 device
-output: Wemos D1 mini OLED Shield (SSD1306 64x48 I2C) + Serial
-input: Serial + encoder
-mcu: nano328p
-
-*/
-
-#include
-#include
-// #include
-// #include
-#include
-#include
-#include
-
-using namespace Menu;
-
-#define LEDPIN LED_BUILTIN
-
-// #define USE_PCD8544
-#define USE_SSD1306
-
-#if defined(USE_PCD8544)
- // rotary encoder pins
- // #define encA 2
- // #define encB 3
- // #define encBtn 4
-
- #include
- #define USE_HWSPI
- #define U8_DC 9
- #define U8_CS 8
- #define U8_RST 7
- #define fontName u8g2_font_5x7_tf
- #define fontX 5
- #define fontY 9
- #define offsetX 0
- #define offsetY 0
- #define U8_Width 84
- #define U8_Height 48
- U8G2_PCD8544_84X48_1_4W_HW_SPI u8g2(U8G2_R0, U8_CS, U8_DC , U8_RST);
-#elif defined(USE_SSD1306)
- // rotary encoder pins
- // #define encA 5
- // #define encB 6
- // #define encBtn 7
-
- #include
- #define fontName u8g2_font_7x13_mf
- #define fontX 7
- #define fontY 16
- #define offsetX 0
- #define offsetY 3
- #define U8_Width 128
- #define U8_Height 64
- #define USE_HWI2C
- // U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0);//, SCL, SDA);
- // U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R2, U8X8_PIN_NONE, 4, 5);
- // U8G2_SSD1306_128X64_VCOMH0_F_HW_I2C u8g2(U8G2_R2, U8X8_PIN_NONE, 4, 5);
- U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE, 4, 5);
-#else
- #error DEFINE YOUR OUTPUT HERE.
-#endif
-
-
-// define menu colors --------------------------------------------------------
-//each color is in the format:
-// {{disabled normal,disabled selected},{enabled normal,enabled selected, enabled editing}}
-// this is a monochromatic color table
-const colorDef colors[] MEMMODE={
- {{0,0},{0,1,1}},//bgColor
- {{1,1},{1,0,0}},//fgColor
- {{1,1},{1,0,0}},//valColor
- {{1,1},{1,0,0}},//unitColor
- {{0,1},{0,0,1}},//cursorColor
- {{1,1},{1,0,0}},//titleColor
-};
-
-result doAlert(eventMask e, prompt &item);
-
-int test=55;
-
-int ledCtrl=HIGH;
-
-result myLedOn() {
- ledCtrl=HIGH;
- return proceed;
-}
-result myLedOff() {
- ledCtrl=LOW;
- return proceed;
-}
-
-TOGGLE(ledCtrl,setLed,"Led: ",doNothing,noEvent,noStyle//,doExit,enterEvent,noStyle
- ,VALUE("On",HIGH,doNothing,noEvent)
- ,VALUE("Off",LOW,doNothing,noEvent)
-);
-
-int selTest=0;
-SELECT(selTest,selMenu,"Select",doNothing,noEvent,noStyle
- ,VALUE("Zero",0,doNothing,noEvent)
- ,VALUE("One",1,doNothing,noEvent)
- ,VALUE("Two",2,doNothing,noEvent)
-);
-
-int chooseTest=-1;
-CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
- ,VALUE("First",1,doNothing,noEvent)
- ,VALUE("Second",2,doNothing,noEvent)
- ,VALUE("Third",3,doNothing,noEvent)
- ,VALUE("Last",-1,doNothing,noEvent)
-);
-
-// //customizing a prompt look!
-// //by extending the prompt class
-// class altPrompt:public prompt {
-// public:
-// altPrompt(constMEM promptShadow& p):prompt(p) {}
-// Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t panelNr) override {
-// return out.printRaw(F("special prompt!"),len);;
-// }
-// };
-
-MENU(subMenu,"Sub-Menu",doNothing,noEvent,noStyle
- ,OP("Sub1",doNothing,noEvent)
- // ,altOP(altPrompt,"",doNothing,noEvent)
- ,EXIT(" encoder;//simple quad encoder driver
-// encoderInStream encStream(encoder,4);// simple quad encoder fake Stream
-
-//a keyboard with only one key as the encoder button
-// keyMap encBtn_map[]={{-encBtn,defaultNavCodes[enterCmd].ch}};//negative pin numbers use internal pull-up, this is on when low
-// keyIn<1> encButton(encBtn_map);//1 is the number of keys
-
-// menuIn* inputsList[]={&encBuitton,&Serial};
-// chainStream<2> in(inputsList);//1 is the number of inputs
-
-serialIn serial(Serial);
-MENU_INPUTS(in,&serial);
-// MENU_INPUTS(in,&encStream,&encButton);//,&serial);
-
-MENU_OUTPUTS(out,MAX_DEPTH
- ,U8G2_OUT(u8g2,colors,fontX,fontY,offsetX,offsetY,{0,0,U8_Width/fontX,U8_Height/fontY})
- ,SERIAL_OUT(Serial)
-);
-
-NAVROOT(nav,mainMenu,MAX_DEPTH,in,out);
-
-result alert(menuOut& o,idleEvent e) {
- if (e==idling) {
- o.setCursor(0,0);
- o.print("alert test");
- o.setCursor(0,1);
- o.print("press [select]");
- o.setCursor(0,2);
- o.print("to continue...");
- }
- return proceed;
-}
-
-result doAlert(eventMask e, prompt &item) {
- nav.idleOn(alert);
- return proceed;
-}
-
-//when menu is suspended
-result idle(menuOut& o,idleEvent e) {
- o.clear();
- switch(e) {
- case idleStart:o.println("suspending menu!");break;
- case idling:o.println("suspended...");break;
- case idleEnd:o.println("resuming menu.");break;
- }
- return proceed;
-}
-
-void setup() {
- Serial.begin(115200);
- while(!Serial);
- Serial.println("menu 4.x test");Serial.flush();
- // encButton.begin();
- // encoder.begin();
- // pinMode(LEDPIN,OUTPUT);//cant use pin 13 when using hw spi
- // and on esp12 i2c can be on pin 2, and that is also led pin
- // so check first if this is adequate for your board
- #if defined(USE_HWSPI)
- SPI.begin();
- u8g2.begin();
- #elif defined(USE_HWI2C)
- Wire.begin();
- u8g2.begin();
- #else
- #error "please choose your interface (I2c,SPI)"
- #endif
- u8g2.setFont(fontName);
- // u8g2.setBitmapMode(0);
-
- // disable second option
- mainMenu[1].enabled=disabledStatus;
- nav.idleTask=idle;//point a function to be used when menu is suspended
- Serial.println("setup done.");Serial.flush();
-}
-
-void loop() {
- nav.doInput();
- // digitalWrite(LEDPIN, ledCtrl);
- if (nav.changed(0)) {//only draw if menu changed for gfx device
- //change checking leaves more time for other tasks
- u8g2.firstPage();
- do nav.doOutput(); while(u8g2.nextPage());
- }
- delay(100);//simulate other tasks delay
-}
diff --git a/examples/U8GLib/.gitignore b/examples/U8GLib/.gitignore
deleted file mode 100644
index e05273b2..00000000
--- a/examples/U8GLib/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.pioenvs
-.clang_complete
-.gcc-flags.json
-.piolibdeps
\ No newline at end of file
diff --git a/examples/U8GLib/.travis.yml b/examples/U8GLib/.travis.yml
deleted file mode 100644
index 72c6e43f..00000000
--- a/examples/U8GLib/.travis.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-# Continuous Integration (CI) is the practice, in software
-# engineering, of merging all developer working copies with a shared mainline
-# several times a day < http://docs.platformio.org/en/stable/ci/index.html >
-#
-# Documentation:
-#
-# * Travis CI Embedded Builds with PlatformIO
-# < https://docs.travis-ci.com/user/integration/platformio/ >
-#
-# * PlatformIO integration with Travis CI
-# < http://docs.platformio.org/en/stable/ci/travis.html >
-#
-# * User Guide for `platformio ci` command
-# < http://docs.platformio.org/en/stable/userguide/cmd_ci.html >
-#
-#
-# Please choice one of the following templates (proposed below) and uncomment
-# it (remove "# " before each line) or use own configuration according to the
-# Travis CI documentation (see above).
-#
-
-
-#
-# Template #1: General project. Test it using existing `platformio.ini`.
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio run
-
-
-#
-# Template #2: The project is intended to by used as a library with examples
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# env:
-# - PLATFORMIO_CI_SRC=path/to/test/file.c
-# - PLATFORMIO_CI_SRC=examples/file.ino
-# - PLATFORMIO_CI_SRC=path/to/test/directory
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
diff --git a/examples/U8GLib/U8GLib/U8GLib.ino b/examples/U8GLib/U8GLib/U8GLib.ino
deleted file mode 100644
index 44c8b65d..00000000
--- a/examples/U8GLib/U8GLib/U8GLib.ino
+++ /dev/null
@@ -1,242 +0,0 @@
-#include
-
-/********************
-Arduino generic menu system
-U8GLib menu example
-U8Glib: https://github.com/olikraus/U8glib_Arduino
-
-Jul.2016 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-Original from: https://github.com/christophepersoz
-
-menu on U8GLib device
-output: Nokia 5110 display (PCD8544 HW SPI) + Serial
-input: Serial + encoder
-
-ESP8266 Compile Error:
- `.irom0.text' will not fit in region `irom0_0_seg'
- see: http://bbs.espressif.com/viewtopic.php?t=166
-
-please use U8G2 instead.
-
-*/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-using namespace Menu;
-
-#define LEDPIN LED_BUILTIN
-
-// rotary encoder pins
-#define encA 2
-#define encB 3
-#define encBtn 4
-
-#define U8_DC 9
-#define U8_CS 8
-#define U8_RST 7
-
-U8GLIB_PCD8544 u8g(U8_CS, U8_DC, U8_RST) ;
-
-result doAlert(eventMask e, prompt &item);
-
-result showEvent(eventMask e,navNode& nav,prompt& item) {
- Serial.print("event: ");
- Serial.println(e);
- return proceed;
-}
-
-int test=55;
-
-result action1(eventMask e) {
- Serial.print(e);
- Serial.println(" action1 executed, proceed menu");
- Serial.flush();
- return proceed;
-}
-
-result action2(eventMask e,navNode& nav, prompt &item) {
- Serial.print(e);
- Serial.print(" action2 executed, quiting menu");
- return quit;
-}
-
-int ledCtrl=LOW;
-
-result myLedOn() {
- ledCtrl=HIGH;
- return proceed;
-}
-result myLedOff() {
- ledCtrl=LOW;
- return proceed;
-}
-
-TOGGLE(ledCtrl,setLed,"Led: ",doNothing,noEvent,noStyle
- ,VALUE("On",HIGH,doNothing,noEvent)
- ,VALUE("Off",LOW,doNothing,noEvent)
-);
-
-int selTest=0;
-SELECT(selTest,selMenu,"Select",doNothing,noEvent,noStyle
- ,VALUE("Zero",0,doNothing,noEvent)
- ,VALUE("One",1,doNothing,noEvent)
- ,VALUE("Two",2,doNothing,noEvent)
-);
-
-int chooseTest=-1;
-CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
- ,VALUE("First",1,doNothing,noEvent)
- ,VALUE("Second",2,doNothing,noEvent)
- ,VALUE("Third",3,doNothing,noEvent)
- ,VALUE("Last",-1,doNothing,noEvent)
-);
-
-//customizing a prompt look!
-//by extending the prompt class
-class altPrompt:public prompt {
-public:
- altPrompt(constMEM promptShadow& p):prompt(p) {}
- Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t panelNr) override {
- return out.printRaw(F("special prompt!"),len);;
- }
-};
-
-MENU(subMenu,"Sub-Menu",showEvent,anyEvent,noStyle
- ,OP("Sub1",showEvent,anyEvent)
- ,OP("Sub2",showEvent,anyEvent)
- ,OP("Sub3",showEvent,anyEvent)
- ,altOP(altPrompt,"",showEvent,anyEvent)
- ,EXIT(" colors[] MEMMODE={
- {{0,0},{0,1,1}},//bgColor
- {{1,1},{1,0,0}},//fgColor
- {{1,1},{1,0,0}},//valColor
- {{1,1},{1,0,0}},//unitColor
- {{0,1},{0,0,1}},//cursorColor
- {{0,0},{1,1,1}},//titleColor
-};
-
-encoderIn encoder;//simple quad encoder driver
-encoderInStream encStream(encoder,4);// simple quad encoder fake Stream
-
-//a keyboard with only one key as the encoder button
-keyMap encBtn_map[]={{-encBtn,defaultNavCodes[enterCmd].ch}};//negative pin numbers use internal pull-up, on = low
-keyIn<1> encButton(encBtn_map);//1 is the number of keys
-
-serialIn serial(Serial);
-
-//input from the encoder + encoder button + serial
-menuIn* inputsList[]={&encStream,&encButton,&serial};
-chainStream<3> in(inputsList);//3 is the number of inputs
-
-//fontY should now account for fontMarginY
-#define fontX 6
-#define fontY 9
-#define MAX_DEPTH 2
-
-//this macro replaces all the above commented lines
-MENU_OUTPUTS(out,MAX_DEPTH
- ,U8GLIB_OUT(u8g,colors,fontX,fontY,{0,0,84/fontX,48/fontY})
- ,SERIAL_OUT(Serial)
-);
-
-NAVROOT(nav,mainMenu,MAX_DEPTH,in,out);
-
-result alert(menuOut& o,idleEvent e) {
- if (e==idling) {
- o.setCursor(0,0);
- o.print("alert test");
- o.setCursor(0,1);
- o.print("press [select]");
- o.setCursor(0,2);
- o.print("to continue...");
- }
- return proceed;
-}
-
-result doAlert(eventMask e, prompt &item) {
- nav.idleOn(alert);
- return proceed;
-}
-
-//when menu is suspended
-result idle(menuOut& o,idleEvent e) {
- o.clear();
- switch(e) {
- case idleStart:o.println("suspending menu!");break;
- case idling:o.println("suspended...");break;
- case idleEnd:o.println("resuming menu.");break;
- }
- return proceed;
-}
-
-void setup() {
- pinMode(LEDPIN,OUTPUT);
- Serial.begin(115200);
- while(!Serial);
- nav.idleTask=idle;//point a function to be used when menu is suspended
- mainMenu[1].enabled=disabledStatus;
- //change input burst for slow output devices
- //this is the number of max. processed inputs before drawing
- nav.inputBurst=10;
-
- pinMode(encBtn, INPUT_PULLUP);
- encButton.begin();
- encoder.begin();
-
- //u8g.setFont(u8g_font_helvR08);
- u8g.setFont(u8g_font_6x10);
- //u8g.setFont(u8g_font_04b_03r);
- u8g.firstPage();
- do {
- u8g.setColorIndex(1);
- nav.out[0].setCursor(0,0);
- nav.out[0].print(F("Menu 4.x test"));
- nav.out[0].setCursor(0,1);
- nav.out[0].print(F("on U8Glib"));
- } while(u8g.nextPage());
- delay(1000);
-}
-
-void loop() {
- nav.doInput();
- digitalWrite(LEDPIN, ledCtrl);
- if (nav.changed(0)) {//only draw if menu changed for gfx device
- //because this code clears the screen, if always called then screen will blink
- u8g.firstPage();
- do nav.doOutput(); while(u8g.nextPage());
- }
- delay(100);//simulate other tasks delay
-}
diff --git a/examples/U8GLib/platformio.ini b/examples/U8GLib/platformio.ini
deleted file mode 100644
index edca50a4..00000000
--- a/examples/U8GLib/platformio.ini
+++ /dev/null
@@ -1,52 +0,0 @@
-; PlatformIO Project Configuration File
-;
-; Build options: build flags, source filter, extra scripting
-; Upload options: custom port, speed and extra flags
-; Library options: dependencies, extra library storages
-;
-; Please visit documentation for the other options and examples
-; http://docs.platformio.org/en/stable/projectconf.html
-
-[platformio]
-src_dir=U8GLib
-; lib_dir=~/Arduino/Libraries
-
-[env:nanoatmega328]
-platform = atmelavr
-board = nanoatmega328
-framework = arduino
-upload_port=/dev/ttyUSB*
-upload_flags=-V
-upload_speed=57600
-build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -DNODEBUG
-
-; [env:teensy31]
-; platform = teensy
-; board = teensy31
-; framework = arduino
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -lstdc++
-
-; [env:due]
-; platform = atmelsam
-; board = due
-; framework = arduino
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -DNODEBUG -DNOTRACE
-
-; [env:esp01_1m]
-; platform = espressif8266
-; board = esp01_1m
-; framework = arduino
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -lstdc++
-
-; [env:uno]
-; platform = atmelavr
-; board = uno
-; framework = arduino
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -lstdc++ -DDEBUG
-
-; [env:esp12e]
-; platform = espressif8266
-; board = esp12e
-; framework = arduino
-; upload_speed=921600
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -lstdc++ -DNODEBUG -DMENU_SSID="\"r-site.net\"" -DMENU_PASS="\"rsite.2011\""
diff --git a/examples/U8x8/U8x8/U8x8.ino b/examples/U8x8/U8x8/U8x8.ino
deleted file mode 100644
index 542bf769..00000000
--- a/examples/U8x8/U8x8/U8x8.ino
+++ /dev/null
@@ -1,106 +0,0 @@
-/********************
-Arduino generic menu system
-U8x8 menu example
-U8x8: https://github.com/olikraus/Ucglib_Arduino
-
-Sep. 2017 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-
-menu on U8x8 device
-output: PCD8544 (Nokia 5110)
-input: Serial
-mcu: nano328p
-
-*/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-using namespace Menu;
-
-#define LEDPIN LED_BUILTIN
-
-#define U8_DC 9
-#define U8_CS 8
-#define U8_RST 7
-#define U8_Width 84
-#define U8_Height 48
-
-U8X8_PCD8544_84X48_4W_HW_SPI u8x8(U8_CS, U8_DC , U8_RST);
-
-char* constMEM hexDigit MEMMODE="0123456789ABCDEF";
-char* constMEM hexNr[] MEMMODE={"0","x",hexDigit,hexDigit};
-char buf1[]="0x11";//<-- menu will edit this text
-
-int chooseTest=-1;
-CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
- ,VALUE("First",1,doNothing,noEvent)
- ,VALUE("Second",2,doNothing,noEvent)
- ,VALUE("Third",3,doNothing,noEvent)
- ,VALUE("Last",-1,doNothing,noEvent)
-);
-
-MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
- ,OP("Op1",doNothing,noEvent)
- ,EDIT("Hex",buf1,hexNr,doNothing,noEvent,noStyle)
- ,SUBMENU(chooseMenu)
- ,EXIT("
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-using namespace Menu;
-
-#define LEDPIN LED_BUILTIN
-
-SoftwareSerial ss(11, 10);
-
-
-#define MAX_DEPTH 2
-
-// define menu colors --------------------------------------------------------
-#define C_BLACK 0
-#define C_BLUE 3
-#define C_GRAY 7
-#define C_WHITE 15
-#define C_YELLOW 31
-#define C_RED 1
-#define C_GREEN 2
-//each color is in the format:
-// {{disabled normal,disabled selected},{enabled normal,enabled selected, enabled editing}}
-const colorDef colors[] MEMMODE={
- {{C_BLACK,C_BLACK}, {C_BLACK,C_BLUE,C_BLUE}},//bgColor
- {{C_GRAY,C_GRAY}, {C_WHITE,C_WHITE,C_WHITE}},//fgColor
- {{C_WHITE,C_BLACK}, {C_YELLOW,C_YELLOW,C_RED}},//valColor
- {{C_WHITE,C_BLACK}, {C_WHITE,C_YELLOW,C_YELLOW}},//unitColor
- {{C_WHITE,C_GRAY}, {C_BLACK,C_BLUE,C_WHITE}},//cursorColor
- {{C_WHITE,C_YELLOW},{C_GREEN,C_WHITE,C_WHITE}},//titleColor
-};
-
-
-#define offsetX 0
-#define offsetY 0
-#define U8_Width 240
-#define U8_Height 320
-
-#define LEDPIN LED_BUILTIN
-
-
-int timeOn=10;
-int timeOff=90;
-
-MENU(mainMenu, "Settings menu", Menu::doNothing, Menu::noEvent, Menu::wrapStyle
- ,FIELD(timeOn,"On","ms",0,100,10,1, Menu::doNothing, Menu::noEvent, Menu::noStyle)
- ,FIELD(timeOff,"Off","ms",0,100,10,1,Menu::doNothing, Menu::noEvent, Menu::noStyle)
- ,EXIT("
-#include
-#include
-#include
-#include
-#include
-
-using namespace Menu;
-
-#define UC_Width 160
-#define UC_Height 128
-
-#ifdef ESP8266
- #define UC_CS 2
- #define UC_DC 3
- #define UC_RST 4
-#else
- #define UC_CS A1
- #define UC_DC A0
- #define UC_RST A2
-#endif
-
-//font size plus margins
-#define fontX 6
-#define fontY 11
-
-Ucglib_ST7735_18x128x160_HWSPI ucg(UC_DC , UC_CS, UC_RST);
-
-char* constMEM hexDigit MEMMODE="0123456789ABCDEF";
-char* constMEM hexNr[] MEMMODE={"0","x",hexDigit,hexDigit};
-char buf1[]="0x11";//<-- menu will edit this text
-
-int chooseTest=-1;
-CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
- ,VALUE("First",1,doNothing,noEvent)
- ,VALUE("Second",2,doNothing,noEvent)
- ,VALUE("Third",3,doNothing,noEvent)
- ,VALUE("Last",-1,doNothing,noEvent)
-);
-
-MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
- ,OP("Op1",doNothing,noEvent)
- ,EDIT("Hex",buf1,hexNr,doNothing,noEvent,noStyle)
- ,SUBMENU(chooseMenu)
- ,EXIT(" colors[] MEMMODE={
- {{BLACK,BLACK},{BLACK,BLUE,BLUE}},//bgColor
- {{GRAY,GRAY},{WHITE,WHITE,WHITE}},//fgColor
- {{WHITE,BLACK},{YELLOW,YELLOW,RED}},//valColor
- {{WHITE,BLACK},{WHITE,YELLOW,YELLOW}},//unitColor
- {{WHITE,GRAY},{BLACK,BLUE,WHITE}},//cursorColor
- {{WHITE,YELLOW},{BLUE,RED,RED}},//titleColor
-};
-
-#define offsetX 0
-#define offsetY 0
-
-MENU_OUTPUTS(out,MAX_DEPTH
- ,UCG_OUT(ucg,colors,fontX,fontY,offsetX,offsetY,{0,0,UC_Width/fontX,UC_Height/fontY})
- ,SERIAL_OUT(Serial)
-);
-
-serialIn serial(Serial);
-NAVROOT(nav,mainMenu,MAX_DEPTH,serial,out);
-
-//initializing output and menu nav without macros
-/*const panel default_serial_panels[] MEMMODE={{0,0,40,10}};
-navNode* default_serial_nodes[sizeof(default_serial_panels)/sizeof(panel)];
-panelsList default_serial_panel_list(
- default_serial_panels,
- default_serial_nodes,
- sizeof(default_serial_panels)/sizeof(panel)
-);
-
-//define output device
-idx_t serialTops[MAX_DEPTH]={0};
-serialOut outSerial(*(Print*)&Serial,serialTops);
-
-//define outputs controller
-idx_t ucg_tops[MAX_DEPTH];
-PANELS(ucgPanels,{0,0,UC_Width/fontX,UC_Height/fontY});
-UCGLibOut ucgOut(ucg,colors,ucg_tops,ucgPanels,fontX,fontY);
-
-menuOut* const outputs[] MEMMODE={&outSerial,&ucgOut};//list of output devices
-outputsList out(outputs,2);//outputs list controller
-
-//define navigation root and aux objects
-navNode nav_cursors[MAX_DEPTH];//aux objects to control each level of navigation
-navRoot nav(mainMenu, nav_cursors, MAX_DEPTH, Serial, out);*/
-
-void setup(void)
-{
- Serial.begin(115200);
- while(!Serial);
- ucg.begin(UCG_FONT_MODE_TRANSPARENT);
- ucg.clearScreen();
- ucg.setFont(ucg_font_courB08_tr);//choose fized width font (monometric)
- ucg.setRotate90();
- ucg.setColor(255,255,255);
- ucg.setFontPosTop();
- ucg.print("Menu 4.x ucg");
- delay(1000);
- ucg.clearScreen();
- ucg.setRotate90();
- ucg.setFontPosBottom();
-}
-
-void loop(void)
-{
- nav.poll();
-}
diff --git a/examples/UTFT/.gitignore b/examples/UTFT/.gitignore
deleted file mode 100644
index 5dac9f52..00000000
--- a/examples/UTFT/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.pioenvs
-.piolibdeps
-.clang_complete
-.gcc-flags.json
diff --git a/examples/UTFT/.travis.yml b/examples/UTFT/.travis.yml
deleted file mode 100644
index 2c4ff5c9..00000000
--- a/examples/UTFT/.travis.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-# Continuous Integration (CI) is the practice, in software
-# engineering, of merging all developer working copies with a shared mainline
-# several times a day < http://docs.platformio.org/page/ci/index.html >
-#
-# Documentation:
-#
-# * Travis CI Embedded Builds with PlatformIO
-# < https://docs.travis-ci.com/user/integration/platformio/ >
-#
-# * PlatformIO integration with Travis CI
-# < http://docs.platformio.org/page/ci/travis.html >
-#
-# * User Guide for `platformio ci` command
-# < http://docs.platformio.org/page/userguide/cmd_ci.html >
-#
-#
-# Please choice one of the following templates (proposed below) and uncomment
-# it (remove "# " before each line) or use own configuration according to the
-# Travis CI documentation (see above).
-#
-
-
-#
-# Template #1: General project. Test it using existing `platformio.ini`.
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio run
-
-
-#
-# Template #2: The project is intended to by used as a library with examples
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# env:
-# - PLATFORMIO_CI_SRC=path/to/test/file.c
-# - PLATFORMIO_CI_SRC=examples/file.ino
-# - PLATFORMIO_CI_SRC=path/to/test/directory
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
diff --git a/examples/UTFT/UTFT/UTFT.ino b/examples/UTFT/UTFT/UTFT.ino
deleted file mode 100644
index bbaf1a42..00000000
--- a/examples/UTFT/UTFT/UTFT.ino
+++ /dev/null
@@ -1,212 +0,0 @@
-/********************
-Sept. 2014 ~ Oct 2016 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-
-menu with UTFT (tested on arduino due)
-output: 3.2″ TFT LCD Module Display 240X320
-input: Serial + Touch Panel
-www.r-site.net
-
-UTFT library from:
- http://www.rinkydinkelectronics.com/library.php?id=51
- http://www.rinkydinkelectronics.com/library.php?id=92
-
-Note: I was unable to build for esp8266 - neu-rah
-***/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-using namespace Menu;
-
-UTFT tft(CTE28,25,26,27,28);
-//extern uint8_t SmallFont[];
-extern uint8_t BigFont[];
-//extern uint8_t SevenSegNumFont[];
-
-#define LEDPIN 13
-
-result doAlert(eventMask e, prompt &item);
-
-result showEvent(eventMask e,navNode& nav,prompt& item) {
- Serial.print("event: ");
- Serial.println(e);
- return proceed;
-}
-
-int test=55;
-
-result action1(eventMask e) {
- Serial.print(e);
- Serial.println(" action1 executed, proceed menu");Serial.flush();
- return proceed;
-}
-
-result action2(eventMask e,navNode& nav, prompt &item) {
- Serial.print(e);
- Serial.println(" action2 executed, quiting menu");
- return quit;
-}
-
-int ledCtrl=LOW;
-
-result myLedOn() {
- ledCtrl=HIGH;
- return proceed;
-}
-result myLedOff() {
- ledCtrl=LOW;
- return proceed;
-}
-
-TOGGLE(ledCtrl,setLed,"Led: ",doNothing,noEvent,noStyle//,doExit,enterEvent,noStyle
- ,VALUE("On",HIGH,doNothing,noEvent)
- ,VALUE("Off",LOW,doNothing,noEvent)
-);
-
-int selTest=0;
-SELECT(selTest,selMenu,"Select",doNothing,noEvent,noStyle
- ,VALUE("Zero",0,doNothing,noEvent)
- ,VALUE("One",1,doNothing,noEvent)
- ,VALUE("Two",2,doNothing,noEvent)
-);
-
-int chooseTest=-1;
-CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
- ,VALUE("First",1,doNothing,noEvent)
- ,VALUE("Second",2,doNothing,noEvent)
- ,VALUE("Third",3,doNothing,noEvent)
- ,VALUE("Last",-1,doNothing,noEvent)
-);
-
-//customizing a prompt look!
-//by extending the prompt class
-class altPrompt:public prompt {
-public:
- altPrompt(constMEM promptShadow& p):prompt(p) {}
- Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t) override {
- return out.printRaw(F("special prompt!"),len);;
- }
-};
-
-MENU(subMenu,"Sub-Menu",showEvent,anyEvent,noStyle
- ,OP("Sub1",showEvent,anyEvent)
- ,OP("Sub2",showEvent,anyEvent)
- ,OP("Sub3",showEvent,anyEvent)
- ,altOP(altPrompt,"",showEvent,anyEvent)
- ,EXIT(" colors[] MEMMODE={
- {{VGA_BLACK,VGA_BLACK},{VGA_BLACK,VGA_BLUE,VGA_BLUE}},//bgColor
- {{VGA_GRAY,VGA_GRAY},{VGA_WHITE,VGA_WHITE,VGA_WHITE}},//fgColor
- {{VGA_WHITE,VGA_BLACK},{VGA_YELLOW,VGA_YELLOW,VGA_RED}},//valColor
- {{VGA_WHITE,VGA_BLACK},{VGA_WHITE,VGA_YELLOW,VGA_YELLOW}},//unitColor
- {{VGA_WHITE,VGA_GRAY},{VGA_BLACK,VGA_BLUE,VGA_WHITE}},//cursorColor
- {{VGA_WHITE,VGA_YELLOW},{VGA_BLUE,VGA_RED,VGA_RED}},//titleColor
-};
-
-//PANELS(serial_panels,{0,0,40,10});//or use default
-//serialOut outSerial(Serial);//,serial_panels);//the output device (just the serial port)
-
-#define MAX_DEPTH 2
-
-PANELS(gfx_panels,{0,0,12,8},{13,0,12,8});
-idx_t gfx_tops[MAX_DEPTH];
-utftOut outGfx(tft,colors,gfx_tops,gfx_panels,16,16);//output device, latter set resolution from font measure
-
-idx_t serialTops[MAX_DEPTH]={0};
-serialOut outSerial(Serial,serialTops);
-MENU_OUTLIST(out,&outGfx,&outSerial);
-
-extern navRoot nav;
-URTouch uTouch( 6, 5, 4, 3, 2);
-menuUTouch touchPanel(uTouch,nav,outGfx);
-serialIn serial(Serial);
-MENU_INPUTS(in,&touchPanel,&serial);
-
-NAVROOT(nav,mainMenu,MAX_DEPTH,in,out);
-
-result alert(menuOut& o,idleEvent e) {
- if (e==idling) {
- o.setColor(fgColor);
- o.setCursor(0,0);
- o.print("alert test");
- o.setCursor(0,1);
- o.print("press [select]");
- o.setCursor(0,2);
- o.print("to continue...");
- }
- return proceed;
-}
-
-result doAlert(eventMask e, prompt &item) {
- nav.idleOn(alert);
- return proceed;
-}
-
-//when menu is suspended
-result idle(menuOut& o,idleEvent e) {
- if (e==idling) {
- o.setColor(fgColor);
- o.println("suspended...");
- o.println("press [select]");
- o.println("to continue");
- o.println(millis()%1000);
- }
- return proceed;
-}
-
-void setup() {
- pinMode(LEDPIN,OUTPUT);
- while(!Serial);
- Serial.begin(115200);
- Serial.println("menu 4.x UTFT + URTouch");Serial.flush();
- nav.idleTask=idle;//point a function to be used when menu is suspended
- //mainMenu[1].enabled=disabledStatus;
-
- tft.InitLCD();
- tft.setBrightness(4);
- tft.clrScr();
-
- uTouch.InitTouch();
- uTouch.setPrecision(PREC_MEDIUM);//LOW, MEDIUM, HI, EXTREME
-
- tft.setFont(BigFont);
- tft.setColor(0, 255, 0);
- tft.setBackColor(0, 0, 0);
-
- //outGfx.resX=tft.getFontXsize()+1;
- //outGfx.resY=tft.getFontYsize()+1;
- outGfx.println("Menu 4.x on UTFT");
- delay(1000);
- tft.clrScr();
-}
-
-void loop() {
- nav.poll();//this device only draws when needed
- digitalWrite(LEDPIN, ledCtrl);
- delay(100);//simulate a delay when other tasks are done
-}
diff --git a/examples/UTFT/platformio.ini b/examples/UTFT/platformio.ini
deleted file mode 100644
index 98119fd2..00000000
--- a/examples/UTFT/platformio.ini
+++ /dev/null
@@ -1,36 +0,0 @@
-; PlatformIO Project Configuration File
-;
-; Build options: build flags, source filter
-; Upload options: custom upload port, speed and extra flags
-; Library options: dependencies, extra library storages
-; Advanced options: extra scripting
-;
-; Please visit documentation for the other options and examples
-; http://docs.platformio.org/page/projectconf.html
-
-[platformio]
-src_dir=UTFT
-; lib_dir=~/Arduino/Libraries
-
-[env:due]
-platform = atmelsam
-board = due
-framework = arduino
-build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined
-
-; [env:teensy31]
-; platform=teensy
-; board=teensy31
-; framework=arduino
-
-; [env:nanoatmega328]
-; platform=atmelavr
-; board=nanoatmega328
-; framework=arduino
-
-; [env:esp12e]
-; platform = espressif8266
-; board = esp12e
-; framework = arduino
-; upload_speed=921600
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -lstdc++ -DDEBUG
diff --git a/examples/adafruitGfx/eTFT/TFT_eSPI/TFT_eSPI.ino b/examples/adafruitGfx/eTFT/TFT_eSPI/TFT_eSPI.ino
deleted file mode 100644
index d0a55ce9..00000000
--- a/examples/adafruitGfx/eTFT/TFT_eSPI/TFT_eSPI.ino
+++ /dev/null
@@ -1,188 +0,0 @@
-#include
-
-/********************
-Sept. 2014 ~ Jan 2019 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-
-TFT_eSPI example
-output: TFT_eSPI + Serial
-input: Serial
-www.r-site.net
-***/
-
-#include
-
-#include
-#include
-#include
-// #include
-#include //must include this even if not doing web output...
-
-using namespace Menu;
-
-TFT_eSPI gfx;
-
-result doAlert(eventMask e, prompt &item);
-
-int test=55;
-
-int ledCtrl=LOW;
-
-result myLedOn() {
- ledCtrl=HIGH;
- return proceed;
-}
-result myLedOff() {
- ledCtrl=LOW;
- return proceed;
-}
-
-TOGGLE(ledCtrl,setLed,"Led: ",doNothing,noEvent,noStyle//,doExit,enterEvent,noStyle
- ,VALUE("On",HIGH,doNothing,noEvent)
- ,VALUE("Off",LOW,doNothing,noEvent)
-);
-
-int selTest=0;
-SELECT(selTest,selMenu,"Select",doNothing,noEvent,noStyle
- ,VALUE("Zero",0,doNothing,noEvent)
- ,VALUE("One",1,doNothing,noEvent)
- ,VALUE("Two",2,doNothing,noEvent)
-);
-
-int chooseTest=-1;
-CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
- ,VALUE("First",1,doNothing,noEvent)
- ,VALUE("Second",2,doNothing,noEvent)
- ,VALUE("Third",3,doNothing,noEvent)
- ,VALUE("Last",-1,doNothing,noEvent)
-);
-
-//customizing a prompt look!
-//by extending the prompt class
-class altPrompt:public prompt {
-public:
- altPrompt(constMEM promptShadow& p):prompt(p) {}
- Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t) override {
- return out.printRaw(F("special prompt!"),len);;
- }
-};
-
-MENU(subMenu,"Sub-Menu",doNothing,noEvent,noStyle
- ,altOP(altPrompt,"",doNothing,noEvent)
- ,OP("Op",doNothing,noEvent)
- ,EXIT(" colors[] MEMMODE={
- {{(uint16_t)Black,(uint16_t)Black}, {(uint16_t)Black, (uint16_t)Blue, (uint16_t)Blue}},//bgColor
- {{(uint16_t)Gray, (uint16_t)Gray}, {(uint16_t)White, (uint16_t)White, (uint16_t)White}},//fgColor
- {{(uint16_t)White,(uint16_t)Black}, {(uint16_t)Yellow,(uint16_t)Yellow,(uint16_t)Red}},//valColor
- {{(uint16_t)White,(uint16_t)Black}, {(uint16_t)White, (uint16_t)Yellow,(uint16_t)Yellow}},//unitColor
- {{(uint16_t)White,(uint16_t)Gray}, {(uint16_t)Black, (uint16_t)Blue, (uint16_t)White}},//cursorColor
- {{(uint16_t)White,(uint16_t)Yellow},{(uint16_t)Blue, (uint16_t)Red, (uint16_t)Red}},//titleColor
-};
-
-#define MAX_DEPTH 4
-
-serialIn serial(Serial);
-
-//MENU_INPUTS(in,&serial);its single, no need to `chainStream`
-
-//define serial output device
-idx_t serialTops[MAX_DEPTH]={0};
-serialOut outSerial(Serial,serialTops);
-
-#define GFX_WIDTH 128
-#define GFX_HEIGHT 64
-#define fontW 6
-#define fontH 9
-
-constMEM panel panels[] MEMMODE = {{0, 0, GFX_WIDTH / fontW, GFX_HEIGHT / fontH}};
-navNode* nodes[sizeof(panels) / sizeof(panel)]; //navNodes to store navigation status
-panelsList pList(panels, nodes, 1); //a list of panels and nodes
-idx_t eSpiTops[MAX_DEPTH]={0};
-TFT_eSPIOut eSpiOut(gfx,colors,eSpiTops,pList,fontW,fontH+1);
-menuOut* constMEM outputs[] MEMMODE={&outSerial,&eSpiOut};//list of output devices
-outputsList out(outputs,sizeof(outputs)/sizeof(menuOut*));//outputs list controller
-
-NAVROOT(nav,mainMenu,MAX_DEPTH,serial,out);
-
-//when menu is suspended
-result idle(menuOut& o,idleEvent e) {
- if (e==idling) {
- o.println(F("suspended..."));
- o.println(F("press [select]"));
- o.println(F("to continue"));
- }
- return proceed;
-}
-
-//config myOptions('*','-',defaultNavCodes,false);
-
-void setup() {
- //options=&myOptions;//can customize options
- // pinMode(LEDPIN,OUTPUT);
- Serial.begin(115200);
- while(!Serial);
- Serial.println("menu 4.x test");
- Serial.flush();
- nav.idleTask=idle;//point a function to be used when menu is suspended
- mainMenu[1].disable();
- //outGfx.usePreview=true;//reserve one panel for preview?
- //nav.showTitle=false;//show menu title?
-
- SPI.begin();
- gfx.init();
- gfx.setRotation(3);
- // gfx.setTextSize(textScale);//test scalling
- gfx.setTextWrap(false);
- gfx.fillScreen(Black);
- gfx.setTextColor(Red,Black);
- gfx.println("Menu 4.x test on GFX");
- delay(1000);
-}
-
-void loop() {
- nav.poll();//this device only draws when needed
- // digitalWrite(LEDPIN, ledCtrl);
- delay(100);//simulate a delay when other tasks are done
-}
diff --git a/examples/adafruitGfx/lcdMono/.gitignore b/examples/adafruitGfx/lcdMono/.gitignore
deleted file mode 100644
index e05273b2..00000000
--- a/examples/adafruitGfx/lcdMono/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.pioenvs
-.clang_complete
-.gcc-flags.json
-.piolibdeps
\ No newline at end of file
diff --git a/examples/adafruitGfx/lcdMono/.travis.yml b/examples/adafruitGfx/lcdMono/.travis.yml
deleted file mode 100644
index 72c6e43f..00000000
--- a/examples/adafruitGfx/lcdMono/.travis.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-# Continuous Integration (CI) is the practice, in software
-# engineering, of merging all developer working copies with a shared mainline
-# several times a day < http://docs.platformio.org/en/stable/ci/index.html >
-#
-# Documentation:
-#
-# * Travis CI Embedded Builds with PlatformIO
-# < https://docs.travis-ci.com/user/integration/platformio/ >
-#
-# * PlatformIO integration with Travis CI
-# < http://docs.platformio.org/en/stable/ci/travis.html >
-#
-# * User Guide for `platformio ci` command
-# < http://docs.platformio.org/en/stable/userguide/cmd_ci.html >
-#
-#
-# Please choice one of the following templates (proposed below) and uncomment
-# it (remove "# " before each line) or use own configuration according to the
-# Travis CI documentation (see above).
-#
-
-
-#
-# Template #1: General project. Test it using existing `platformio.ini`.
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio run
-
-
-#
-# Template #2: The project is intended to by used as a library with examples
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# env:
-# - PLATFORMIO_CI_SRC=path/to/test/file.c
-# - PLATFORMIO_CI_SRC=examples/file.ino
-# - PLATFORMIO_CI_SRC=path/to/test/directory
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
diff --git a/examples/adafruitGfx/lcdMono/lcdMono/lcdMono.ino b/examples/adafruitGfx/lcdMono/lcdMono/lcdMono.ino
deleted file mode 100644
index c29c6308..00000000
--- a/examples/adafruitGfx/lcdMono/lcdMono/lcdMono.ino
+++ /dev/null
@@ -1,210 +0,0 @@
-#include
-
-/********************
-Sept. 2014 ~ Oct 2017 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-
-menu with adafruit GFX
-output: Nokia 5110 display (PCD8544 HW SPI) + Serial
-input: Encoder + Serial
-www.r-site.net
-
-***/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-using namespace Menu;
-
-//PCD8544 aka nokia5110
-#define GFX_DC 9
-#define GFX_CS 8
-#define GFX_RST 7
-
-Adafruit_PCD8544 gfx(GFX_DC,GFX_CS,GFX_RST);
-
-#define LEDPIN A3
-
-// rotary encoder pins
-#define encA 2
-#define encB 3
-#define encBtn 4
-
-result showEvent(eventMask e,navNode& nav,prompt& item) {
- Serial.print(F("event:"));
- Serial.print(e);
- return proceed;
-}
-
-int test=55;
-int ledCtrl=LOW;
-
-result myLedOn() {
- ledCtrl=HIGH;
- return proceed;
-}
-result myLedOff() {
- ledCtrl=LOW;
- return proceed;
-}
-
-result alert(menuOut& o,idleEvent e);
-result doAlert(eventMask e, prompt &item);
-
-TOGGLE(ledCtrl,setLed,"Led: ",doNothing,noEvent,noStyle//,doExit,enterEvent,noStyle
- ,VALUE("On",HIGH,doNothing,noEvent)
- ,VALUE("Off",LOW,doNothing,noEvent)
-);
-
-char* constMEM hexDigit MEMMODE="0123456789ABCDEF";
-char* constMEM hexNr[] MEMMODE={"0","x",hexDigit,hexDigit};
-char buf1[]="0x11";
-
-MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
- ,FIELD(test,"Test","%",0,100,10,1,doNothing,noEvent,wrapStyle)
- ,SUBMENU(setLed)
- ,OP("LED On",myLedOn,enterEvent)
- ,OP("LED Off",myLedOff,enterEvent)
- ,OP("Alert test",doAlert,enterEvent)
- ,EDIT("Hex",buf1,hexNr,doNothing,noEvent,noStyle)
- ,EXIT(" colors[] MEMMODE={
- {{WHITE,BLACK},{WHITE,BLACK,BLACK}},//bgColor
- {{BLACK,WHITE},{BLACK,WHITE,WHITE}},//fgColor
- {{BLACK,WHITE},{BLACK,WHITE,WHITE}},//valColor
- {{BLACK,WHITE},{BLACK,WHITE,WHITE}},//unitColor
- {{BLACK,WHITE},{WHITE,WHITE,WHITE}},//cursorColor
- {{BLACK,WHITE},{WHITE,BLACK,BLACK}},//titleColor
-};
-
-#define gfxWidth 84
-#define gfxHeight 48
-#define fontX 6
-//5
-#define fontY 9
-#define MAX_DEPTH 2
-
-encoderIn encoder;//simple quad encoder driver
-encoderInStream encStream(encoder,4);// simple quad encoder fake Stream
-
-//a keyboard with only one key as the encoder button
-keyMap encBtn_map[]={{-encBtn,defaultNavCodes[enterCmd].ch}};//negative pin numbers use internal pull-up, this is on when low
-keyIn<1> encButton(encBtn_map);//1 is the number of keys
-
-serialIn serial(Serial);
-MENU_INPUTS(in,&encStream,&encButton,&serial);
-
-#define MAX_DEPTH 2
-#define textScale 1
-MENU_OUTPUTS(out,MAX_DEPTH
- ,ADAGFX_OUT(gfx,colors,fontX,fontY,{0,0,gfxWidth/fontX,gfxHeight/fontY})
- ,SERIAL_OUT(Serial)
-);
-
-NAVROOT(nav,mainMenu,MAX_DEPTH,in,out);
-
-//initializing output and menu nav without macros
-/*const panel default_serial_panels[] MEMMODE={{0,0,40,10}};
-navNode* default_serial_nodes[sizeof(default_serial_panels)/sizeof(panel)];
-panelsList default_serial_panel_list(
- default_serial_panels,
- default_serial_nodes,
- sizeof(default_serial_panels)/sizeof(panel)
-);
-
-//define output device
-idx_t serialTops[MAX_DEPTH]={0};
-serialOut outSerial(*(Print*)&Serial,serialTops);
-
-//define outputs controller
-idx_t gfx_tops[MAX_DEPTH];
-PANELS(gfxPanels,{0,0,gfxWidth/fontX,gfxHeight/fontY});
-adaGfxOut adaOut(gfx,colors,gfx_tops,gfxPanels);
-
-menuOut* const outputs[] MEMMODE={&outSerial,&adaOut};//list of output devices
-outputsList out(outputs,2);//outputs list controller
-
-//define input device
-serialIn serial(Serial);
-
-//define navigation root and aux objects
-navNode nav_cursors[MAX_DEPTH];//aux objects to control each level of navigation
-navRoot nav(mainMenu, nav_cursors, MAX_DEPTH, serial, out);*/
-
-result alert(menuOut& o,idleEvent e) {
- if (e==idling) {
- o.setCursor(0,0);
- o.print(F("alert test"));
- o.setCursor(0,1);
- o.print(F("press [select]"));
- o.setCursor(0,2);
- o.print(F("to continue..."));
- }
- return proceed;
-}
-
-result doAlert(eventMask e, prompt &item) {
- nav.idleOn(alert);
- return proceed;
-}
-
-//when menu is suspended
-result idle(menuOut& o,idleEvent e) {
- o.setCursor(0,0);
- o.print(F("suspended..."));
- o.setCursor(0,1);
- o.print(F("press [select]"));
- o.setCursor(0,2);
- o.print(F("to continue"));
- return proceed;
-}
-
-void setup() {
- pinMode(LEDPIN,OUTPUT);
- Serial.begin(115200);
- while(!Serial);
- Serial.println(F("menu 4.x test"));
- Serial.flush();
- nav.idleTask=idle;//point a function to be used when menu is suspended
-
- encButton.begin();
- encoder.begin();
-
- SPI.begin();
- gfx.begin();
- gfx.clearDisplay();
- gfx.println(F("Menu 4.x test on GFX"));
- gfx.setContrast(50);
- gfx.display(); // show splashscreen
- delay(2000);
- gfx.clearDisplay();
- gfx.display(); // show splashscreen
- // gfx.drawRect(0, 0, 84, 48, 1);
-}
-
-void loop() {
- //nav.poll();//it can work like this, followed by the gfx.display()
- //gfx.display();
-
- //or on a need to draw basis:
- nav.doInput();
- if (nav.changed(0)) {//only draw if changed
- nav.doOutput();
- gfx.display();
- }
-
- digitalWrite(LEDPIN, ledCtrl);
- delay(100);//simulate a delay when other tasks are done
-}
diff --git a/examples/adafruitGfx/lcdMono/platformio.ini b/examples/adafruitGfx/lcdMono/platformio.ini
deleted file mode 100644
index fc3e93bc..00000000
--- a/examples/adafruitGfx/lcdMono/platformio.ini
+++ /dev/null
@@ -1,25 +0,0 @@
-; PlatformIO Project Configuration File
-;
-; Build options: build flags, source filter, extra scripting
-; Upload options: custom port, speed and extra flags
-; Library options: dependencies, extra library storages
-;
-; Please visit documentation for the other options and examples
-; http://docs.platformio.org/en/stable/projectconf.html
-
-[platformio]
-src_dir=lcdMono
-; lib_dir=~/Arduino/Libraries
-
-[env:nanoatmega328]
-platform=atmelavr
-board=nanoatmega328
-framework=arduino
-upload_flags=-V
-build_flags = -DNO_DEBUG -DNO_MENU_ASYNC
-
-; [env:teensy31]
-; platform = teensy
-; board = teensy31
-; framework = arduino
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -Wno-switch
diff --git a/examples/adafruitGfx/tft/.gitignore b/examples/adafruitGfx/tft/.gitignore
deleted file mode 100644
index e05273b2..00000000
--- a/examples/adafruitGfx/tft/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.pioenvs
-.clang_complete
-.gcc-flags.json
-.piolibdeps
\ No newline at end of file
diff --git a/examples/adafruitGfx/tft/.travis.yml b/examples/adafruitGfx/tft/.travis.yml
deleted file mode 100644
index 72c6e43f..00000000
--- a/examples/adafruitGfx/tft/.travis.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-# Continuous Integration (CI) is the practice, in software
-# engineering, of merging all developer working copies with a shared mainline
-# several times a day < http://docs.platformio.org/en/stable/ci/index.html >
-#
-# Documentation:
-#
-# * Travis CI Embedded Builds with PlatformIO
-# < https://docs.travis-ci.com/user/integration/platformio/ >
-#
-# * PlatformIO integration with Travis CI
-# < http://docs.platformio.org/en/stable/ci/travis.html >
-#
-# * User Guide for `platformio ci` command
-# < http://docs.platformio.org/en/stable/userguide/cmd_ci.html >
-#
-#
-# Please choice one of the following templates (proposed below) and uncomment
-# it (remove "# " before each line) or use own configuration according to the
-# Travis CI documentation (see above).
-#
-
-
-#
-# Template #1: General project. Test it using existing `platformio.ini`.
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio run
-
-
-#
-# Template #2: The project is intended to by used as a library with examples
-#
-
-# language: python
-# python:
-# - "2.7"
-#
-# sudo: false
-# cache:
-# directories:
-# - "~/.platformio"
-#
-# env:
-# - PLATFORMIO_CI_SRC=path/to/test/file.c
-# - PLATFORMIO_CI_SRC=examples/file.ino
-# - PLATFORMIO_CI_SRC=path/to/test/directory
-#
-# install:
-# - pip install -U platformio
-#
-# script:
-# - platformio ci --lib="." --board=ID_1 --board=ID_2 --board=ID_N
diff --git a/examples/adafruitGfx/tft/platformio.ini b/examples/adafruitGfx/tft/platformio.ini
deleted file mode 100644
index deb28f5b..00000000
--- a/examples/adafruitGfx/tft/platformio.ini
+++ /dev/null
@@ -1,26 +0,0 @@
-; PlatformIO Project Configuration File
-;
-; Build options: build flags, source filter, extra scripting
-; Upload options: custom port, speed and extra flags
-; Library options: dependencies, extra library storages
-;
-; Please visit documentation for the other options and examples
-; http://docs.platformio.org/en/stable/projectconf.html
-
-[platformio]
-src_dir=tft
-; lib_dir=~/Arduino/Libraries
-
-[env:nanoatmega328]
-platform = atmelavr
-board = nanoatmega328
-framework = arduino
-upload_port=/dev/ttyUSB*
-upload_flags=-V
-build_flags = -DNODEBUG
-
-; [env:teensy31]
-; platform = teensy
-; board = teensy31
-; framework = arduino
-; build_flags = -Wno-comment -Wno-reorder -Wno-strict-aliasing -Wno-builtin-macro-redefined -Wno-switch
diff --git a/examples/adafruitGfx/tft/tft/tft.ino b/examples/adafruitGfx/tft/tft/tft.ino
deleted file mode 100644
index 5907caa8..00000000
--- a/examples/adafruitGfx/tft/tft/tft.ino
+++ /dev/null
@@ -1,210 +0,0 @@
-#include
-
-/********************
-Sept. 2014 ~ Oct 2016 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-
-menu with adafruit GFX
-output: 1.8" TFT 128*160 (ST7735 HW SPI)
-input: Serial + encoder
-www.r-site.net
-
-alternative encoder (clickEncoder) uses:
-https://github.com/0xPIT/encoder
-https://github.com/PaulStoffregen/TimerOne
-***/
-
-//removed as extra libs are not included into travis
-// #define USE_CLICK_ENCODER
-
-#include
-#include
-#include
-#include
-#include
-#ifdef USE_CLICK_ENCODER
- #include
- #include
- #include
-#else
- #include
-#endif
-#include
-#include
-#include
-#include
-
-using namespace Menu;
-
-//ST7735 1.8TFT 128x160
-#define TFT_CS A1
-#define TFT_DC A0
-#define TFT_RST A2
-
-Adafruit_ST7735 gfx(TFT_CS, TFT_DC, TFT_RST);
-
-#define LEDPIN A3
-
-// rotary encoder pins
-#define encA 2
-#define encB 3
-#define encBtn 4
-
-result doAlert(eventMask e, prompt &item);
-
-int test=55;
-
-int ledCtrl=LOW;
-
-result myLedOn() {
- ledCtrl=HIGH;
- return proceed;
-}
-result myLedOff() {
- ledCtrl=LOW;
- return proceed;
-}
-
-TOGGLE(ledCtrl,setLed,"Led: ",doNothing,noEvent,noStyle//,doExit,enterEvent,noStyle
- ,VALUE("On",HIGH,doNothing,noEvent)
- ,VALUE("Off",LOW,doNothing,noEvent)
-);
-
-int selTest=0;
-SELECT(selTest,selMenu,"Select",doNothing,noEvent,noStyle
- ,VALUE("Zero",0,doNothing,noEvent)
- ,VALUE("One",1,doNothing,noEvent)
- ,VALUE("Two",2,doNothing,noEvent)
-);
-
-int chooseTest=-1;
-CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
- ,VALUE("First",1,doNothing,noEvent)
- ,VALUE("Second",2,doNothing,noEvent)
- ,VALUE("Third",3,doNothing,noEvent)
- ,VALUE("Last",-1,doNothing,noEvent)
-);
-
-//customizing a prompt look!
-//by extending the prompt class
-class altPrompt:public prompt {
-public:
- altPrompt(constMEM promptShadow& p):prompt(p) {}
- Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t) override {
- return out.printRaw(F("special prompt!"),len);;
- }
-};
-
-MENU(subMenu,"Sub-Menu",doNothing,noEvent,noStyle
- ,altOP(altPrompt,"",doNothing,noEvent)
- ,OP("Op",doNothing,noEvent)
- ,EXIT(" colors[] MEMMODE={
- {{(uint16_t)ST7735_BLACK,(uint16_t)ST7735_BLACK}, {(uint16_t)ST7735_BLACK, (uint16_t)ST7735_BLUE, (uint16_t)ST7735_BLUE}},//bgColor
- {{(uint16_t)ST7735_GRAY, (uint16_t)ST7735_GRAY}, {(uint16_t)ST7735_WHITE, (uint16_t)ST7735_WHITE, (uint16_t)ST7735_WHITE}},//fgColor
- {{(uint16_t)ST7735_WHITE,(uint16_t)ST7735_BLACK}, {(uint16_t)ST7735_YELLOW,(uint16_t)ST7735_YELLOW,(uint16_t)ST7735_RED}},//valColor
- {{(uint16_t)ST7735_WHITE,(uint16_t)ST7735_BLACK}, {(uint16_t)ST7735_WHITE, (uint16_t)ST7735_YELLOW,(uint16_t)ST7735_YELLOW}},//unitColor
- {{(uint16_t)ST7735_WHITE,(uint16_t)ST7735_GRAY}, {(uint16_t)ST7735_BLACK, (uint16_t)ST7735_BLUE, (uint16_t)ST7735_WHITE}},//cursorColor
- {{(uint16_t)ST7735_WHITE,(uint16_t)ST7735_YELLOW},{(uint16_t)ST7735_BLUE, (uint16_t)ST7735_RED, (uint16_t)ST7735_RED}},//titleColor
-};
-
-serialIn serial(Serial);
-
-#ifdef USE_CLICK_ENCODER
- ClickEncoder clickEncoder(encA,encB,encBtn);
- ClickEncoderStream encStream(clickEncoder,1);
- MENU_INPUTS(in,&encStream,&serial);
- void timerIsr() {clickEncoder.service();}
-#else
- encoderIn encoder;//simple quad encoder driver
- encoderInStream encStream(encoder,4);// simple quad encoder fake Stream
- //a keyboard with only one key as the encoder button
- keyMap encBtn_map[]={{-encBtn,defaultNavCodes[enterCmd].ch}};//negative pin numbers use internal pull-up, this is on when low
- keyIn<1> encButton(encBtn_map);//1 is the number of keys
- MENU_INPUTS(in,&encStream,&encButton,&serial);
-#endif
-
-#define MAX_DEPTH 4
-#define textScale 1
-MENU_OUTPUTS(out,MAX_DEPTH
- ,ADAGFX_OUT(gfx,colors,6*textScale,9*textScale,{0,0,14,8},{14,0,14,8})
- ,SERIAL_OUT(Serial)
-);
-
-NAVROOT(nav,mainMenu,MAX_DEPTH,in,out);
-
-//when menu is suspended
-result idle(menuOut& o,idleEvent e) {
- if (e==idling) {
- o.println(F("suspended..."));
- o.println(F("press [select]"));
- o.println(F("to continue"));
- }
- return proceed;
-}
-
-//config myOptions('*','-',defaultNavCodes,false);
-
-void setup() {
- //options=&myOptions;//can customize options
- pinMode(LEDPIN,OUTPUT);
- Serial.begin(115200);
- while(!Serial);
- Serial.println("menu 4.x test");
- Serial.flush();
- nav.idleTask=idle;//point a function to be used when menu is suspended
- mainMenu[1].disable();
- //outGfx.usePreview=true;//reserve one panel for preview?
- //nav.showTitle=false;//show menu title?
-
- //pinMode(encBtn, INPUT_PULLUP);
- #ifdef USE_CLICK_ENCODER
- Timer1.initialize(1000);
- Timer1.attachInterrupt(timerIsr);
- #else
- encButton.begin();
- encoder.begin();
- #endif
-
- SPI.begin();
- gfx.initR(INITR_BLACKTAB);
- gfx.setRotation(3);
- gfx.setTextSize(textScale);//test scalling
- gfx.setTextWrap(false);
- gfx.fillScreen(ST7735_BLACK);
- gfx.setTextColor(ST7735_RED,ST7735_BLACK);
- gfx.println("Menu 4.x test on GFX");
- delay(1000);
-}
-
-void loop() {
- nav.poll();//this device only draws when needed
- digitalWrite(LEDPIN, ledCtrl);
- delay(100);//simulate a delay when other tasks are done
-}
diff --git a/examples/adafruitGfx/tft_interrupt/tft_interrupt.ino b/examples/adafruitGfx/tft_interrupt/tft_interrupt.ino
deleted file mode 100644
index 3bfc881c..00000000
--- a/examples/adafruitGfx/tft_interrupt/tft_interrupt.ino
+++ /dev/null
@@ -1,295 +0,0 @@
-#include
-
-/********************
-Sept. 2014 ~ Oct 2016 Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-Oct. 2018 - modified by Kevin O'rourke to use interrupts on pins for the sam3x
-
-menu with the newer adafruit GFX
-output: 1.8" TFT 128*160 (ST7735 HW SPI) or
-output: 1.8" TFT 128*160 (ST7735 SOFT SPI)
-
-input: Serial + interrupts
-www.r-site.net
-
-***/
-
-//removed as extra libs are not included into travis
-// #define USE_CLICK_ENCODER
-#define USE_INTERRUPT_PINS // using a joy button
-#define DONT_SHOW_SUSPEND // dont show the suspended screen
-
-#include
-#include
-#include
-#include
-#include
-#ifndef USE_INTERRUPT_PINS
- #ifdef USE_CLICK_ENCODER
- #include
- #include
- #include
- #else
- #include
- #endif
- #include
- #include
- #include
- #include
-#else
- #include
- #include
- #include
- #include
-
-#endif
-
-
-using namespace Menu;
-
-//ST7735 1.8TFT 128x160
-//#define TFT_CS A1
-//#define TFT_DC A0
-//#define TFT_RST A2
-
-
-
-void wait_for(uint32_t wait) {
- uint64_t myMillis = wait * 11986; // approx 11986000 nop nop per sec
- for (uint64_t Counting = 0; Counting <= myMillis; Counting++) {
- __asm__("nop\n\t");
- }
-}
-
-
-#define SPI_SCK 13
-#define SPI_DI 12
-#define SPI_DO 11
-#define TFT_CS 15
-#define TFT_RST 0
-#define TFT_DC 8
-
-//Adafruit_ST7735 gfx(TFT_CS, TFT_DC, TFT_RST); // hardware if possible
-
-Adafruit_ST7735 gfx = Adafruit_ST7735(TFT_CS, TFT_DC, SPI_DO, SPI_SCK, TFT_RST);// software spi on the due
-
-#define LEDPIN LED_BUILTIN
-
-#ifndef USE_INTERRUPT_PINS
- // rotary encoder pins
- #define encA 2
- #define encB 3
- #define encBtn 4
-#else
- // interrupt pins sam3x with joy button
- #define BTN_UP 2
- #define BTN_DOWN 3
- #define BTN_SEL 5
- #define BTN_LEFT 6
- #define BTN_RIGHT 7
-#endif
-
-result doAlert(eventMask e, prompt &item);
-
-int test=55;
-
-int ledCtrl=LOW;
-
-result myLedOn() {
- ledCtrl=HIGH;
- return proceed;
-}
-result myLedOff() {
- ledCtrl=LOW;
- return proceed;
-}
-
-TOGGLE(ledCtrl,setLed,"Led: ",doNothing,noEvent,noStyle//,doExit,enterEvent,noStyle
- ,VALUE("On",HIGH,doNothing,noEvent)
- ,VALUE("Off",LOW,doNothing,noEvent)
-);
-
-int selTest=0;
-SELECT(selTest,selMenu,"Select",doNothing,noEvent,noStyle
- ,VALUE("Zero",0,doNothing,noEvent)
- ,VALUE("One",1,doNothing,noEvent)
- ,VALUE("Two",2,doNothing,noEvent)
-);
-
-int chooseTest=-1;
-CHOOSE(chooseTest,chooseMenu,"Choose",doNothing,noEvent,noStyle
- ,VALUE("First",1,doNothing,noEvent)
- ,VALUE("Second",2,doNothing,noEvent)
- ,VALUE("Third",3,doNothing,noEvent)
- ,VALUE("Last",-1,doNothing,noEvent)
-);
-
-//customizing a prompt look!
-//by extending the prompt class
-class confirmExit:public menu {
-public:
- confirmExit(constMEM menuNodeShadow& shadow):menu(shadow) {}
- Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t p) override {
- if(idx<0){menu::printTo(root,sel,out,idx,len,p);}
- else{out.printRaw((constText*)F("Exit"),len);}
- return idx;
- }
-};
-class altPrompt:public prompt {
-public:
- altPrompt(constMEM promptShadow& p):prompt(p) {}
- Used printTo(navRoot &root,bool sel,menuOut& out, idx_t idx,idx_t len,idx_t) override {
- return out.printRaw(F("special prompt!"),len);;
- }
-};
-
-result systemExit();
-altMENU(confirmExit,subMenu2,"Exit?",doNothing,noEvent,wrapStyle,(Menu::_menuData|Menu::_canNav)
- ,OP("Yes",systemExit,enterEvent)
- ,EXIT("Cancel")
-);
-
-MENU(subMenu,"Sub-Menu",doNothing,noEvent,noStyle
- ,altOP(altPrompt,"",doNothing,noEvent)
- ,OP("Op",doNothing,noEvent)
- ,EXIT(" colors[] MEMMODE={
- {{ST7735_BLACK,ST7735_BLACK},{ST7735_BLACK,ST7735_BLUE,ST7735_BLUE}},//bgColor
- {{ST7735_GRAY,ST7735_GRAY},{ST7735_WHITE,ST7735_WHITE,ST7735_WHITE}},//fgColor
- {{ST7735_WHITE,ST7735_BLACK},{ST7735_YELLOW,ST7735_YELLOW,ST7735_RED}},//valColor
- {{ST7735_WHITE,ST7735_BLACK},{ST7735_WHITE,ST7735_YELLOW,ST7735_YELLOW}},//unitColor
- {{ST7735_WHITE,ST7735_GRAY},{ST7735_BLACK,ST7735_BLUE,ST7735_WHITE}},//cursorColor
- {{ST7735_WHITE,ST7735_YELLOW},{ST7735_BLUE,ST7735_RED,ST7735_RED}},//titleColor
-};
-
-serialIn serial(Serial);
-
-#ifndef USE_INTERRUPT_PINS
- #ifdef USE_CLICK_ENCODER
- ClickEncoder clickEncoder(encA,encB,encBtn);
- ClickEncoderStream encStream(clickEncoder,1);
- MENU_INPUTS(in,&encStream,&serial);
- void timerIsr() {clickEncoder.service();}
- #else
- encoderIn encoder;//simple quad encoder driver
- encoderInStream encStream(encoder,4);// simple quad encoder fake Stream
- //a keyboard with only one key as the encoder button
- keyMap encBtn_map[]={{-encBtn,defaultNavCodes[enterCmd].ch}};//negative pin numbers use internal pull-up, this is on when low
- keyIn<1> encButton(encBtn_map);//1 is the number of keys
- MENU_INPUTS(in,&encStream,&encButton,&serial);
- #endif
-#else
- encoderIn encoder;//simple quad encoder driver
- encoderInStream encStream(encoder);// simple quad encoder fake Stream
- MENU_INPUTS(in,&encStream,&serial);
-#endif
-
-#define MAX_DEPTH 4
-#define textScale 1
-MENU_OUTPUTS(out,MAX_DEPTH
- ,ADAGFX_OUT(gfx,colors,6*textScale,9*textScale,{0,0,14,8},{14,0,14,8})
- ,SERIAL_OUT(Serial)
-);
-
-NAVROOT(nav,mainMenu,MAX_DEPTH,in,out);
-
-//when menu is suspended
-result idle(menuOut& o,idleEvent e) {
-#ifndef DONT_SHOW_SUSPEND
- if (e==idling) {
- o.println(F("suspended..."));
- o.println(F("press [select]"));
- o.println(F("to continue"));
- }
-#endif
- return proceed;
-}
-
-result systemExit() {
- encoder.menu_running = false;//prevents the menu from running again!
- nav.reset();
- nav.idleOn();//suspend the menu system
- gfx.fillScreen(ST7735_BLACK);
- return quit;
-}
-//config myOptions('*','-',defaultNavCodes,false);
-
-void setup() {
- //options=&myOptions;//can customize options
- pinMode(LEDPIN,OUTPUT);
- Serial.begin(211000);
- while(!Serial);
- Serial.println("menu 4.x test");
- Serial.flush();
-
- //outGfx.usePreview=true;//reserve one panel for preview?
- //nav.showTitle=false;//show menu title?
-
- //pinMode(encBtn, INPUT_PULLUP);
-#ifndef USE_INTERRUPT_PINS
- #ifdef USE_CLICK_ENCODER
- Timer1.initialize(1000);
- Timer1.attachInterrupt(timerIsr);
- #else
- encButton.begin();
- encoder.begin();
- #endif
- nav.idleTask=idle;//point a function to be used when menu is suspended
-#else
- encoder.begin();
- nav.idleOn(); // suspend the menu system
-#endif
- mainMenu[0].disable();
- SPI.begin();
- gfx.initR(INITR_BLACKTAB);
- gfx.setRotation(3);
- gfx.setTextSize(textScale);//test scalling
- gfx.setTextWrap(false);
- gfx.fillScreen(ST7735_BLACK);
- gfx.setTextColor(ST7735_RED,ST7735_BLACK);
- gfx.println("Menu 4.x test on GFX");
- delay(2000);
- gfx.fillScreen(ST7735_BLACK);
-}
-
-void loop() {
-
-#ifndef USE_INTERRUPT_PINS
- nav.poll();//this device only draws when needed
- delay(100);//simulate a delay when other tasks are done
-#else
- if((encoder.menu_running)&&(encoder.menu_interrupt)){
- encoder.menu_interrupt = false;
- nav.doInput();
- nav.doOutput();
- }
-#endif
- digitalWrite(LEDPIN, ledCtrl);
-}
diff --git a/examples/ajoy/ajoy/ajoy.ino b/examples/ajoy/ajoy/ajoy.ino
deleted file mode 100644
index 573902b2..00000000
--- a/examples/ajoy/ajoy/ajoy.ino
+++ /dev/null
@@ -1,80 +0,0 @@
-/********************
-Arduino generic menu system
-
-Rui Azevedo - ruihfazevedo(@rrob@)gmail.com
-
-output: Serial
-input: Analog Joystick + Serial
-*/
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-using namespace Menu;
-
-#ifdef ESP8266
- #define JOY_X 2
- #define JOY_Y 3
- #define JOY_BTN 4
-#else
- #define JOY_X A6
- #define JOY_Y A7
- #define JOY_BTN 4
-#endif
-
-//analog joystick parameters
-// uint8_t pin,
-// uint8_t sensivity=5,
-// bool inv=false,
-// int center=512,
-// int inertia=6,
-// int bufferSz=1,
-// navCmds posCmd=upCmd,
-// navCmds negCmd=downCmd
-analogAxis ay;
-
-int test=500;
-
-MENU(mainMenu,"Main menu",doNothing,noEvent,wrapStyle
- ,OP("Op1",doNothing,noEvent)
- ,OP("Op2",doNothing,noEvent)
- ,FIELD(test,"Test","ms",0,1000,100,1,doNothing,noEvent,wrapStyle)
- ,EXIT(" btns(btnsMap);// 1 is the number of keys
-
-serialIn menuSerialIn(Serial);
-
-MENU_INPUTS(in,&ay,&btns,&menuSerialIn);
-
-#define MAX_DEPTH 1
-
-MENU_OUTPUTS(out,MAX_DEPTH
- ,SERIAL_OUT(Serial)
- ,NONE//must have 2 items at least
-);
-
-NAVROOT(nav,mainMenu,MAX_DEPTH,in,out);
-
-void setup() {
- Serial.begin(115200);
- while(!Serial);
- btns.begin();
- Serial.println("Menu 4.x joysick example");
-}
-
-void loop() {
- nav.poll();
- // while(menuSerialIn.available())
- // Serial.write(menuSerialIn.read());
- delay(100);
-}
diff --git a/examples/atmega/.vscode/c_cpp_properties.json b/examples/atmega/.vscode/c_cpp_properties.json
new file mode 100644
index 00000000..be4ee3b4
--- /dev/null
+++ b/examples/atmega/.vscode/c_cpp_properties.json
@@ -0,0 +1,72 @@
+//
+// !!! WARNING !!! AUTO-GENERATED FILE!
+// PLEASE DO NOT MODIFY IT AND USE "platformio.ini":
+// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
+//
+{
+ "configurations": [
+ {
+ "name": "PlatformIO",
+ "includePath": [
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/examples/atmega/include",
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/examples/atmega/src",
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/src",
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/parts/include",
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/parts/src",
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/tinyTimeUtils/src",
+ "/home/azevedo/.platformio/packages/framework-arduino-avr/cores/arduino",
+ "/home/azevedo/.platformio/packages/framework-arduino-avr/variants/standard",
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/.git",
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/examples",
+ "/home/azevedo/.platformio/packages/framework-arduino-avr/libraries/EEPROM/src",
+ "/home/azevedo/.platformio/packages/framework-arduino-avr/libraries/HID/src",
+ "/home/azevedo/.platformio/packages/framework-arduino-avr/libraries/SPI/src",
+ "/home/azevedo/.platformio/packages/framework-arduino-avr/libraries/SoftwareSerial/src",
+ "/home/azevedo/.platformio/packages/framework-arduino-avr/libraries/Wire/src",
+ "/home/azevedo/.platformio/packages/tool-unity",
+ ""
+ ],
+ "browse": {
+ "limitSymbolsToIncludedHeaders": true,
+ "path": [
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/examples/atmega/include",
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/examples/atmega/src",
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/src",
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/parts/include",
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/parts/src",
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/tinyTimeUtils/src",
+ "/home/azevedo/.platformio/packages/framework-arduino-avr/cores/arduino",
+ "/home/azevedo/.platformio/packages/framework-arduino-avr/variants/standard",
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/.git",
+ "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/examples",
+ "/home/azevedo/.platformio/packages/framework-arduino-avr/libraries/EEPROM/src",
+ "/home/azevedo/.platformio/packages/framework-arduino-avr/libraries/HID/src",
+ "/home/azevedo/.platformio/packages/framework-arduino-avr/libraries/SPI/src",
+ "/home/azevedo/.platformio/packages/framework-arduino-avr/libraries/SoftwareSerial/src",
+ "/home/azevedo/.platformio/packages/framework-arduino-avr/libraries/Wire/src",
+ "/home/azevedo/.platformio/packages/tool-unity",
+ ""
+ ]
+ },
+ "defines": [
+ "PLATFORMIO=50101",
+ "ARDUINO_AVR_UNO",
+ "NO_RELEASE",
+ "RS_DEBUG",
+ "F_CPU=16000000L",
+ "ARDUINO_ARCH_AVR",
+ "ARDUINO=10808",
+ "__AVR_ATmega328P__",
+ ""
+ ],
+ "cStandard": "c11",
+ "cppStandard": "c++11",
+ "compilerPath": "/home/azevedo/.platformio/packages/toolchain-atmelavr/bin/avr-gcc",
+ "compilerArgs": [
+ "-mmcu=atmega328p",
+ ""
+ ]
+ }
+ ],
+ "version": 4
+}
diff --git a/examples/atmega/.vscode/extensions.json b/examples/atmega/.vscode/extensions.json
new file mode 100644
index 00000000..0f0d7401
--- /dev/null
+++ b/examples/atmega/.vscode/extensions.json
@@ -0,0 +1,7 @@
+{
+ // See http://go.microsoft.com/fwlink/?LinkId=827846
+ // for the documentation about the extensions.json format
+ "recommendations": [
+ "platformio.platformio-ide"
+ ]
+}
diff --git a/examples/atmega/.vscode/launch.json b/examples/atmega/.vscode/launch.json
new file mode 100644
index 00000000..5135b6ae
--- /dev/null
+++ b/examples/atmega/.vscode/launch.json
@@ -0,0 +1,34 @@
+// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY
+//
+// PIO Unified Debugger
+//
+// Documentation: https://docs.platformio.org/page/plus/debugging.html
+// Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html
+
+{
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "type": "platformio-debug",
+ "request": "launch",
+ "name": "PIO Debug",
+ "executable": "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/examples/atmega/.pio/build/atmega/firmware.elf",
+ "projectEnvName": "atmega",
+ "toolchainBinDir": "/home/azevedo/.platformio/packages/toolchain-atmelavr/bin",
+ "internalConsoleOptions": "openOnSessionStart",
+ "preLaunchTask": {
+ "type": "PlatformIO",
+ "task": "Pre-Debug (atmega)"
+ }
+ },
+ {
+ "type": "platformio-debug",
+ "request": "launch",
+ "name": "PIO Debug (skip Pre-Debug)",
+ "executable": "/home/azevedo/Work/r-site.net/AM5/ArduinoMenu/examples/atmega/.pio/build/atmega/firmware.elf",
+ "projectEnvName": "atmega",
+ "toolchainBinDir": "/home/azevedo/.platformio/packages/toolchain-atmelavr/bin",
+ "internalConsoleOptions": "openOnSessionStart"
+ }
+ ]
+}
diff --git a/examples/LCDs/LiquidCrystal/include/readme.txt b/examples/atmega/include/README
similarity index 100%
rename from examples/LCDs/LiquidCrystal/include/readme.txt
rename to examples/atmega/include/README
diff --git a/examples/atmega/lib/README b/examples/atmega/lib/README
new file mode 100644
index 00000000..6debab1e
--- /dev/null
+++ b/examples/atmega/lib/README
@@ -0,0 +1,46 @@
+
+This directory is intended for project specific (private) libraries.
+PlatformIO will compile them to static libraries and link into executable file.
+
+The source code of each library should be placed in a an own separate directory
+("lib/your_library_name/[here are source files]").
+
+For example, see a structure of the following two libraries `Foo` and `Bar`:
+
+|--lib
+| |
+| |--Bar
+| | |--docs
+| | |--examples
+| | |--src
+| | |- Bar.c
+| | |- Bar.h
+| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
+| |
+| |--Foo
+| | |- Foo.c
+| | |- Foo.h
+| |
+| |- README --> THIS FILE
+|
+|- platformio.ini
+|--src
+ |- main.c
+
+and a contents of `src/main.c`:
+```
+#include