Summer Sales reminder and the Mega I/O project
I have already blogged (for example here) about controlling Arduino’s (or any other microcontroller’s) I/O from a Nextion HMI with a simple and easy to understand custom protocol, not requiring a complex library. I had imagined that from the basic examples I gave, people would extend them for more functionalities. But from the feedback I received (you’ll fin my email address at the end of this article), I learned that you, my dear readers, prefer apparently getting more elaborated ready-to-use solutions. Thus, instead of the previous approach which was bottom-up, we’ll try now the top-down. That’s why I started developing a huge new project, which explains my relative silence during the last two weeks. Curios? Please continue reading!
The Nextion Summer discounts reminder
(Again:) This year, valid until August 31, 2023, there are two distinct discount mechanisms which can be combined:
First, if you order two (or more) Nextion items using this link (or the one in the HMI animation), you’ll automatically get 10% off your order!
Second, if the value of your order exceeds $199 (without the shipping cost), you’ll get another $20 off using again this link (or the one in the HMI animation) and the code NEXTION20 !
Both can be combined. Let’s look at an example: Imagine you want to buy two 7″ Intelligent Series Nextion HMI NX8048P070-011C-Y with enclosure à $102.40 each and, let’s say, two Nextion MIDI I/O Interface à $9.90, you’d normally see a cart subtotal of $224.60 but since you have more than 1 item in the cart, the 10% discount ( -$22.46) will automatically appear. Then, clicking onto “Have a promo code? Click here” allows you to enter the NEXTION20 code and you’ll see another -$20.00 off and check out with only $182.14 (plus shipping) which makes a total discount of $42.46 or 18.9%!
The Nextion Mega I/O project
As said in the foreword, this time, instead of giving a simple example and expecting you to extend it for your needs, we’ll do it the other way round. We’ll have a 3.5″ Nextion HMI of the very affordable Discovery series doing the following:
– Control the output level of 12 PWM pins
– Control the output level or read the input level of up to 32 GPIO pins
– Read the input level of 16 Analog pins
You guess it from the number of pins, we’ll be using an Arduino Mega. And we’ll use a very simple and easy to understand custom 3 byte protocol to address everything in read and in write mode. And I promise, at the end of that upcoming article series, we’ll also get a downsized version for the Arduino Uno. And, for those who need still more I/O, I plan also to extend it, so that up to 8 Megas can be daisy-chained with the help of the I2C bus, so that you’ll be able to control 96 PWM pins, 256 GPIO pins and 128 Analog pins from a single 3.5″ Nextion HMI. And this, as usual, and as you may expect it, in a highly efficient and code-optimized way, so that nothing risks to run out of memory!
While I’m still finalizing the code, here already a few screens:
As you can see on the GPIO screen, we’ll use a trick to emulate the Switch component, which is normally only available on the Nextion Intelligent series. The 32 I/O pins are organized in 4 banks of 8, and each bank can individually be configured as inputs, shown as the hollow switches in the upper two rows which will just show the state of the pins, or as outputs with filled (active) switches like in the lower two rows, which will allow you to set the corresponding pin actively HI or LOW. The GPIO Setup screen will allow us to define the behavior of each row of 8 pins as input or output.
Also as usual, you’ll get ready to use or to modify .hmi files to save you from having to re-create all the graphical elements with pixel precision, it’s enough that I spent several days (and nights) on this. Next Sunday, we’ll start with the 3 byte protocol which is an extension to the previously used 2 byte protocol and (I’ll explain that next week in detail) which is very similar to the very simple but robust and efficient MIDI protocol.
It is going to be very exciting, stay tuned !
Thank you for reading and happy Nextioning!
Questions, comments, critics, suggestions? Just send me an email to thierry (at) itead (dot) cc! 🙂
And, by the way, if you like what I write, and you are about to order Nextion stuff with Itead, please use my referral link! To you, it won’t make a change for your order. But it will pay me the one or the other beer or coffee. And that will motivate me to write more interesting blogs 😉