- How to Use
- This example shows that ,when the OFF button component on the Nextion screen is released, the timer will opened,the text will show number changed and push the ADDTIME button timer cycle value will increase,when push the DECTIME button timer cycle value will reduce.
- Author
- huang xianming (email:xianm.nosp@m.ing..nosp@m.huang.nosp@m.@ite.nosp@m.ad.cc)
- Date
- 2015/8/25 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made
- Copyright
- Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
char buffer[100] = {0};
uint32_t number_timer = 0;
uint32_t number_enable = 0;
uint32_t number_cycle = 100;
{
&b0,
&b1,
&b2,
&t0,
&t1,
&tm0,
NULL
};
void b0PopCallback(void *ptr)
{
if(number_enable == 1)
{
number_enable = 0;
}
else if (number_enable ==0)
{
number_enable =1;
}
}
void b1PopCallback(void *ptr)
{
number_cycle = number_cycle + 100;
memset(buffer, 0, sizeof(buffer));
itoa(number_cycle, buffer, 10);
}
void b2PopCallback(void *ptr)
{
if (number_cycle >100)
{
number_cycle = number_cycle - 100;
}
memset(buffer, 0, sizeof(buffer));
itoa(number_cycle, buffer, 10);
}
void tm0TimerCallback(void *ptr)
{
number_timer++;
memset(buffer, 0, sizeof(buffer));
itoa(number_timer, buffer, 10);
}
void setup(void)
{
dbSerialPrintln("setup done");
}
void loop(void)
{
}