Skip to content

testNextionNumberBox #105

@vicplasma

Description

@vicplasma

I am trying to use NexNumber to get value from n1 entered with a Nextion keyboard.
then display it/ setValue to n0.
and print it to serial.

It works till I enter a number greater than 32767 .
My simple modification of testNextionNumberBox sketch is below.

Please advise I need to be able to enter 20000000 and ever number in between.

#include "Nextion.h"

include <NexNumber.h> // could not find till I added.

uint32_t number = 0;

NexNumber n0 = NexNumber(0, 1, "n0");
NexNumber n1 = NexNumber(0,3,"n1");

void setup() {
nexInit();

}

void loop() {
// ****** Per online suggestion I modified NexNumber.cpp utoa(number, buf, 10);to ultoa(number, buf, 10);

n1.getValue(&number); // n1 is set by a Nextion Keyboard
// GET NEXTION VALUE FROM n1 page 0 ////////

n0.setValue(number);// SET THE VALUE to uint32_t number to n0, to verify arduino has the number /////////

Serial.println(number);// Serial print number again to verify number is correct//

}

The HMI is simple n0 is a number box local .
n1 is a number box global keybdA because keybdB keys disappear after a few seconds.

Data from my test below

Number entered in n1 Number didplayed n1 Number Serial Printed

32767 32767 32767

32768 0 4294936223 had to restart serial monitor 0 just before err

65535 0 4294967295 serial err

65536 65536 65536

mod_testNextionNumberBox.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions