nextion
This commit is contained in:
parent
3409ed8fb7
commit
9d96b2b5b3
|
@ -0,0 +1,351 @@
|
||||||
|
/**
|
||||||
|
* @file NexButton.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexButton.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "NexButton.h"
|
||||||
|
|
||||||
|
NexButton::NexButton(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexTouch(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t NexButton::getText(char *buffer, uint16_t len)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".txt";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetString(buffer,len);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexButton::setText(const char *buffer)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".txt=\"";
|
||||||
|
cmd += buffer;
|
||||||
|
cmd += "\"";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint32_t NexButton::Get_background_color_bco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexButton::Set_background_color_bco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexButton::Get_press_background_color_bco2(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco2";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexButton::Set_press_background_color_bco2(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco2=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexButton::Get_font_color_pco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexButton::Set_font_color_pco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexButton::Get_press_font_color_pco2(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco2";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexButton::Set_press_font_color_pco2(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco2=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexButton::Get_place_xcen(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".xcen";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexButton::Set_place_xcen(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".xcen=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexButton::Get_place_ycen(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".ycen";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexButton::Set_place_ycen(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".ycen=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexButton::getFont(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".font";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexButton::setFont(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".font=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexButton::Get_background_cropi_picc(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexButton::Set_background_crop_picc(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexButton::Get_press_background_crop_picc2(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc2";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexButton::Set_press_background_crop_picc2(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc2=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexButton::Get_background_image_pic(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexButton::Set_background_image_pic(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexButton::Get_press_background_image_pic2(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic2";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexButton::Set_press_background_image_pic2(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic2=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
|
@ -0,0 +1,242 @@
|
||||||
|
/**
|
||||||
|
* @file NexButton.h
|
||||||
|
*
|
||||||
|
* The definition of class NexButton.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXBUTTON_H__
|
||||||
|
#define __NEXBUTTON_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexButton component.
|
||||||
|
*
|
||||||
|
* Commonly, you want to do something after push and pop it. It is recommanded that only
|
||||||
|
* call @ref NexTouch::attachPop to satisfy your purpose.
|
||||||
|
*
|
||||||
|
* @warning Please do not call @ref NexTouch::attachPush on this component, even though you can.
|
||||||
|
*/
|
||||||
|
class NexButton: public NexTouch
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexButton(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get text attribute of component.
|
||||||
|
*
|
||||||
|
* @param buffer - buffer storing text returned.
|
||||||
|
* @param len - length of buffer.
|
||||||
|
* @return The real length of text returned.
|
||||||
|
*/
|
||||||
|
uint16_t getText(char *buffer, uint16_t len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set text attribute of component.
|
||||||
|
*
|
||||||
|
* @param buffer - text buffer terminated with '\0'.
|
||||||
|
* @return true if success, false for failure.
|
||||||
|
*/
|
||||||
|
bool setText(const char *buffer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data return
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_color_bco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_color_bco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get bco2 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data return
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_press_background_color_bco2(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set bco2 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_press_background_color_bco2(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data return
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_font_color_pco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_font_color_pco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pco2 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data return
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_press_font_color_pco2(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pco2 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_press_font_color_pco2(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get xcen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data return
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_place_xcen(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set xcen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_place_xcen(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get ycen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data return
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_place_ycen(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set ycen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_place_ycen(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get font attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data return
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t getFont(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set font attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool setFont(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get picc attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data return
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_cropi_picc(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set picc attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_crop_picc(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get picc2 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data return
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_press_background_crop_picc2(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set picc2 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_press_background_crop_picc2(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pic attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data return
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_image_pic(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pic attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_image_pic(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pic2 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data return
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_press_background_image_pic2(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pic2 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_press_background_image_pic2(uint32_t number);
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXBUTTON_H__ */
|
|
@ -0,0 +1,99 @@
|
||||||
|
/**
|
||||||
|
* @file NexCheckbox.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexCheckbox.
|
||||||
|
*
|
||||||
|
* @author huang xiaoming (email:<xiaoming.huang@itead.cc>)
|
||||||
|
* @date 2016/9/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#include "NexCheckbox.h"
|
||||||
|
|
||||||
|
NexCheckbox::NexCheckbox(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexTouch(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexCheckbox::getValue(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexCheckbox::setValue(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexCheckbox::Get_background_color_bco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexCheckbox::Set_background_color_bco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexCheckbox::Get_font_color_pco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexCheckbox::Set_font_color_pco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
|
@ -0,0 +1,97 @@
|
||||||
|
/**
|
||||||
|
* @file NexCheckbox.h
|
||||||
|
*
|
||||||
|
* The definition of class NexCheckbox.
|
||||||
|
*
|
||||||
|
* @author huang xiaoming (email:<xiaoming.huang@itead.cc>)
|
||||||
|
* @date 2016/9/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXCHECKBOX_H__
|
||||||
|
#define __NEXCHECKBOX_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexButton component.
|
||||||
|
*
|
||||||
|
* Commonly, you want to do something after push and pop it. It is recommanded that only
|
||||||
|
* call @ref NexTouch::attachPop to satisfy your purpose.
|
||||||
|
*
|
||||||
|
* @warning Please do not call @ref NexTouch::attachPush on this component, even though you can.
|
||||||
|
*/
|
||||||
|
class NexCheckbox: public NexTouch
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexCheckbox(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get val attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t getValue(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set val attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool setValue(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_color_bco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_color_bco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_font_color_pco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_font_color_pco(uint32_t number);
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXCHECKBOX_H__ */
|
|
@ -0,0 +1,54 @@
|
||||||
|
/**
|
||||||
|
* @file NexConfig.h
|
||||||
|
*
|
||||||
|
* Options for user can be found here.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#ifndef __NEXCONFIG_H__
|
||||||
|
#define __NEXCONFIG_H__
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup Configuration
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define DEBUG_SERIAL_ENABLE to enable debug serial.
|
||||||
|
* Comment it to disable debug serial.
|
||||||
|
*/
|
||||||
|
//#define DEBUG_SERIAL_ENABLE
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define dbSerial for the output of debug messages.
|
||||||
|
*/
|
||||||
|
#define dbSerial Serial
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define nexSerial for communicate with Nextion touch panel.
|
||||||
|
*/
|
||||||
|
#define nexSerial Serial2
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef DEBUG_SERIAL_ENABLE
|
||||||
|
#define dbSerialPrint(a) dbSerial.print(a)
|
||||||
|
#define dbSerialPrintln(a) dbSerial.println(a)
|
||||||
|
#define dbSerialBegin(a) dbSerial.begin(a)
|
||||||
|
#else
|
||||||
|
#define dbSerialPrint(a) do{}while(0)
|
||||||
|
#define dbSerialPrintln(a) do{}while(0)
|
||||||
|
#define dbSerialBegin(a) do{}while(0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXCONFIG_H__ */
|
|
@ -0,0 +1,68 @@
|
||||||
|
/**
|
||||||
|
* @file NexCrop.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexCrop.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "NexCrop.h"
|
||||||
|
|
||||||
|
NexCrop::NexCrop(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexTouch(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexCrop::Get_background_crop_picc(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexCrop::Set_background_crop_picc(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexCrop::getPic(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexCrop::setPic(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,84 @@
|
||||||
|
/**
|
||||||
|
* @file NexCrop.h
|
||||||
|
*
|
||||||
|
* The definition of class NexCrop.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXCROP_H__
|
||||||
|
#define __NEXCROP_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexCrop component.
|
||||||
|
*/
|
||||||
|
class NexCrop: public NexTouch
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexCrop(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of picture.
|
||||||
|
*
|
||||||
|
* @param number - an output parameter to save the number of picture.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool Get_background_crop_picc(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the number of picture.
|
||||||
|
*
|
||||||
|
* @param number - the number of picture.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool Set_background_crop_picc(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of picture.
|
||||||
|
*
|
||||||
|
* @param number - an output parameter to save the number of picture.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool getPic(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the number of picture.
|
||||||
|
*
|
||||||
|
* @param number - the number of picture.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool setPic(uint32_t number);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXCROP_H__ */
|
|
@ -0,0 +1,347 @@
|
||||||
|
/**
|
||||||
|
* @file NexDualStateButton.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexDSButton.
|
||||||
|
*
|
||||||
|
* @author huang xianming (email:<xianming.huang@itead.cc>)
|
||||||
|
* @date 2015/11/11
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "NexDualStateButton.h"
|
||||||
|
|
||||||
|
NexDSButton::NexDSButton(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexTouch(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexDSButton::getValue(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexDSButton::setValue(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t NexDSButton::getText(char *buffer, uint16_t len)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".txt";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetString(buffer,len);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexDSButton::setText(const char *buffer)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".txt=\"";
|
||||||
|
cmd += buffer;
|
||||||
|
cmd += "\"";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexDSButton::Get_state0_color_bco0(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco0";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexDSButton::Set_state0_color_bco0(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco0=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexDSButton::Get_state1_color_bco1(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco1";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexDSButton::Set_state1_color_bco1(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco1=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexDSButton::Get_font_color_pco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexDSButton::Set_font_color_pco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexDSButton::Get_place_xcen(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".xcen";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexDSButton::Set_place_xcen(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".xcen=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexDSButton::Get_place_ycen(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".ycen";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexDSButton::Set_place_ycen(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".ycen=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexDSButton::getFont(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".font";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexDSButton::setFont(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".font=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexDSButton::Get_state0_crop_picc0(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc0";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexDSButton::Set_state0_crop_picc0(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc0=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexDSButton::Get_state1_crop_picc1(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc1";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexDSButton::Set_state1_crop_picc1(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc1=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexDSButton::Get_state0_image_pic0(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic0";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexDSButton::Set_state0_image_pic0(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic0=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexDSButton::Get_state1_image_pic1(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic1";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexDSButton::Set_state1_image_pic1(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic1=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,243 @@
|
||||||
|
/**
|
||||||
|
* @file NexDualStateButton.h
|
||||||
|
*
|
||||||
|
* The definition of class NexDSButton.
|
||||||
|
*
|
||||||
|
* @author huang xianming (email:<xianming.huang@itead.cc>)
|
||||||
|
* @date 2015/11/11
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXDSBUTTON_H__
|
||||||
|
#define __NEXDSBUTTON_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexDSButton component.
|
||||||
|
*
|
||||||
|
* Commonly, you want to do something after push and pop it. It is recommanded that only
|
||||||
|
* call @ref NexTouch::attachPop to satisfy your purpose.
|
||||||
|
*
|
||||||
|
* @warning Please do not call @ref NexTouch::attachPush on this component, even though you can.
|
||||||
|
*/
|
||||||
|
class NexDSButton: public NexTouch
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexDSButton(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get number attribute of component.
|
||||||
|
*
|
||||||
|
* @param number - buffer storing text returned.
|
||||||
|
* @return The real length of text returned.
|
||||||
|
*/
|
||||||
|
bool getValue(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set number attribute of component.
|
||||||
|
*
|
||||||
|
* @param number - number buffer.
|
||||||
|
* @return true if success, false for failure.
|
||||||
|
*/
|
||||||
|
bool setValue(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get text attribute of component.
|
||||||
|
*
|
||||||
|
* @param buffer - buffer storing text returned.
|
||||||
|
* @param len - length of buffer.
|
||||||
|
* @return The real length of text returned.
|
||||||
|
*/
|
||||||
|
uint16_t getText(char *buffer, uint16_t len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set text attribute of component.
|
||||||
|
*
|
||||||
|
* @param buffer - text buffer terminated with '\0'.
|
||||||
|
* @return true if success, false for failure.
|
||||||
|
*/
|
||||||
|
bool setText(const char *buffer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get bco0 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_state0_color_bco0(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set bco0 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_state0_color_bco0(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get bco1 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_state1_color_bco1(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set bco1 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_state1_color_bco1(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_font_color_pco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_font_color_pco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get xcen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_place_xcen(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set xcen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_place_xcen(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get ycen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_place_ycen(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set ycen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_place_ycen(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get font attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t getFont(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set font attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool setFont(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get picc0 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_state0_crop_picc0(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set picc0 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_state0_crop_picc0(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get picc1 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_state1_crop_picc1(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set picc1 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_state1_crop_picc1(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pic0 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_state0_image_pic0(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pic0 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_state0_image_pic0(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pic1 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_state1_image_pic1(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pic1 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_state1_image_pic1(uint32_t number);
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXDSBUTTON_H__ */
|
|
@ -0,0 +1,158 @@
|
||||||
|
/**
|
||||||
|
* @file NexGauge.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexGauge.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "NexGauge.h"
|
||||||
|
|
||||||
|
NexGauge::NexGauge(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexObject(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexGauge::getValue(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexGauge::setValue(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexGauge::Get_background_color_bco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexGauge::Set_background_color_bco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexGauge::Get_font_color_pco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexGauge::Set_font_color_pco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexGauge::Get_pointer_thickness_wid(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".wid";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexGauge::Set_pointer_thickness_wid(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".wid=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexGauge::Get_background_cropi_picc(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexGauge::Set_background_crop_picc(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,127 @@
|
||||||
|
/**
|
||||||
|
* @file NexGauge.h
|
||||||
|
*
|
||||||
|
* The definition of class NexGauge.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXGAUGE_H__
|
||||||
|
#define __NEXGAUGE_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexGauge component.
|
||||||
|
*/
|
||||||
|
class NexGauge: public NexObject
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexGauge(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of gauge.
|
||||||
|
*
|
||||||
|
* @param number - an output parameter to save gauge's value.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool getValue(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of gauge.
|
||||||
|
*
|
||||||
|
* @param number - the value of gauge.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool setValue(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_color_bco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_color_bco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_font_color_pco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_font_color_pco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get wid attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_pointer_thickness_wid(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set wid attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_pointer_thickness_wid(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get picc attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_cropi_picc(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set picc attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_crop_picc(uint32_t number);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXGAUGE_H__ */
|
|
@ -0,0 +1,105 @@
|
||||||
|
/**
|
||||||
|
* @file NexGpio.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexGpio.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#include "NexGpio.h"
|
||||||
|
|
||||||
|
bool NexGpio::pin_mode(uint32_t port,uint32_t mode,uint32_t control_id)
|
||||||
|
{
|
||||||
|
char buf;
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
cmd += "cfgpio ";
|
||||||
|
buf = port + '0';
|
||||||
|
cmd += buf;
|
||||||
|
cmd += ',';
|
||||||
|
buf = mode + '0';
|
||||||
|
cmd += buf;
|
||||||
|
cmd += ',';
|
||||||
|
buf = control_id = '0';
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexGpio::digital_write(uint32_t port,uint32_t value)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
char buf;
|
||||||
|
|
||||||
|
cmd += "pio";
|
||||||
|
buf = port + '0';
|
||||||
|
cmd += buf;
|
||||||
|
cmd += '=';
|
||||||
|
buf = value + '0';
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexGpio::digital_read(uint32_t port)
|
||||||
|
{
|
||||||
|
uint32_t number;
|
||||||
|
char buf;
|
||||||
|
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += "pio";
|
||||||
|
buf = port + '0';
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&number);
|
||||||
|
return number;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexGpio::analog_write(uint32_t port,uint32_t value)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
char c;
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(value, buf, 10);
|
||||||
|
cmd += "pwm";
|
||||||
|
c = port + '0';
|
||||||
|
cmd += c;
|
||||||
|
cmd += '=';
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
Serial.print(cmd);
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexGpio::set_pwmfreq(uint32_t value)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(value, buf, 10);
|
||||||
|
cmd += "pwmf";
|
||||||
|
cmd += '=';
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexGpio::get_pwmfreq(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get pwmf");
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
|
@ -0,0 +1,102 @@
|
||||||
|
/**
|
||||||
|
* @file NexGpio.h
|
||||||
|
*
|
||||||
|
* The definition of class NexGpio.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _NEXGPIO_H
|
||||||
|
#define _NEXGPIO_H
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexGpio component.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class NexGpio
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Set gpio mode
|
||||||
|
*
|
||||||
|
* @param port - the gpio port number
|
||||||
|
* @param mode - set gpio port mode(0--Pull on the input
|
||||||
|
* 1--the control input binding
|
||||||
|
* 2--Push-pull output
|
||||||
|
* 3--pwm output
|
||||||
|
* 4--open mode leakage)
|
||||||
|
* @param control_id - nextion controls id ,when the modeel is 1 to be valid
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool pin_mode(uint32_t port,uint32_t mode,uint32_t control_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* write a HIGH or a LOW value to a digital pin
|
||||||
|
*
|
||||||
|
* @param port - the gpio port number
|
||||||
|
* @param value - HIGH or LOW
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool digital_write(uint32_t port,uint32_t value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* read a HIGH or a LOW value to a digital pin
|
||||||
|
*
|
||||||
|
* @param port - the gpio port number
|
||||||
|
* @return the value from a specified digital pin, either high or low
|
||||||
|
*/
|
||||||
|
|
||||||
|
uint32_t digital_read(uint32_t port);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* writes an analog value (PWM wave) to a pin
|
||||||
|
*
|
||||||
|
* @param port - the gpio port number
|
||||||
|
* @param value - the duty cycle: between 0 (always off) and 100 (always on).
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool analog_write(uint32_t port,uint32_t value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* writes pwm output frequency
|
||||||
|
*
|
||||||
|
* @param value - the frequency: between 1 and 65535
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool set_pwmfreq(uint32_t value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* read pwm output frequency
|
||||||
|
*
|
||||||
|
* @param number - the frequency
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
|
||||||
|
uint32_t get_pwmfreq(uint32_t *number);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXGPIO_H__ */
|
|
@ -0,0 +1,267 @@
|
||||||
|
/**
|
||||||
|
* @file NexHardware.cpp
|
||||||
|
*
|
||||||
|
* The implementation of base API for using Nextion.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/11
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#include "NexHardware.h"
|
||||||
|
|
||||||
|
#define NEX_RET_CMD_FINISHED (0x01)
|
||||||
|
#define NEX_RET_EVENT_LAUNCHED (0x88)
|
||||||
|
#define NEX_RET_EVENT_UPGRADED (0x89)
|
||||||
|
#define NEX_RET_EVENT_TOUCH_HEAD (0x65)
|
||||||
|
#define NEX_RET_EVENT_POSITION_HEAD (0x67)
|
||||||
|
#define NEX_RET_EVENT_SLEEP_POSITION_HEAD (0x68)
|
||||||
|
#define NEX_RET_CURRENT_PAGE_ID_HEAD (0x66)
|
||||||
|
#define NEX_RET_STRING_HEAD (0x70)
|
||||||
|
#define NEX_RET_NUMBER_HEAD (0x71)
|
||||||
|
#define NEX_RET_INVALID_CMD (0x00)
|
||||||
|
#define NEX_RET_INVALID_COMPONENT_ID (0x02)
|
||||||
|
#define NEX_RET_INVALID_PAGE_ID (0x03)
|
||||||
|
#define NEX_RET_INVALID_PICTURE_ID (0x04)
|
||||||
|
#define NEX_RET_INVALID_FONT_ID (0x05)
|
||||||
|
#define NEX_RET_INVALID_BAUD (0x11)
|
||||||
|
#define NEX_RET_INVALID_VARIABLE (0x1A)
|
||||||
|
#define NEX_RET_INVALID_OPERATION (0x1B)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Receive uint32_t data.
|
||||||
|
*
|
||||||
|
* @param number - save uint32_t data.
|
||||||
|
* @param timeout - set timeout time.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool recvRetNumber(uint32_t *number, uint32_t timeout)
|
||||||
|
{
|
||||||
|
bool ret = false;
|
||||||
|
uint8_t temp[8] = {0};
|
||||||
|
|
||||||
|
if (!number)
|
||||||
|
{
|
||||||
|
goto __return;
|
||||||
|
}
|
||||||
|
|
||||||
|
nexSerial.setTimeout(timeout);
|
||||||
|
if (sizeof(temp) != nexSerial.readBytes((char *)temp, sizeof(temp)))
|
||||||
|
{
|
||||||
|
goto __return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (temp[0] == NEX_RET_NUMBER_HEAD
|
||||||
|
&& temp[5] == 0xFF
|
||||||
|
&& temp[6] == 0xFF
|
||||||
|
&& temp[7] == 0xFF
|
||||||
|
)
|
||||||
|
{
|
||||||
|
*number = ((uint32_t)temp[4] << 24) | ((uint32_t)temp[3] << 16) | (temp[2] << 8) | (temp[1]);
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
__return:
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
{
|
||||||
|
dbSerialPrint("recvRetNumber :");
|
||||||
|
dbSerialPrintln(*number);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dbSerialPrintln("recvRetNumber err");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Receive string data.
|
||||||
|
*
|
||||||
|
* @param buffer - save string data.
|
||||||
|
* @param len - string buffer length.
|
||||||
|
* @param timeout - set timeout time.
|
||||||
|
*
|
||||||
|
* @return the length of string buffer.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
uint16_t recvRetString(char *buffer, uint16_t len, uint32_t timeout)
|
||||||
|
{
|
||||||
|
uint16_t ret = 0;
|
||||||
|
bool str_start_flag = false;
|
||||||
|
uint8_t cnt_0xff = 0;
|
||||||
|
String temp = String("");
|
||||||
|
uint8_t c = 0;
|
||||||
|
long start;
|
||||||
|
|
||||||
|
if (!buffer || len == 0)
|
||||||
|
{
|
||||||
|
goto __return;
|
||||||
|
}
|
||||||
|
|
||||||
|
start = millis();
|
||||||
|
while (millis() - start <= timeout)
|
||||||
|
{
|
||||||
|
while (nexSerial.available())
|
||||||
|
{
|
||||||
|
c = nexSerial.read();
|
||||||
|
if (str_start_flag)
|
||||||
|
{
|
||||||
|
if (0xFF == c)
|
||||||
|
{
|
||||||
|
cnt_0xff++;
|
||||||
|
if (cnt_0xff >= 3)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
temp += (char)c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (NEX_RET_STRING_HEAD == c)
|
||||||
|
{
|
||||||
|
str_start_flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cnt_0xff >= 3)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = temp.length();
|
||||||
|
ret = ret > len ? len : ret;
|
||||||
|
strncpy(buffer, temp.c_str(), ret);
|
||||||
|
|
||||||
|
__return:
|
||||||
|
|
||||||
|
dbSerialPrint("recvRetString[");
|
||||||
|
dbSerialPrint(temp.length());
|
||||||
|
dbSerialPrint(",");
|
||||||
|
dbSerialPrint(temp);
|
||||||
|
dbSerialPrintln("]");
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Send command to Nextion.
|
||||||
|
*
|
||||||
|
* @param cmd - the string of command.
|
||||||
|
*/
|
||||||
|
void sendCommand(const char* cmd)
|
||||||
|
{
|
||||||
|
while (nexSerial.available())
|
||||||
|
{
|
||||||
|
nexSerial.read();
|
||||||
|
}
|
||||||
|
|
||||||
|
nexSerial.print(cmd);
|
||||||
|
nexSerial.write(0xFF);
|
||||||
|
nexSerial.write(0xFF);
|
||||||
|
nexSerial.write(0xFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Command is executed successfully.
|
||||||
|
*
|
||||||
|
* @param timeout - set timeout time.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
bool recvRetCommandFinished(uint32_t timeout)
|
||||||
|
{
|
||||||
|
bool ret = false;
|
||||||
|
uint8_t temp[4] = {0};
|
||||||
|
|
||||||
|
nexSerial.setTimeout(timeout);
|
||||||
|
if (sizeof(temp) != nexSerial.readBytes((char *)temp, sizeof(temp)))
|
||||||
|
{
|
||||||
|
ret = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (temp[0] == NEX_RET_CMD_FINISHED
|
||||||
|
&& temp[1] == 0xFF
|
||||||
|
&& temp[2] == 0xFF
|
||||||
|
&& temp[3] == 0xFF
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret)
|
||||||
|
{
|
||||||
|
dbSerialPrintln("recvRetCommandFinished ok");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dbSerialPrintln("recvRetCommandFinished err");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool nexInit(void)
|
||||||
|
{
|
||||||
|
bool ret1 = false;
|
||||||
|
bool ret2 = false;
|
||||||
|
|
||||||
|
dbSerialBegin(9600);
|
||||||
|
nexSerial.begin(9600);
|
||||||
|
sendCommand("");
|
||||||
|
sendCommand("bkcmd=1");
|
||||||
|
ret1 = recvRetCommandFinished();
|
||||||
|
sendCommand("page 0");
|
||||||
|
ret2 = recvRetCommandFinished();
|
||||||
|
return ret1 && ret2;
|
||||||
|
}
|
||||||
|
|
||||||
|
void nexLoop(NexTouch *nex_listen_list[])
|
||||||
|
{
|
||||||
|
static uint8_t __buffer[10];
|
||||||
|
|
||||||
|
uint16_t i;
|
||||||
|
uint8_t c;
|
||||||
|
|
||||||
|
while (nexSerial.available() > 0)
|
||||||
|
{
|
||||||
|
delay(10);
|
||||||
|
c = nexSerial.read();
|
||||||
|
|
||||||
|
if (NEX_RET_EVENT_TOUCH_HEAD == c)
|
||||||
|
{
|
||||||
|
if (nexSerial.available() >= 6)
|
||||||
|
{
|
||||||
|
__buffer[0] = c;
|
||||||
|
for (i = 1; i < 7; i++)
|
||||||
|
{
|
||||||
|
__buffer[i] = nexSerial.read();
|
||||||
|
}
|
||||||
|
__buffer[i] = 0x00;
|
||||||
|
|
||||||
|
if (0xFF == __buffer[4] && 0xFF == __buffer[5] && 0xFF == __buffer[6])
|
||||||
|
{
|
||||||
|
NexTouch::iterate(nex_listen_list, __buffer[1], __buffer[2], (int32_t)__buffer[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
/**
|
||||||
|
* @file NexHardware.h
|
||||||
|
*
|
||||||
|
* The definition of base API for using Nextion.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/11
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#ifndef __NEXHARDWARE_H__
|
||||||
|
#define __NEXHARDWARE_H__
|
||||||
|
#include <Arduino.h>
|
||||||
|
#include "NexConfig.h"
|
||||||
|
#include "NexTouch.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup CoreAPI
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Init Nextion.
|
||||||
|
*
|
||||||
|
* @return true if success, false for failure.
|
||||||
|
*/
|
||||||
|
bool nexInit(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Listen touch event and calling callbacks attached before.
|
||||||
|
*
|
||||||
|
* Supports push and pop at present.
|
||||||
|
*
|
||||||
|
* @param nex_listen_list - index to Nextion Components list.
|
||||||
|
* @return none.
|
||||||
|
*
|
||||||
|
* @warning This function must be called repeatedly to response touch events
|
||||||
|
* from Nextion touch panel. Actually, you should place it in your loop function.
|
||||||
|
*/
|
||||||
|
void nexLoop(NexTouch *nex_listen_list[]);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool recvRetNumber(uint32_t *number, uint32_t timeout = 100);
|
||||||
|
uint16_t recvRetString(char *buffer, uint16_t len, uint32_t timeout = 100);
|
||||||
|
void sendCommand(const char* cmd);
|
||||||
|
bool recvRetCommandFinished(uint32_t timeout = 100);
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXHARDWARE_H__ */
|
|
@ -0,0 +1,22 @@
|
||||||
|
/**
|
||||||
|
* @file NexHotspot.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexHotspot.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "NexHotspot.h"
|
||||||
|
|
||||||
|
NexHotspot::NexHotspot(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexTouch(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
/**
|
||||||
|
* @file NexHotspot.h
|
||||||
|
*
|
||||||
|
* The definition of class NexHotspot.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXHOTSPOT_H__
|
||||||
|
#define __NEXHOTSPOT_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexHotspot component.
|
||||||
|
*/
|
||||||
|
class NexHotspot: public NexTouch
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexHotspot(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXHOTSPOT_H__ */
|
|
@ -0,0 +1,266 @@
|
||||||
|
/**
|
||||||
|
* @file NexNumber.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexNumber.
|
||||||
|
*
|
||||||
|
* @author huang xianming (email:<xianming.huang@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#include "NexNumber.h"
|
||||||
|
|
||||||
|
NexNumber::NexNumber(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexTouch(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexNumber::getValue(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexNumber::setValue(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexNumber::Get_background_color_bco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexNumber::Set_background_color_bco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexNumber::Get_font_color_pco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexNumber::Set_font_color_pco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexNumber::Get_place_xcen(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".xcen";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexNumber::Set_place_xcen(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".xcen=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexNumber::Get_place_ycen(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".ycen";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexNumber::Set_place_ycen(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".ycen=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexNumber::getFont(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".font";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexNumber::setFont(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".font=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexNumber::Get_number_lenth(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".lenth";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexNumber::Set_number_lenth(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".lenth=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexNumber::Get_background_crop_picc(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexNumber::Set_background_crop_picc(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexNumber::Get_background_image_pic(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexNumber::Set_background_image_pic(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
|
@ -0,0 +1,187 @@
|
||||||
|
/**
|
||||||
|
* @file NexNumber.h
|
||||||
|
*
|
||||||
|
* The definition of class NexNumber.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXNUMBER_H__
|
||||||
|
#define __NEXNUMBER_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexNumber component.
|
||||||
|
*/
|
||||||
|
class NexNumber: public NexTouch
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexNumber(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get number attribute of component.
|
||||||
|
*
|
||||||
|
* @param number - buffer storing text returned.
|
||||||
|
* @return The real length of text returned.
|
||||||
|
*/
|
||||||
|
bool getValue(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set number attribute of component.
|
||||||
|
*
|
||||||
|
* @param number - number buffer.
|
||||||
|
* @return true if success, false for failure.
|
||||||
|
*/
|
||||||
|
bool setValue(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_color_bco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_color_bco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_font_color_pco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_font_color_pco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get xcen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_place_xcen(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set xcen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_place_xcen(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get ycen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_place_ycen(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set ycen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_place_ycen(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get font attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t getFont(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set font attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool setFont(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get lenth attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_number_lenth(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set lenth attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_number_lenth(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get picc attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_crop_picc(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set picc attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_crop_picc(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pic attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_image_pic(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pic attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_image_pic(uint32_t number);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXNUMBER_H__ */
|
|
@ -0,0 +1,58 @@
|
||||||
|
/**
|
||||||
|
* @file NexObject.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexObject.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#include "NexObject.h"
|
||||||
|
|
||||||
|
NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
{
|
||||||
|
this->__pid = pid;
|
||||||
|
this->__cid = cid;
|
||||||
|
this->__name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t NexObject::getObjPid(void)
|
||||||
|
{
|
||||||
|
return __pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t NexObject::getObjCid(void)
|
||||||
|
{
|
||||||
|
return __cid;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* NexObject::getObjName(void)
|
||||||
|
{
|
||||||
|
return __name;
|
||||||
|
}
|
||||||
|
|
||||||
|
void NexObject::printObjInfo(void)
|
||||||
|
{
|
||||||
|
dbSerialPrint("[");
|
||||||
|
dbSerialPrint((uint32_t)this);
|
||||||
|
dbSerialPrint(":");
|
||||||
|
dbSerialPrint(__pid);
|
||||||
|
dbSerialPrint(",");
|
||||||
|
dbSerialPrint(__cid);
|
||||||
|
dbSerialPrint(",");
|
||||||
|
if (__name)
|
||||||
|
{
|
||||||
|
dbSerialPrint(__name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dbSerialPrint("(null)");
|
||||||
|
}
|
||||||
|
dbSerialPrintln("]");
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,84 @@
|
||||||
|
/**
|
||||||
|
* @file NexObject.h
|
||||||
|
*
|
||||||
|
* The definition of class NexObject.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#ifndef __NEXOBJECT_H__
|
||||||
|
#define __NEXOBJECT_H__
|
||||||
|
#include <Arduino.h>
|
||||||
|
#include "NexConfig.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup CoreAPI
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Root class of all Nextion components.
|
||||||
|
*
|
||||||
|
* Provides the essential attributes of a Nextion component and the methods accessing
|
||||||
|
* them. At least, Page ID(pid), Component ID(pid) and an unique name are needed for
|
||||||
|
* creating a component in Nexiton library.
|
||||||
|
*/
|
||||||
|
class NexObject
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param pid - page id.
|
||||||
|
* @param cid - component id.
|
||||||
|
* @param name - pointer to an unique name in range of all components.
|
||||||
|
*/
|
||||||
|
NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print current object'address, page id, component id and name.
|
||||||
|
*
|
||||||
|
* @warning this method does nothing, unless debug message enabled.
|
||||||
|
*/
|
||||||
|
void printObjInfo(void);
|
||||||
|
|
||||||
|
protected: /* methods */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get page id.
|
||||||
|
*
|
||||||
|
* @return the id of page.
|
||||||
|
*/
|
||||||
|
uint8_t getObjPid(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get component id.
|
||||||
|
*
|
||||||
|
* @return the id of component.
|
||||||
|
*/
|
||||||
|
uint8_t getObjCid(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get component name.
|
||||||
|
*
|
||||||
|
* @return the name of component.
|
||||||
|
*/
|
||||||
|
const char *getObjName(void);
|
||||||
|
|
||||||
|
private: /* data */
|
||||||
|
uint8_t __pid; /* Page ID */
|
||||||
|
uint8_t __cid; /* Component ID */
|
||||||
|
const char *__name; /* An unique name */
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXOBJECT_H__ */
|
|
@ -0,0 +1,38 @@
|
||||||
|
/**
|
||||||
|
* @file NexPage.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexPage.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "NexPage.h"
|
||||||
|
|
||||||
|
NexPage::NexPage(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexTouch(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexPage::show(void)
|
||||||
|
{
|
||||||
|
uint8_t buffer[4] = {0};
|
||||||
|
|
||||||
|
const char *name = getObjName();
|
||||||
|
if (!name)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String cmd = String("page ");
|
||||||
|
cmd += name;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
/**
|
||||||
|
* @file NexPage.h
|
||||||
|
*
|
||||||
|
* The definition of class NexPage.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXPAGE_H__
|
||||||
|
#define __NEXPAGE_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A special component , which can contain other components such as NexButton,
|
||||||
|
* NexText and NexWaveform, etc.
|
||||||
|
*/
|
||||||
|
class NexPage: public NexTouch
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexPage(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show itself.
|
||||||
|
*
|
||||||
|
* @return true if success, false for faileure.
|
||||||
|
*/
|
||||||
|
bool show(void);
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXPAGE_H__ */
|
|
@ -0,0 +1,67 @@
|
||||||
|
/**
|
||||||
|
* @file NexPicture.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexPicture.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "NexPicture.h"
|
||||||
|
|
||||||
|
NexPicture::NexPicture(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexTouch(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexPicture::Get_background_image_pic(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexPicture::Set_background_image_pic(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexPicture::getPic(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexPicture::setPic(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
|
@ -0,0 +1,83 @@
|
||||||
|
/**
|
||||||
|
* @file NexPicture.h
|
||||||
|
*
|
||||||
|
* The definition of class NexPicture.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXPICTURE_H__
|
||||||
|
#define __NEXPICTURE_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexPicture component.
|
||||||
|
*/
|
||||||
|
class NexPicture: public NexTouch
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexPicture(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get picture's number.
|
||||||
|
*
|
||||||
|
* @param number - an output parameter to save picture number.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool Get_background_image_pic(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set picture's number.
|
||||||
|
*
|
||||||
|
* @param number -the picture number.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool Set_background_image_pic(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get picture's number.
|
||||||
|
*
|
||||||
|
* @param number - an output parameter to save picture number.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool getPic(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set picture's number.
|
||||||
|
*
|
||||||
|
* @param number -the picture number.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool setPic(uint32_t number);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXPICTURE_H__ */
|
|
@ -0,0 +1,100 @@
|
||||||
|
/**
|
||||||
|
* @file NexProgressBar.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexProgressBar.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "NexProgressBar.h"
|
||||||
|
|
||||||
|
NexProgressBar::NexProgressBar(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexObject(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexProgressBar::getValue(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexProgressBar::setValue(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexProgressBar::Get_background_color_bco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexProgressBar::Set_background_color_bco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexProgressBar::Get_font_color_pco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexProgressBar::Set_font_color_pco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
|
@ -0,0 +1,95 @@
|
||||||
|
/**
|
||||||
|
* @file NexProgressBar.h
|
||||||
|
*
|
||||||
|
* The definition of class NexProgressBar.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXPROGRESSBAR_H__
|
||||||
|
#define __NEXPROGRESSBAR_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexProgressBar component.
|
||||||
|
*/
|
||||||
|
class NexProgressBar: public NexObject
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexProgressBar(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of progress bar.
|
||||||
|
*
|
||||||
|
* @param number - an output parameter to save the value of porgress bar.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool getValue(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of progress bar.
|
||||||
|
*
|
||||||
|
* @param number - the value of progress bar.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool setValue(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_color_bco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_color_bco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_font_color_pco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_font_color_pco(uint32_t number);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXPROGRESSBAR_H__ */
|
|
@ -0,0 +1,99 @@
|
||||||
|
/**
|
||||||
|
* @file NexRadio.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexRadio.
|
||||||
|
*
|
||||||
|
* @author huang xiaoming (email:<xiaoming.huang@itead.cc>)
|
||||||
|
* @date 2016/9/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#include "NexRadio.h"
|
||||||
|
|
||||||
|
NexRadio::NexRadio(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexTouch(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexRadio::getValue(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexRadio::setValue(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexRadio::Get_background_color_bco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexRadio::Set_background_color_bco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexRadio::Get_font_color_pco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexRadio::Set_font_color_pco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
|
@ -0,0 +1,98 @@
|
||||||
|
/**
|
||||||
|
* @file NexRadio.h
|
||||||
|
*
|
||||||
|
* The definition of class NexRadio.
|
||||||
|
*
|
||||||
|
* @author huang xiaoming (email:<xiaoming.huang@itead.cc>)
|
||||||
|
* @date 2016/9/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXRADIO_H__
|
||||||
|
#define __NEXRADIO_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexRadio component.
|
||||||
|
*
|
||||||
|
* Commonly, you want to do something after push and pop it. It is recommanded that only
|
||||||
|
* call @ref NexTouch::attachPop to satisfy your purpose.
|
||||||
|
*
|
||||||
|
* @warning Please do not call @ref NexTouch::attachPush on this component, even though you can.
|
||||||
|
*/
|
||||||
|
class NexRadio:public NexTouch
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexRadio(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get val attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t getValue(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set val attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool setValue(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_color_bco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_color_bco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_font_color_pco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_font_color_pco(uint32_t number);
|
||||||
|
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXRADION_H__ */
|
|
@ -0,0 +1,327 @@
|
||||||
|
/**
|
||||||
|
* @file NexRtc.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexRtc.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#include "NexRtc.h"
|
||||||
|
|
||||||
|
bool NexRtc::write_rtc_time(char *time)
|
||||||
|
{
|
||||||
|
char year[5],mon[3],day[3],hour[3],min[3],sec[3];
|
||||||
|
String cmd = String("rtc");
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if(strlen(time) >= 19)
|
||||||
|
{
|
||||||
|
year[0]=time[0];year[1]=time[1];year[2]=time[2];year[3]=time[3];year[4]='\0';
|
||||||
|
mon[0]=time[5];mon[1]=time[6];mon[2]='\0';
|
||||||
|
day[0]=time[8];day[1]=time[9];day[2]='\0';
|
||||||
|
hour[0]=time[11];hour[1]=time[12];hour[2]='\0';
|
||||||
|
min[0]=time[14];min[1]=time[15];min[2]='\0';
|
||||||
|
sec[0]=time[17];sec[1]=time[18];sec[2]='\0';
|
||||||
|
|
||||||
|
cmd += "0=";
|
||||||
|
cmd += year;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetCommandFinished();
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "rtc1=";
|
||||||
|
cmd += mon;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetCommandFinished();
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "rtc2=";
|
||||||
|
cmd += day;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetCommandFinished();
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "rtc3=";
|
||||||
|
cmd += hour;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetCommandFinished();
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "rtc4=";
|
||||||
|
cmd += min;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetCommandFinished();
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "rtc5=";
|
||||||
|
cmd += sec;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetCommandFinished();
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexRtc::write_rtc_time(uint32_t *time)
|
||||||
|
{
|
||||||
|
char year[5],mon[3],day[3],hour[3],min[3],sec[3];
|
||||||
|
String cmd = String("rtc");
|
||||||
|
int i;
|
||||||
|
|
||||||
|
utoa(time[0],year,10);
|
||||||
|
utoa(time[1],mon, 10);
|
||||||
|
utoa(time[2],day, 10);
|
||||||
|
utoa(time[3],hour,10);
|
||||||
|
utoa(time[4],min, 10);
|
||||||
|
utoa(time[5],sec, 10);
|
||||||
|
|
||||||
|
|
||||||
|
cmd += "0=";
|
||||||
|
cmd += year;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetCommandFinished();
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "rtc1=";
|
||||||
|
cmd += mon;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetCommandFinished();
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "rtc2=";
|
||||||
|
cmd += day;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetCommandFinished();
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "rtc3=";
|
||||||
|
cmd += hour;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetCommandFinished();
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "rtc4=";
|
||||||
|
cmd += min;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetCommandFinished();
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "rtc5=";
|
||||||
|
cmd += sec;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetCommandFinished();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexRtc::write_rtc_time(char *time_type,uint32_t number)
|
||||||
|
{
|
||||||
|
String cmd = String("rtc");
|
||||||
|
char buf[10] = {0};
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
if(strstr(time_type,"year"))
|
||||||
|
{
|
||||||
|
cmd += "0=";
|
||||||
|
cmd += buf;
|
||||||
|
}
|
||||||
|
if(strstr(time_type,"mon"))
|
||||||
|
{
|
||||||
|
cmd += "1=";
|
||||||
|
cmd += buf;
|
||||||
|
}
|
||||||
|
if(strstr(time_type,"day"))
|
||||||
|
{
|
||||||
|
cmd += "2=";
|
||||||
|
cmd += buf;
|
||||||
|
}
|
||||||
|
if(strstr(time_type,"hour"))
|
||||||
|
{
|
||||||
|
cmd += "3=";
|
||||||
|
cmd += buf;
|
||||||
|
}
|
||||||
|
if(strstr(time_type,"min"))
|
||||||
|
{
|
||||||
|
cmd += "4=";
|
||||||
|
cmd += buf;
|
||||||
|
}
|
||||||
|
if(strstr(time_type,"sec"))
|
||||||
|
{
|
||||||
|
cmd += "5=";
|
||||||
|
cmd += buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexRtc::read_rtc_time(char *time,uint32_t len)
|
||||||
|
{
|
||||||
|
char time_buf[22] = {"0000/00/00 00:00:00 0"};
|
||||||
|
uint32_t year,mon,day,hour,min,sec,week;
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
cmd = "get rtc0";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&year);
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd = "get rtc1";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&mon);
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd = "get rtc2";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&day);
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd = "get rtc3";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&hour);
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd = "get rtc4";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&min);
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd = "get rtc5";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&sec);
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd = "get rtc6";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&week);
|
||||||
|
|
||||||
|
time_buf[0] = year/1000 + '0';
|
||||||
|
time_buf[1] = (year/100)%10 + '0';
|
||||||
|
time_buf[2] = (year/10)%10 + '0';
|
||||||
|
time_buf[3] = year%10 + '0';
|
||||||
|
time_buf[5] = mon/10 + '0';
|
||||||
|
time_buf[6] = mon%10 + '0';
|
||||||
|
time_buf[8] = day/10 + '0';
|
||||||
|
time_buf[9] = day%10 + '0';
|
||||||
|
time_buf[11] = hour/10 + '0';
|
||||||
|
time_buf[12] = hour%10 + '0';
|
||||||
|
time_buf[14] = min/10 + '0';
|
||||||
|
time_buf[15] = min%10 + '0';
|
||||||
|
time_buf[17] = sec/10 + '0';
|
||||||
|
time_buf[18] = sec%10 + '0';
|
||||||
|
time_buf[20] = week + '0';
|
||||||
|
time_buf[21] = '\0';
|
||||||
|
|
||||||
|
|
||||||
|
if(len >= 22)
|
||||||
|
{
|
||||||
|
for(int i=0;i<22;i++)
|
||||||
|
{
|
||||||
|
time[i] = time_buf[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
for(int i=0;i<len;i++)
|
||||||
|
{
|
||||||
|
time[i] = time_buf[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexRtc::read_rtc_time(uint32_t *time,uint32_t len)
|
||||||
|
{
|
||||||
|
uint32_t time_buf[7] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
cmd = "get rtc0";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&time_buf[0]);
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd = "get rtc1";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&time_buf[1]);
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd = "get rtc2";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&time_buf[2]);
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd = "get rtc3";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&time_buf[3]);
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd = "get rtc4";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&time_buf[4]);
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd = "get rtc5";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&time_buf[5]);
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd = "get rtc6";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
recvRetNumber(&time_buf[6]);
|
||||||
|
|
||||||
|
|
||||||
|
for(int i=0;i<len;i++)
|
||||||
|
{
|
||||||
|
time[i] = time_buf[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint32_t NexRtc::read_rtc_time(char *time_type,uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get rtc");
|
||||||
|
char buf[10] = {0};
|
||||||
|
|
||||||
|
if(strstr(time_type,"year"))
|
||||||
|
{
|
||||||
|
cmd += '0';
|
||||||
|
}
|
||||||
|
else if(strstr(time_type,"mon"))
|
||||||
|
{
|
||||||
|
cmd += '1';
|
||||||
|
}
|
||||||
|
else if(strstr(time_type,"day"))
|
||||||
|
{
|
||||||
|
cmd += '2';
|
||||||
|
}
|
||||||
|
else if(strstr(time_type,"hour"))
|
||||||
|
{
|
||||||
|
cmd += '3';
|
||||||
|
}
|
||||||
|
else if(strstr(time_type,"min"))
|
||||||
|
{
|
||||||
|
cmd += '4';
|
||||||
|
}
|
||||||
|
else if(strstr(time_type,"sec"))
|
||||||
|
{
|
||||||
|
cmd += '5';
|
||||||
|
}
|
||||||
|
else if(strstr(time_type,"week"))
|
||||||
|
{
|
||||||
|
cmd += '6';
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
|
@ -0,0 +1,93 @@
|
||||||
|
/**
|
||||||
|
* @file NexRtc.h
|
||||||
|
*
|
||||||
|
* The definition of class NexRtc.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _NEXRTC_H
|
||||||
|
#define _NEXRTC_H
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexRtc component.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class NexRtc
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
bool write_rtc_time(char *time);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* write rtc times
|
||||||
|
*
|
||||||
|
* @param time_type - To type in time (example:write_rtc_time("year",2016))
|
||||||
|
* @param number - the time value
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool write_rtc_time(char *time_type,uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* write rtc times
|
||||||
|
*
|
||||||
|
* @param time - Time to write to the array
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
|
||||||
|
bool write_rtc_time(uint32_t *time);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* read rtc time
|
||||||
|
*
|
||||||
|
* @param time - Access data array
|
||||||
|
* @param len - len of array
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
|
||||||
|
uint32_t read_rtc_time(char *time,uint32_t len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* read rtc times
|
||||||
|
*
|
||||||
|
* @param time_type - To type in time
|
||||||
|
* @param number - the time value
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
|
||||||
|
uint32_t read_rtc_time(char *time_type,uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* read rtc time
|
||||||
|
*
|
||||||
|
* @param time - Access data array
|
||||||
|
* @param len - len of array
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
|
||||||
|
uint32_t read_rtc_time(uint32_t *time,uint32_t len);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXRTC_H__ */
|
|
@ -0,0 +1,351 @@
|
||||||
|
/**
|
||||||
|
* @file NexScrolltext.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexScrolltext.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#include "NexScrolltext.h"
|
||||||
|
|
||||||
|
NexScrolltext::NexScrolltext(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexTouch(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t NexScrolltext::getText(char *buffer, uint16_t len)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".txt";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetString(buffer,len);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexScrolltext::setText(const char *buffer)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".txt=\"";
|
||||||
|
cmd += buffer;
|
||||||
|
cmd += "\"";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexScrolltext::Get_background_color_bco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexScrolltext::Set_background_color_bco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexScrolltext::Get_font_color_pco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexScrolltext::Set_font_color_pco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexScrolltext::Get_place_xcen(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".xcen";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexScrolltext::Set_place_xcen(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".xcen=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexScrolltext::Get_place_ycen(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".ycen";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexScrolltext::Set_place_ycen(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".ycen=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexScrolltext::getFont(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".font";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexScrolltext::setFont(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".font=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexScrolltext::Get_background_crop_picc(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexScrolltext::Set_background_crop_picc(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexScrolltext::Get_background_image_pic(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexScrolltext::Set_background_image_pic(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexScrolltext::Get_scroll_dir(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".dir";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexScrolltext::Set_scroll_dir(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".dir=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexScrolltext::Get_scroll_distance(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".dis";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexScrolltext::Set_scroll_distance(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
if (number < 2)
|
||||||
|
{
|
||||||
|
number = 2;
|
||||||
|
}
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".dis=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexScrolltext::Get_cycle_tim(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".tim";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexScrolltext::Set_cycle_tim(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
if (number < 8)
|
||||||
|
{
|
||||||
|
number = 8;
|
||||||
|
}
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".tim=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool NexScrolltext::enable(void)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
utoa(1, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".en=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexScrolltext::disable(void)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
utoa(0, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".en=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
|
@ -0,0 +1,223 @@
|
||||||
|
/**
|
||||||
|
* @file NexScrolltext.h
|
||||||
|
*
|
||||||
|
* The definition of class NexScrolltext.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXSCROLLTEXT_H__
|
||||||
|
#define __NEXSCROLLTEXT_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexText component.
|
||||||
|
*/
|
||||||
|
class NexScrolltext: public NexTouch
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexScrolltext(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get text attribute of component.
|
||||||
|
*
|
||||||
|
* @param buffer - buffer storing text returned.
|
||||||
|
* @param len - length of buffer.
|
||||||
|
* @return The real length of text returned.
|
||||||
|
*/
|
||||||
|
uint16_t getText(char *buffer, uint16_t len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set text attribute of component.
|
||||||
|
*
|
||||||
|
* @param buffer - text buffer terminated with '\0'.
|
||||||
|
* @return true if success, false for failure.
|
||||||
|
*/
|
||||||
|
bool setText(const char *buffer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_color_bco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_color_bco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_font_color_pco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_font_color_pco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get xcen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_place_xcen(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set xcen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_place_xcen(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get ycen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_place_ycen(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set ycen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_place_ycen(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get font attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t getFont(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set font attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool setFont(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get picc attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_crop_picc(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set picc attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_crop_picc(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pic attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_image_pic(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pic attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_image_pic(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get dir attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_scroll_dir(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set dir attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_scroll_dir(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get dis attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_scroll_distance(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set dis attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_scroll_distance(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get tim attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_cycle_tim(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set tim attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_cycle_tim(uint32_t number);
|
||||||
|
|
||||||
|
bool enable(void);
|
||||||
|
bool disable(void);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXSCROLLTEXT_H__ */
|
|
@ -0,0 +1,211 @@
|
||||||
|
/**
|
||||||
|
* @file NexSlider.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexSlider.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#include "NexSlider.h"
|
||||||
|
|
||||||
|
NexSlider::NexSlider(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexTouch(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexSlider::getValue(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexSlider::setValue(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexSlider::Get_background_color_bco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexSlider::Set_background_color_bco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexSlider::Get_font_color_pco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexSlider::Set_font_color_pco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexSlider::Get_pointer_thickness_wid(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".wid";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexSlider::Set_pointer_thickness_wid(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".wid=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexSlider::Get_cursor_height_hig(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".hig";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexSlider::Set_cursor_height_hig(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".hig=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexSlider::getMaxval(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".maxval";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexSlider::setMaxval(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".maxval=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexSlider::getMinval(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".minval";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexSlider::setMinval(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".minval=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
|
@ -0,0 +1,159 @@
|
||||||
|
/**
|
||||||
|
* @file NexSlider.h
|
||||||
|
*
|
||||||
|
* The definition of class NexSlider.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXSLIDER_H__
|
||||||
|
#define __NEXSLIDER_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexSlider component.
|
||||||
|
*/
|
||||||
|
class NexSlider: public NexTouch
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexSlider(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of slider.
|
||||||
|
*
|
||||||
|
* @param number - an output parameter to save the value of slider.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool getValue(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of slider.
|
||||||
|
*
|
||||||
|
* @param number - the value of slider.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool setValue(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_color_bco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_color_bco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_font_color_pco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_font_color_pco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get wid attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_pointer_thickness_wid(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set wid attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_pointer_thickness_wid(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get hig attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_cursor_height_hig(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set hig attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_cursor_height_hig(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get maxval attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t getMaxval(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set maxval attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool setMaxval(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get minval attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t getMinval(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set minval attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool setMinval(uint32_t number);
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXSLIDER_H__ */
|
|
@ -0,0 +1,236 @@
|
||||||
|
/**
|
||||||
|
* @file NexText.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexText.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#include "NexText.h"
|
||||||
|
|
||||||
|
NexText::NexText(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexTouch(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t NexText::getText(char *buffer, uint16_t len)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".txt";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetString(buffer,len);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexText::setText(const char *buffer)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".txt=\"";
|
||||||
|
cmd += buffer;
|
||||||
|
cmd += "\"";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexText::Get_background_color_bco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexText::Set_background_color_bco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexText::Get_font_color_pco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexText::Set_font_color_pco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexText::Get_place_xcen(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".xcen";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexText::Set_place_xcen(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".xcen=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexText::Get_place_ycen(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".ycen";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexText::Set_place_ycen(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".ycen=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexText::getFont(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".font";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexText::setFont(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".font=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexText::Get_background_crop_picc(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexText::Set_background_crop_picc(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".picc=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexText::Get_background_image_pic(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexText::Set_background_image_pic(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pic=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,173 @@
|
||||||
|
/**
|
||||||
|
* @file NexText.h
|
||||||
|
*
|
||||||
|
* The definition of class NexText.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXTEXT_H__
|
||||||
|
#define __NEXTEXT_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexText component.
|
||||||
|
*/
|
||||||
|
class NexText: public NexTouch
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexText(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get text attribute of component.
|
||||||
|
*
|
||||||
|
* @param buffer - buffer storing text returned.
|
||||||
|
* @param len - length of buffer.
|
||||||
|
* @return The real length of text returned.
|
||||||
|
*/
|
||||||
|
uint16_t getText(char *buffer, uint16_t len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set text attribute of component.
|
||||||
|
*
|
||||||
|
* @param buffer - text buffer terminated with '\0'.
|
||||||
|
* @return true if success, false for failure.
|
||||||
|
*/
|
||||||
|
bool setText(const char *buffer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_color_bco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_color_bco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_font_color_pco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_font_color_pco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get xcen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_place_xcen(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set xcen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_place_xcen(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get ycen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_place_ycen(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set ycen attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_place_ycen(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get font attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t getFont(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set font attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool setFont(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get picc attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_crop_picc(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set picc attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_crop_picc(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pic attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_image_pic(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pic attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_image_pic(uint32_t number);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXTEXT_H__ */
|
|
@ -0,0 +1,115 @@
|
||||||
|
/**
|
||||||
|
* @file NexTimer.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexTimer.
|
||||||
|
*
|
||||||
|
* @author huang xianming (email:<xianming.huang@itead.cc>)
|
||||||
|
* @date 2015/8/26
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "NexTimer.h"
|
||||||
|
|
||||||
|
NexTimer::NexTimer(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexTouch(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void NexTimer::attachTimer(NexTouchEventCb timer, void *ptr)
|
||||||
|
{
|
||||||
|
NexTouch::attachPop(timer, ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NexTimer::detachTimer(void)
|
||||||
|
{
|
||||||
|
NexTouch::detachPop();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexTimer::getCycle(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".tim";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexTimer::setCycle(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
if (number < 50)
|
||||||
|
{
|
||||||
|
number = 50;
|
||||||
|
}
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".tim=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool NexTimer::enable(void)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
utoa(1, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".en=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexTimer::disable(void)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
utoa(0, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".en=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexTimer::Get_cycle_tim(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".tim";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexTimer::Set_cycle_tim(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
if (number < 8)
|
||||||
|
{
|
||||||
|
number = 8;
|
||||||
|
}
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".tim=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd = "";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,120 @@
|
||||||
|
/**
|
||||||
|
* @file NexTimer.h
|
||||||
|
*
|
||||||
|
* The definition of class NexTimer.
|
||||||
|
*
|
||||||
|
* @author huang xianming (email:<xianming.huang@itead.cc>)
|
||||||
|
* @date 2015/8/26
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXTIMER_H__
|
||||||
|
#define __NEXTIMER_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexTimer component.
|
||||||
|
*
|
||||||
|
* Commonly, you want to do something after set timer cycle and enable it,and the cycle value
|
||||||
|
* must be greater than 50
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class NexTimer: public NexTouch
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexTimer(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attach an callback function of timer respond event.
|
||||||
|
*
|
||||||
|
* @param timer - callback called with ptr when a timer respond event occurs.
|
||||||
|
* @param ptr - parameter passed into push[default:NULL].
|
||||||
|
* @return none.
|
||||||
|
*
|
||||||
|
* @note If calling this method multiply, the last call is valid.
|
||||||
|
*/
|
||||||
|
void attachTimer(NexTouchEventCb timer, void *ptr = NULL);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detach an callback function.
|
||||||
|
*
|
||||||
|
* @return none.
|
||||||
|
*/
|
||||||
|
void detachTimer(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the value of timer cycle val.
|
||||||
|
*
|
||||||
|
* @param number - an output parameter to save the value of timer cycle.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool getCycle(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of timer cycle val.
|
||||||
|
*
|
||||||
|
* @param number - the value of timer cycle.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*
|
||||||
|
* @warning the cycle value must be greater than 50.
|
||||||
|
*/
|
||||||
|
bool setCycle(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* contorl timer enable.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool enable(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* contorl timer disable.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool disable(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get tim attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_cycle_tim(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set tim attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_cycle_tim(uint32_t number);
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXTIMER_H__ */
|
|
@ -0,0 +1,95 @@
|
||||||
|
/**
|
||||||
|
* @file NexTouch.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexTouch.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#include "NexTouch.h"
|
||||||
|
|
||||||
|
|
||||||
|
NexTouch::NexTouch(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexObject(pid, cid, name)
|
||||||
|
{
|
||||||
|
this->__cb_push = NULL;
|
||||||
|
this->__cb_pop = NULL;
|
||||||
|
this->__cbpop_ptr = NULL;
|
||||||
|
this->__cbpush_ptr = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void NexTouch::attachPush(NexTouchEventCb push, void *ptr)
|
||||||
|
{
|
||||||
|
this->__cb_push = push;
|
||||||
|
this->__cbpush_ptr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void NexTouch::detachPush(void)
|
||||||
|
{
|
||||||
|
this->__cb_push = NULL;
|
||||||
|
this->__cbpush_ptr = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void NexTouch::attachPop(NexTouchEventCb pop, void *ptr)
|
||||||
|
{
|
||||||
|
this->__cb_pop = pop;
|
||||||
|
this->__cbpop_ptr = ptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void NexTouch::detachPop(void)
|
||||||
|
{
|
||||||
|
this->__cb_pop = NULL;
|
||||||
|
this->__cbpop_ptr = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void NexTouch::push(void)
|
||||||
|
{
|
||||||
|
if (__cb_push)
|
||||||
|
{
|
||||||
|
__cb_push(__cbpush_ptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void NexTouch::pop(void)
|
||||||
|
{
|
||||||
|
if (__cb_pop)
|
||||||
|
{
|
||||||
|
__cb_pop(__cbpop_ptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void NexTouch::iterate(NexTouch **list, uint8_t pid, uint8_t cid, int32_t event)
|
||||||
|
{
|
||||||
|
NexTouch *e = NULL;
|
||||||
|
uint16_t i = 0;
|
||||||
|
|
||||||
|
if (NULL == list)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(i = 0; (e = list[i]) != NULL; i++)
|
||||||
|
{
|
||||||
|
if (e->getObjPid() == pid && e->getObjCid() == cid)
|
||||||
|
{
|
||||||
|
e->printObjInfo();
|
||||||
|
if (NEX_EVENT_PUSH == event)
|
||||||
|
{
|
||||||
|
e->push();
|
||||||
|
}
|
||||||
|
else if (NEX_EVENT_POP == event)
|
||||||
|
{
|
||||||
|
e->pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,116 @@
|
||||||
|
/**
|
||||||
|
* @file NexTouch.h
|
||||||
|
*
|
||||||
|
* The definition of class NexTouch.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXTOUCH_H__
|
||||||
|
#define __NEXTOUCH_H__
|
||||||
|
|
||||||
|
#include <Arduino.h>
|
||||||
|
#include "NexConfig.h"
|
||||||
|
#include "NexObject.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup TouchEvent
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Push touch event occuring when your finger or pen coming to Nextion touch pannel.
|
||||||
|
*/
|
||||||
|
#define NEX_EVENT_PUSH (0x01)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pop touch event occuring when your finger or pen leaving from Nextion touch pannel.
|
||||||
|
*/
|
||||||
|
#define NEX_EVENT_POP (0x00)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of callback funciton when an touch event occurs.
|
||||||
|
*
|
||||||
|
* @param ptr - user pointer for any purpose. Commonly, it is a pointer to a object.
|
||||||
|
* @return none.
|
||||||
|
*/
|
||||||
|
typedef void (*NexTouchEventCb)(void *ptr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Father class of the components with touch events.
|
||||||
|
*
|
||||||
|
* Derives from NexObject and provides methods allowing user to attach
|
||||||
|
* (or detach) a callback function called when push(or pop) touch event occurs.
|
||||||
|
*/
|
||||||
|
class NexTouch: public NexObject
|
||||||
|
{
|
||||||
|
public: /* static methods */
|
||||||
|
static void iterate(NexTouch **list, uint8_t pid, uint8_t cid, int32_t event);
|
||||||
|
|
||||||
|
public: /* methods */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexTouch(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attach an callback function of push touch event.
|
||||||
|
*
|
||||||
|
* @param push - callback called with ptr when a push touch event occurs.
|
||||||
|
* @param ptr - parameter passed into push[default:NULL].
|
||||||
|
* @return none.
|
||||||
|
*
|
||||||
|
* @note If calling this method multiply, the last call is valid.
|
||||||
|
*/
|
||||||
|
void attachPush(NexTouchEventCb push, void *ptr = NULL);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detach an callback function.
|
||||||
|
*
|
||||||
|
* @return none.
|
||||||
|
*/
|
||||||
|
void detachPush(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attach an callback function of pop touch event.
|
||||||
|
*
|
||||||
|
* @param pop - callback called with ptr when a pop touch event occurs.
|
||||||
|
* @param ptr - parameter passed into pop[default:NULL].
|
||||||
|
* @return none.
|
||||||
|
*
|
||||||
|
* @note If calling this method multiply, the last call is valid.
|
||||||
|
*/
|
||||||
|
void attachPop(NexTouchEventCb pop, void *ptr = NULL);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detach an callback function.
|
||||||
|
*
|
||||||
|
* @return none.
|
||||||
|
*/
|
||||||
|
void detachPop(void);
|
||||||
|
|
||||||
|
private: /* methods */
|
||||||
|
void push(void);
|
||||||
|
void pop(void);
|
||||||
|
|
||||||
|
private: /* data */
|
||||||
|
NexTouchEventCb __cb_push;
|
||||||
|
void *__cbpush_ptr;
|
||||||
|
NexTouchEventCb __cb_pop;
|
||||||
|
void *__cbpop_ptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXTOUCH_H__ */
|
|
@ -0,0 +1,240 @@
|
||||||
|
/**
|
||||||
|
* @file NexUpload.cpp
|
||||||
|
*
|
||||||
|
* The implementation of download tft file for nextion.
|
||||||
|
*
|
||||||
|
* @author Chen Zengpeng (email:<zengpeng.chen@itead.cc>)
|
||||||
|
* @date 2016/3/29
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "NexUpload.h"
|
||||||
|
#include <SoftwareSerial.h>
|
||||||
|
|
||||||
|
//#define USE_SOFTWARE_SERIAL
|
||||||
|
#ifdef USE_SOFTWARE_SERIAL
|
||||||
|
SoftwareSerial dbSerial(3, 2); /* RX:D3, TX:D2 */
|
||||||
|
#define DEBUG_SERIAL_ENABLE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DEBUG_SERIAL_ENABLE
|
||||||
|
#define dbSerialPrint(a) dbSerial.print(a)
|
||||||
|
#define dbSerialPrintln(a) dbSerial.println(a)
|
||||||
|
#define dbSerialBegin(a) dbSerial.begin(a)
|
||||||
|
#else
|
||||||
|
#define dbSerialPrint(a) do{}while(0)
|
||||||
|
#define dbSerialPrintln(a) do{}while(0)
|
||||||
|
#define dbSerialBegin(a) do{}while(0)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
NexUpload::NexUpload(const char *file_name,const uint8_t SD_chip_select,uint32_t download_baudrate)
|
||||||
|
{
|
||||||
|
_file_name = file_name;
|
||||||
|
_SD_chip_select = SD_chip_select;
|
||||||
|
_download_baudrate = download_baudrate;
|
||||||
|
}
|
||||||
|
|
||||||
|
NexUpload::NexUpload(const String file_Name,const uint8_t SD_chip_select,uint32_t download_baudrate)
|
||||||
|
{
|
||||||
|
NexUpload(file_Name.c_str(),SD_chip_select,download_baudrate);
|
||||||
|
}
|
||||||
|
|
||||||
|
void NexUpload::upload(void)
|
||||||
|
{
|
||||||
|
dbSerialBegin(9600);
|
||||||
|
if(!_checkFile())
|
||||||
|
{
|
||||||
|
dbSerialPrintln("the file is error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(_getBaudrate() == 0)
|
||||||
|
{
|
||||||
|
dbSerialPrintln("get baudrate error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!_setDownloadBaudrate(_download_baudrate))
|
||||||
|
{
|
||||||
|
dbSerialPrintln("modify baudrate error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!_downloadTftFile())
|
||||||
|
{
|
||||||
|
dbSerialPrintln("download file error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
dbSerialPrintln("download ok\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t NexUpload::_getBaudrate(void)
|
||||||
|
{
|
||||||
|
uint32_t baudrate_array[7] = {115200,19200,9600,57600,38400,4800,2400};
|
||||||
|
for(uint8_t i = 0; i < 7; i++)
|
||||||
|
{
|
||||||
|
if(_searchBaudrate(baudrate_array[i]))
|
||||||
|
{
|
||||||
|
_baudrate = baudrate_array[i];
|
||||||
|
dbSerialPrintln("get baudrate");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return _baudrate;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexUpload::_checkFile(void)
|
||||||
|
{
|
||||||
|
dbSerialPrintln("start _checkFile");
|
||||||
|
if(!SD.begin(_SD_chip_select))
|
||||||
|
{
|
||||||
|
dbSerialPrintln("init sd failed");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if(!SD.exists(_file_name))
|
||||||
|
{
|
||||||
|
dbSerialPrintln("file is not exit");
|
||||||
|
}
|
||||||
|
_myFile = SD.open(_file_name);
|
||||||
|
_undownloadByte = _myFile.size();
|
||||||
|
dbSerialPrintln("tft file size is:");
|
||||||
|
dbSerialPrintln(_undownloadByte);
|
||||||
|
dbSerialPrintln("check file ok");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexUpload::_searchBaudrate(uint32_t baudrate)
|
||||||
|
{
|
||||||
|
String string = String("");
|
||||||
|
nexSerial.begin(baudrate);
|
||||||
|
this->sendCommand("");
|
||||||
|
this->sendCommand("connect");
|
||||||
|
this->recvRetString(string);
|
||||||
|
if(string.indexOf("comok") != -1)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void NexUpload::sendCommand(const char* cmd)
|
||||||
|
{
|
||||||
|
|
||||||
|
while (nexSerial.available())
|
||||||
|
{
|
||||||
|
nexSerial.read();
|
||||||
|
}
|
||||||
|
|
||||||
|
nexSerial.print(cmd);
|
||||||
|
nexSerial.write(0xFF);
|
||||||
|
nexSerial.write(0xFF);
|
||||||
|
nexSerial.write(0xFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t NexUpload::recvRetString(String &string, uint32_t timeout,bool recv_flag)
|
||||||
|
{
|
||||||
|
uint16_t ret = 0;
|
||||||
|
uint8_t c = 0;
|
||||||
|
long start;
|
||||||
|
bool exit_flag = false;
|
||||||
|
start = millis();
|
||||||
|
while (millis() - start <= timeout)
|
||||||
|
{
|
||||||
|
while (nexSerial.available())
|
||||||
|
{
|
||||||
|
c = nexSerial.read();
|
||||||
|
if(c == 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
string += (char)c;
|
||||||
|
if(recv_flag)
|
||||||
|
{
|
||||||
|
if(string.indexOf(0x05) != -1)
|
||||||
|
{
|
||||||
|
exit_flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(exit_flag)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ret = string.length();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexUpload::_setDownloadBaudrate(uint32_t baudrate)
|
||||||
|
{
|
||||||
|
String string = String("");
|
||||||
|
String cmd = String("");
|
||||||
|
|
||||||
|
String filesize_str = String(_undownloadByte,10);
|
||||||
|
String baudrate_str = String(baudrate,10);
|
||||||
|
cmd = "whmi-wri " + filesize_str + "," + baudrate_str + ",0";
|
||||||
|
|
||||||
|
dbSerialPrintln(cmd);
|
||||||
|
this->sendCommand("");
|
||||||
|
this->sendCommand(cmd.c_str());
|
||||||
|
delay(50);
|
||||||
|
nexSerial.begin(baudrate);
|
||||||
|
this->recvRetString(string,500);
|
||||||
|
if(string.indexOf(0x05) != -1)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexUpload::_downloadTftFile(void)
|
||||||
|
{
|
||||||
|
uint8_t c;
|
||||||
|
uint16_t send_timer = 0;
|
||||||
|
uint16_t last_send_num = 0;
|
||||||
|
String string = String("");
|
||||||
|
send_timer = _undownloadByte / 4096 + 1;
|
||||||
|
last_send_num = _undownloadByte % 4096;
|
||||||
|
|
||||||
|
while(send_timer)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(send_timer == 1)
|
||||||
|
{
|
||||||
|
for(uint16_t j = 1; j <= 4096; j++)
|
||||||
|
{
|
||||||
|
if(j <= last_send_num)
|
||||||
|
{
|
||||||
|
c = _myFile.read();
|
||||||
|
nexSerial.write(c);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for(uint16_t i = 1; i <= 4096; i++)
|
||||||
|
{
|
||||||
|
c = _myFile.read();
|
||||||
|
nexSerial.write(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this->recvRetString(string,500,true);
|
||||||
|
if(string.indexOf(0x05) != -1)
|
||||||
|
{
|
||||||
|
string = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
--send_timer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,142 @@
|
||||||
|
/**
|
||||||
|
* @file NexUpload.h
|
||||||
|
*
|
||||||
|
* The definition of class NexUpload.
|
||||||
|
*
|
||||||
|
* @author Chen Zengpeng (email:<zengpeng.chen@itead.cc>)
|
||||||
|
* @date 2016/3/29
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#ifndef __NEXUPLOAD_H__
|
||||||
|
#define __NEXUPLOAD_H__
|
||||||
|
#include <Arduino.h>
|
||||||
|
#include <SPI.h>
|
||||||
|
#include <SD.h>
|
||||||
|
#include "NexHardware.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup CoreAPI
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Provides the API for nextion to download the ftf file.
|
||||||
|
*/
|
||||||
|
class NexUpload
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param file_name - tft file name.
|
||||||
|
* @param SD_chip_select - sd chip select pin.
|
||||||
|
* @param download_baudrate - set download baudrate.
|
||||||
|
*/
|
||||||
|
NexUpload(const char *file_name,const uint8_t SD_chip_select,uint32_t download_baudrate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param file_Name - tft file name.
|
||||||
|
* @param SD_chip_select - sd chip select pin.
|
||||||
|
* @param download_baudrate - set download baudrate.
|
||||||
|
*/
|
||||||
|
NexUpload(const String file_Name,const uint8_t SD_chip_select,uint32_t download_baudrate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* destructor.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
~NexUpload(){}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* start download.
|
||||||
|
*
|
||||||
|
* @return none.
|
||||||
|
*/
|
||||||
|
void upload();
|
||||||
|
|
||||||
|
private: /* methods */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* get communicate baudrate.
|
||||||
|
*
|
||||||
|
* @return communicate baudrate.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
uint16_t _getBaudrate(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* check tft file.
|
||||||
|
*
|
||||||
|
* @return true if success, false for failure.
|
||||||
|
*/
|
||||||
|
bool _checkFile(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* search communicate baudrate.
|
||||||
|
*
|
||||||
|
* @param baudrate - communicate baudrate.
|
||||||
|
*
|
||||||
|
* @return true if success, false for failure.
|
||||||
|
*/
|
||||||
|
bool _searchBaudrate(uint32_t baudrate);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* set download baudrate.
|
||||||
|
*
|
||||||
|
* @param baudrate - set download baudrate.
|
||||||
|
*
|
||||||
|
* @return true if success, false for failure.
|
||||||
|
*/
|
||||||
|
bool _setDownloadBaudrate(uint32_t baudrate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* start dowload tft file to nextion.
|
||||||
|
*
|
||||||
|
* @return none.
|
||||||
|
*/
|
||||||
|
bool _downloadTftFile(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Send command to Nextion.
|
||||||
|
*
|
||||||
|
* @param cmd - the string of command.
|
||||||
|
*
|
||||||
|
* @return none.
|
||||||
|
*/
|
||||||
|
void sendCommand(const char* cmd);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Receive string data.
|
||||||
|
*
|
||||||
|
* @param buffer - save string data.
|
||||||
|
* @param timeout - set timeout time.
|
||||||
|
* @param recv_flag - if recv_flag is true,will braak when receive 0x05.
|
||||||
|
*
|
||||||
|
* @return the length of string buffer.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
uint16_t recvRetString(String &string, uint32_t timeout = 100,bool recv_flag = false);
|
||||||
|
|
||||||
|
private: /* data */
|
||||||
|
uint32_t _baudrate; /*nextion serail baudrate*/
|
||||||
|
const char *_file_name; /*nextion tft file name*/
|
||||||
|
File _myFile; /*nextion ftf file*/
|
||||||
|
uint32_t _undownloadByte; /*undownload byte of tft file*/
|
||||||
|
uint8_t _SD_chip_select; /*sd chip select pin*/
|
||||||
|
uint32_t _download_baudrate; /*download baudrate*/
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXDOWNLOAD_H__ */
|
|
@ -0,0 +1,64 @@
|
||||||
|
/**
|
||||||
|
* @file NexVariable.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexText.
|
||||||
|
*
|
||||||
|
* @author huang xiaoming (email:<xiaoming.huang@itead.cc>)
|
||||||
|
* @date 2016/9/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#include "NexVariable.h"
|
||||||
|
|
||||||
|
NexVariable::NexVariable(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexTouch(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexVariable::getValue(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd = String("get ");
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexVariable::setValue(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".val=";
|
||||||
|
cmd += buf;
|
||||||
|
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexVariable::getText(char *buffer, uint32_t len)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".txt";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetString(buffer,len);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexVariable::setText(const char *buffer)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".txt=\"";
|
||||||
|
cmd += buffer;
|
||||||
|
cmd += "\"";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
|
@ -0,0 +1,82 @@
|
||||||
|
/**
|
||||||
|
* @file NexButton.h
|
||||||
|
*
|
||||||
|
* The definition of class NexButton.
|
||||||
|
*
|
||||||
|
* @author huang xiaoming (email:<xiaoming.huang@itead.cc>)
|
||||||
|
* @date 2016/9/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __NEXVARRIABLE_H__
|
||||||
|
#define __NEXVARRIABLE_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexButton component.
|
||||||
|
*
|
||||||
|
* Commonly, you want to do something after push and pop it. It is recommanded that only
|
||||||
|
* call @ref NexTouch::attachPop to satisfy your purpose.
|
||||||
|
*
|
||||||
|
* @warning Please do not call @ref NexTouch::attachPush on this component, even though you can.
|
||||||
|
*/
|
||||||
|
class NexVariable: public NexTouch
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexVariable(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get text attribute of component.
|
||||||
|
*
|
||||||
|
* @param buffer - buffer storing text returned.
|
||||||
|
* @param len - length of buffer.
|
||||||
|
* @return The real length of text returned.
|
||||||
|
*/
|
||||||
|
uint32_t getText(char *buffer, uint32_t len);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set text attribute of component.
|
||||||
|
*
|
||||||
|
* @param buffer - text buffer terminated with '\0'.
|
||||||
|
* @return true if success, false for failure.
|
||||||
|
*/
|
||||||
|
bool setText(const char *buffer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get val attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t getValue(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set val attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool setValue(uint32_t number);
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXVARRIABLE_H__*/
|
|
@ -0,0 +1,176 @@
|
||||||
|
/**
|
||||||
|
* @file NexWaveform.cpp
|
||||||
|
*
|
||||||
|
* The implementation of class NexWaveform.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#include "NexWaveform.h"
|
||||||
|
|
||||||
|
NexWaveform::NexWaveform(uint8_t pid, uint8_t cid, const char *name)
|
||||||
|
:NexObject(pid, cid, name)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexWaveform::addValue(uint8_t ch, uint8_t number)
|
||||||
|
{
|
||||||
|
char buf[15] = {0};
|
||||||
|
|
||||||
|
if (ch > 3)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
sprintf(buf, "add %u,%u,%u", getObjCid(), ch, number);
|
||||||
|
|
||||||
|
sendCommand(buf);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexWaveform::Get_background_color_bco(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexWaveform::Set_background_color_bco(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".bco=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexWaveform::Get_grid_color_gdc(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".gdc";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexWaveform::Set_grid_color_gdc(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".gdc=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexWaveform::Get_grid_width_gdw(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".gdw";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexWaveform::Set_grid_width_gdw(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".gdw=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexWaveform::Get_grid_height_gdh(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".gdh";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexWaveform::Set_grid_height_gdh(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".gdh=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t NexWaveform::Get_channel_0_color_pco0(uint32_t *number)
|
||||||
|
{
|
||||||
|
String cmd;
|
||||||
|
cmd += "get ";
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco0";
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetNumber(number);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NexWaveform::Set_channel_0_color_pco0(uint32_t number)
|
||||||
|
{
|
||||||
|
char buf[10] = {0};
|
||||||
|
String cmd;
|
||||||
|
|
||||||
|
utoa(number, buf, 10);
|
||||||
|
cmd += getObjName();
|
||||||
|
cmd += ".pco0=";
|
||||||
|
cmd += buf;
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
|
||||||
|
cmd="";
|
||||||
|
cmd += "ref ";
|
||||||
|
cmd += getObjName();
|
||||||
|
sendCommand(cmd.c_str());
|
||||||
|
return recvRetCommandFinished();
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,133 @@
|
||||||
|
/**
|
||||||
|
* @file NexWaveform.h
|
||||||
|
*
|
||||||
|
* The definition of class NexWaveform.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/13
|
||||||
|
*
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#ifndef __NEXWAVEFORM_H__
|
||||||
|
#define __NEXWAVEFORM_H__
|
||||||
|
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
/**
|
||||||
|
* @addtogroup Component
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NexWaveform component.
|
||||||
|
*/
|
||||||
|
class NexWaveform: public NexObject
|
||||||
|
{
|
||||||
|
public: /* methods */
|
||||||
|
/**
|
||||||
|
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
*/
|
||||||
|
NexWaveform(uint8_t pid, uint8_t cid, const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add value to show.
|
||||||
|
*
|
||||||
|
* @param ch - channel of waveform(0-3).
|
||||||
|
* @param number - the value of waveform.
|
||||||
|
*
|
||||||
|
* @retval true - success.
|
||||||
|
* @retval false - failed.
|
||||||
|
*/
|
||||||
|
bool addValue(uint8_t ch, uint8_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_background_color_bco(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set bco attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_background_color_bco(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get gdc attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_grid_color_gdc(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set gdc attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_grid_color_gdc(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get gdw attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_grid_width_gdw(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set gdw attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_grid_width_gdw(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get gdh attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_grid_height_gdh(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set gdh attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_grid_height_gdh(uint32_t number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get pco0 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - buffer storing data retur
|
||||||
|
* @return the length of the data
|
||||||
|
*/
|
||||||
|
uint32_t Get_channel_0_color_pco0(uint32_t *number);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set pco0 attribute of component
|
||||||
|
*
|
||||||
|
* @param number - To set up the data
|
||||||
|
* @return true if success, false for failure
|
||||||
|
*/
|
||||||
|
bool Set_channel_0_color_pco0(uint32_t number);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXWAVEFORM_H__ */
|
|
@ -0,0 +1,45 @@
|
||||||
|
/**
|
||||||
|
* @file Nextion.h
|
||||||
|
*
|
||||||
|
* The header file including all other header files provided by this library.
|
||||||
|
*
|
||||||
|
* Every example sketch should include this file.
|
||||||
|
*
|
||||||
|
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
|
||||||
|
* @date 2015/8/12
|
||||||
|
* @copyright
|
||||||
|
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
#ifndef __NEXTION_H__
|
||||||
|
#define __NEXTION_H__
|
||||||
|
|
||||||
|
#include "Arduino.h"
|
||||||
|
#include "NexConfig.h"
|
||||||
|
#include "NexTouch.h"
|
||||||
|
#include "NexHardware.h"
|
||||||
|
|
||||||
|
#include "NexButton.h"
|
||||||
|
#include "NexCrop.h"
|
||||||
|
#include "NexGauge.h"
|
||||||
|
#include "NexHotspot.h"
|
||||||
|
#include "NexPage.h"
|
||||||
|
#include "NexPicture.h"
|
||||||
|
#include "NexProgressBar.h"
|
||||||
|
#include "NexSlider.h"
|
||||||
|
#include "NexText.h"
|
||||||
|
#include "NexWaveform.h"
|
||||||
|
#include "NexTimer.h"
|
||||||
|
#include "NexNumber.h"
|
||||||
|
#include "NexDualStateButton.h"
|
||||||
|
#include "NexVariable.h"
|
||||||
|
#include "NexCheckbox.h"
|
||||||
|
#include "NexRadio.h"
|
||||||
|
#include "NexScrolltext.h"
|
||||||
|
#include "NexGpio.h"
|
||||||
|
#include "NexRtc.h"
|
||||||
|
|
||||||
|
#endif /* #ifndef __NEXTION_H__ */
|
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
|
@ -0,0 +1,84 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompButton.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_button_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompButton.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that when the button component on the Nextion screen is released, the text of this button will plus one every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"></div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:35 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,171 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompButton/CompButton.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_button_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompButton.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> * Declare a button object [page id:0,component id:1, component name: "b0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <a class="code" href="class_nex_button.html">NexButton</a> b0 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 1, <span class="stringliteral">"b0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="keywordtype">char</span> buffer[100] = {0};</div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment"> * Register a button object to the touch event list. </span></div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> {</div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  &b0,</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> };</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment"> * Button component pop callback function. </span></div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment"> * In this example,the button's text value will plus one every time when it is released. </span></div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> {</div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  uint16_t len;</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  uint16_t number;</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <a class="code" href="class_nex_button.html">NexButton</a> *btn = (<a class="code" href="class_nex_button.html">NexButton</a> *)ptr;</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  dbSerialPrintln(<span class="stringliteral">"b0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  dbSerialPrintln((uint32_t)ptr); </div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="comment">/* Get the text value of button component [the value is string type]. */</span></div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  btn-><a class="code" href="class_nex_button.html#a5ba1f74aa94b41b98172e42583ee13d6">getText</a>(buffer, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  </div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  number = atoi(buffer);</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  number += 1;</div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  itoa(number, buffer, 10);</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="comment">/* Set the text value of button component [the value is string type]. */</span></div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  btn-><a class="code" href="class_nex_button.html#a649dafc5afb1dc7f1fc1bde1e6270290">setText</a>(buffer);</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> }</div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> </div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> { </div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="comment">/* Set the baudrate which is for debug and communicate with Nextion screen. */</span></div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="comment">/* Register the pop event callback function of the current button component. */</span></div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  b0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b0PopCallback, &b0);</div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  </div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>); </div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> }</div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div>
|
||||||
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> { </div>
|
||||||
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="comment"> * When a pop or push event occured every time,</span></div>
|
||||||
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="comment"> * the corresponding component[right page id and component id] in touch event list will be asked.</span></div>
|
||||||
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> }</div>
|
||||||
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> </div>
|
||||||
|
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> </div>
|
||||||
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> </div>
|
||||||
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> </div>
|
||||||
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div>
|
||||||
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div>
|
||||||
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div>
|
||||||
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div>
|
||||||
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div>
|
||||||
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div>
|
||||||
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> </div>
|
||||||
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_button_html_a5ba1f74aa94b41b98172e42583ee13d6"><div class="ttname"><a href="class_nex_button.html#a5ba1f74aa94b41b98172e42583ee13d6">NexButton::getText</a></div><div class="ttdeci">uint16_t getText(char *buffer, uint16_t len)</div><div class="ttdoc">Get text attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_button_8cpp_source.html#l00023">NexButton.cpp:23</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_button_html"><div class="ttname"><a href="class_nex_button.html">NexButton</a></div><div class="ttdoc">NexButton component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_button_8h_source.html#l00035">NexButton.h:35</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_button_html_a649dafc5afb1dc7f1fc1bde1e6270290"><div class="ttname"><a href="class_nex_button.html#a649dafc5afb1dc7f1fc1bde1e6270290">NexButton::setText</a></div><div class="ttdeci">bool setText(const char *buffer)</div><div class="ttdoc">Set text attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_button_8cpp_source.html#l00033">NexButton.cpp:33</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_a6c6ee996e64a0a9573e0623ecba0f92.html">CompButton</a></li><li class="navelem"><b>CompButton.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 08:58:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,171 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompButton/CompButton_v0_32.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_button__v0__32_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompButton_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> * Declare a button object [page id:0,component id:1, component name: "b0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <a class="code" href="class_nex_button.html">NexButton</a> b0 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 1, <span class="stringliteral">"b0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="keywordtype">char</span> buffer[100] = {0};</div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="comment"> * Register a button object to the touch event list. </span></div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> {</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  &b0,</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> };</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment"> * Button component pop callback function. </span></div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment"> * In this example,the button's text value will plus one every time when it is released. </span></div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> {</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  uint16_t len;</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  uint16_t number;</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <a class="code" href="class_nex_button.html">NexButton</a> *btn = (<a class="code" href="class_nex_button.html">NexButton</a> *)ptr;</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  dbSerialPrintln(<span class="stringliteral">"b0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  dbSerialPrintln((uint32_t)ptr); </div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="comment">/* Get the text value of button component [the value is string type]. */</span></div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  btn-><a class="code" href="class_nex_button.html#a5ba1f74aa94b41b98172e42583ee13d6">getText</a>(buffer, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  </div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  number = atoi(buffer);</div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  number += 1;</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  itoa(number, buffer, 10);</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="comment">/* Set the text value of button component [the value is string type]. */</span></div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  btn-><a class="code" href="class_nex_button.html#a649dafc5afb1dc7f1fc1bde1e6270290">setText</a>(buffer);</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> }</div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> </div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> { </div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="comment">/* Set the baudrate which is for debug and communicate with Nextion screen. */</span></div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="comment">/* Register the pop event callback function of the current button component. */</span></div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  b0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b0PopCallback, &b0);</div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  </div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>); </div>
|
||||||
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> }</div>
|
||||||
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> </div>
|
||||||
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> { </div>
|
||||||
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="comment"> * When a pop or push event occured every time,</span></div>
|
||||||
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="comment"> * the corresponding component[right page id and component id] in touch event list will be asked.</span></div>
|
||||||
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> }</div>
|
||||||
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> </div>
|
||||||
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> </div>
|
||||||
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div>
|
||||||
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div>
|
||||||
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div>
|
||||||
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div>
|
||||||
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div>
|
||||||
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div>
|
||||||
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> </div>
|
||||||
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> </div>
|
||||||
|
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span> </div>
|
||||||
|
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_button_html_a5ba1f74aa94b41b98172e42583ee13d6"><div class="ttname"><a href="class_nex_button.html#a5ba1f74aa94b41b98172e42583ee13d6">NexButton::getText</a></div><div class="ttdeci">uint16_t getText(char *buffer, uint16_t len)</div><div class="ttdoc">Get text attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_button_8cpp_source.html#l00023">NexButton.cpp:23</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_button_html"><div class="ttname"><a href="class_nex_button.html">NexButton</a></div><div class="ttdoc">NexButton component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_button_8h_source.html#l00035">NexButton.h:35</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_button_html_a649dafc5afb1dc7f1fc1bde1e6270290"><div class="ttname"><a href="class_nex_button.html#a649dafc5afb1dc7f1fc1bde1e6270290">NexButton::setText</a></div><div class="ttdeci">bool setText(const char *buffer)</div><div class="ttdoc">Set text attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_button_8cpp_source.html#l00033">NexButton.cpp:33</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_a6c6ee996e64a0a9573e0623ecba0f92.html">CompButton</a></li><li class="navelem"><b>CompButton_v0_32.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:36 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,161 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompButton_v0_32.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_button_v0_32_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompButton_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that when the button component on the Nextion screen is released, the text of this button will plus one every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"><div class="line"></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Declare a button object [page id:0,component id:1, component name: "b0"]. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="_a0"></a><a class="code" href="class_nex_button.html">NexButton</a> b0 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 1, <span class="stringliteral">"b0"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">char</span> buffer[100] = {0};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Register a button object to the touch event list. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="_a1"></a><a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> &b0,</div>
|
||||||
|
<div class="line"> NULL</div>
|
||||||
|
<div class="line">};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Button component pop callback function. </span></div>
|
||||||
|
<div class="line"><span class="comment"> * In this example,the button's text value will plus one every time when it is released. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> uint16_t len;</div>
|
||||||
|
<div class="line"> uint16_t number;</div>
|
||||||
|
<div class="line"> <a class="code" href="class_nex_button.html">NexButton</a> *btn = (<a class="code" href="class_nex_button.html">NexButton</a> *)ptr;</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"b0PopCallback"</span>);</div>
|
||||||
|
<div class="line"> dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"> dbSerialPrintln((uint32_t)ptr); </div>
|
||||||
|
<div class="line"> memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> <span class="comment">/* Get the text value of button component [the value is string type]. */</span></div>
|
||||||
|
<div class="line"> btn-><a name="a2"></a><a class="code" href="class_nex_button.html#a5ba1f74aa94b41b98172e42583ee13d6">getText</a>(buffer, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> number = atoi(buffer);</div>
|
||||||
|
<div class="line"> number += 1;</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"> itoa(number, buffer, 10);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> <span class="comment">/* Set the text value of button component [the value is string type]. */</span></div>
|
||||||
|
<div class="line"> btn-><a name="a3"></a><a class="code" href="class_nex_button.html#a649dafc5afb1dc7f1fc1bde1e6270290">setText</a>(buffer);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{ </div>
|
||||||
|
<div class="line"> <span class="comment">/* Set the baudrate which is for debug and communicate with Nextion screen. */</span></div>
|
||||||
|
<div class="line"> <a name="a4"></a><a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> <span class="comment">/* Register the pop event callback function of the current button component. */</span></div>
|
||||||
|
<div class="line"> b0.<a name="a5"></a><a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b0PopCallback, &b0);</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"setup done"</span>); </div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{ </div>
|
||||||
|
<div class="line"> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * When a pop or push event occured every time,</span></div>
|
||||||
|
<div class="line"><span class="comment"> * the corresponding component[right page id and component id] in touch event list will be asked.</span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"> <a name="a6"></a><a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
</div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Thu Jan 5 2017 17:05:51 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,84 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompCrop.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_crop_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompCrop.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that when the crop component on the Nextion screen is released, the image of this component will be changed.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"></div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:35 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,137 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompCrop/CompCrop.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_crop_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompCrop.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> * Declare a crop object [page id:0,component id:1, component name: "q0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <a class="code" href="class_nex_crop.html">NexCrop</a> q0 = <a class="code" href="class_nex_crop.html">NexCrop</a>(0, 1, <span class="stringliteral">"q0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> {</div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  &q0,</div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> };</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment"> * Crop component pop callback function. </span></div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment"> * In this example,the image of current crop component will be changed every time when it is released. </span></div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="keywordtype">void</span> q0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> {</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  uint32_t number = 0;</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  dbSerialPrintln(<span class="stringliteral">"q0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  q0.<a class="code" href="class_nex_crop.html#a2cbfe125182626965dd530f14ab55885">getPic</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  number += 1;</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  number %= 2;</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  </div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  q0.<a class="code" href="class_nex_crop.html#aac34fc2f8ead1e330918089ea8a339db">setPic</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> }</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> </div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> {</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  q0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(q0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> }</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> {</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> }</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_crop_html_a2cbfe125182626965dd530f14ab55885"><div class="ttname"><a href="class_nex_crop.html#a2cbfe125182626965dd530f14ab55885">NexCrop::getPic</a></div><div class="ttdeci">bool getPic(uint32_t *number)</div><div class="ttdoc">Get the number of picture. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_crop_8cpp_source.html#l00046">NexCrop.cpp:46</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_crop_html_aac34fc2f8ead1e330918089ea8a339db"><div class="ttname"><a href="class_nex_crop.html#aac34fc2f8ead1e330918089ea8a339db">NexCrop::setPic</a></div><div class="ttdeci">bool setPic(uint32_t number)</div><div class="ttdoc">Set the number of picture. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_crop_8cpp_source.html#l00055">NexCrop.cpp:55</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_crop_html"><div class="ttname"><a href="class_nex_crop.html">NexCrop</a></div><div class="ttdoc">NexCrop component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_crop_8h_source.html#l00030">NexCrop.h:30</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_78dd7a2fe86fb9861d4d5f2b99877d05.html">CompCrop</a></li><li class="navelem"><b>CompCrop.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 08:58:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,137 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompCrop/CompCrop_v0_32.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_crop__v0__32_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompCrop_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> * Declare a crop object [page id:0,component id:1, component name: "q0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <a class="code" href="class_nex_crop.html">NexCrop</a> q0 = <a class="code" href="class_nex_crop.html">NexCrop</a>(0, 1, <span class="stringliteral">"q0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> {</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  &q0,</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> };</div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment"> * Crop component pop callback function. </span></div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment"> * In this example,the image of current crop component will be changed every time when it is released. </span></div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="keywordtype">void</span> q0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> {</div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  uint32_t number = 0;</div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  dbSerialPrintln(<span class="stringliteral">"q0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  q0.<a class="code" href="class_nex_crop.html#a2cbfe125182626965dd530f14ab55885">getPic</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  number += 1;</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  number %= 2;</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  </div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  q0.<a class="code" href="class_nex_crop.html#aac34fc2f8ead1e330918089ea8a339db">setPic</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> }</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> {</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  q0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(q0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> }</div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> </div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> {</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> }</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_crop_html_a2cbfe125182626965dd530f14ab55885"><div class="ttname"><a href="class_nex_crop.html#a2cbfe125182626965dd530f14ab55885">NexCrop::getPic</a></div><div class="ttdeci">bool getPic(uint32_t *number)</div><div class="ttdoc">Get the number of picture. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_crop_8cpp_source.html#l00046">NexCrop.cpp:46</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_crop_html_aac34fc2f8ead1e330918089ea8a339db"><div class="ttname"><a href="class_nex_crop.html#aac34fc2f8ead1e330918089ea8a339db">NexCrop::setPic</a></div><div class="ttdeci">bool setPic(uint32_t number)</div><div class="ttdoc">Set the number of picture. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_crop_8cpp_source.html#l00055">NexCrop.cpp:55</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_crop_html"><div class="ttname"><a href="class_nex_crop.html">NexCrop</a></div><div class="ttdoc">NexCrop component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_crop_8h_source.html#l00030">NexCrop.h:30</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_78dd7a2fe86fb9861d4d5f2b99877d05.html">CompCrop</a></li><li class="navelem"><b>CompCrop_v0_32.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:36 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,127 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompCrop_v0_32.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_crop_v0_32_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompCrop_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that when the crop component on the Nextion screen is released, the image of this component will be changed.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"><div class="line"></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Declare a crop object [page id:0,component id:1, component name: "q0"]. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="_a0"></a><a class="code" href="class_nex_crop.html">NexCrop</a> q0 = <a class="code" href="class_nex_crop.html">NexCrop</a>(0, 1, <span class="stringliteral">"q0"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a1"></a><a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> &q0,</div>
|
||||||
|
<div class="line"> NULL</div>
|
||||||
|
<div class="line">};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Crop component pop callback function. </span></div>
|
||||||
|
<div class="line"><span class="comment"> * In this example,the image of current crop component will be changed every time when it is released. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> q0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> uint32_t number = 0;</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"q0PopCallback"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> q0.<a name="a2"></a><a class="code" href="class_nex_crop.html#a2cbfe125182626965dd530f14ab55885">getPic</a>(&number);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> number += 1;</div>
|
||||||
|
<div class="line"> number %= 2;</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> q0.<a name="a3"></a><a class="code" href="class_nex_crop.html#aac34fc2f8ead1e330918089ea8a339db">setPic</a>(number);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <a name="a4"></a><a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"> q0.<a name="a5"></a><a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(q0PopCallback);</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <a name="a6"></a><a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
</div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Thu Jan 5 2017 16:47:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,84 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompDualStateButton.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_dual_state_button_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompDualStateButton.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that when the dual state button component on the Nextion screen is released, the text of Text component will change one every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>huang xianming (email:<a href="#" onclick="location.href='mai'+'lto:'+'xia'+'nm'+'ing'+'.h'+'uan'+'g@'+'ite'+'ad'+'.cc'; return false;">xianm<span style="display: none;">.nosp@m.</span>ing.<span style="display: none;">.nosp@m.</span>huang<span style="display: none;">.nosp@m.</span>@ite<span style="display: none;">.nosp@m.</span>ad.cc</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/11/11 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"></div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:35 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,173 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompDualStateButton/CompDualStateButton.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_dual_state_button_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompDualStateButton.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> * Declare a dual state button object [page id:0,component id:1, component name: "bt0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <a class="code" href="class_nex_d_s_button.html">NexDSButton</a> bt0 = <a class="code" href="class_nex_d_s_button.html">NexDSButton</a>(0, 1, <span class="stringliteral">"bt0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <a class="code" href="class_nex_text.html">NexText</a> t0 = <a class="code" href="class_nex_text.html">NexText</a>(0, 2, <span class="stringliteral">"t0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="keywordtype">char</span> buffer[100] = {0};</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment"> * Register a dual state button object to the touch event list. </span></div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> {</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  &bt0,</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> };</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment"> * Dual state button component pop callback function. </span></div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment"> * In this example,the button's text value will plus one every time when it is released. </span></div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="keywordtype">void</span> bt0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> {</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  uint32_t dual_state;</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <a class="code" href="class_nex_d_s_button.html">NexDSButton</a> *btn = (<a class="code" href="class_nex_d_s_button.html">NexDSButton</a> *)ptr;</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  dbSerialPrintln(<span class="stringliteral">"b0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  dbSerialPrintln((uint32_t)ptr); </div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="comment">/* Get the state value of dual state button component . */</span></div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  bt0.<a class="code" href="class_nex_d_s_button.html#a63e08f9a79f326c47aa66e1d0f9648c8">getValue</a>(&dual_state);</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keywordflow">if</span>(dual_state) </div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  {</div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(<span class="stringliteral">"HI! OPEN STATE"</span>);</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  }</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keywordflow">else</span></div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  {</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(<span class="stringliteral">"HI! OFF STATE"</span>);</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  }</div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> }</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> { </div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="comment">/* Set the baudrate which is for debug and communicate with Nextion screen. */</span></div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> </div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="comment">/* Register the pop event callback function of the dual state button component. */</span></div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  bt0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(bt0PopCallback, &bt0);</div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  </div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>); </div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> }</div>
|
||||||
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div>
|
||||||
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> { </div>
|
||||||
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="comment"> * When a pop or push event occured every time,</span></div>
|
||||||
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="comment"> * the corresponding component[right page id and component id] in touch event list will be asked.</span></div>
|
||||||
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> }</div>
|
||||||
|
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> </div>
|
||||||
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> </div>
|
||||||
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> </div>
|
||||||
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div>
|
||||||
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div>
|
||||||
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div>
|
||||||
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div>
|
||||||
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div>
|
||||||
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div>
|
||||||
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> </div>
|
||||||
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> </div>
|
||||||
|
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html_a19589b32c981436a1bbcfe407bc766e3"><div class="ttname"><a href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">NexText::setText</a></div><div class="ttdeci">bool setText(const char *buffer)</div><div class="ttdoc">Set text attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8cpp_source.html#l00032">NexText.cpp:32</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_d_s_button_html"><div class="ttname"><a href="class_nex_d_s_button.html">NexDSButton</a></div><div class="ttdoc">NexDSButton component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_dual_state_button_8h_source.html#l00036">NexDualStateButton.h:36</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_d_s_button_html_a63e08f9a79f326c47aa66e1d0f9648c8"><div class="ttname"><a href="class_nex_d_s_button.html#a63e08f9a79f326c47aa66e1d0f9648c8">NexDSButton::getValue</a></div><div class="ttdeci">bool getValue(uint32_t *number)</div><div class="ttdoc">Get number attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_dual_state_button_8cpp_source.html#l00023">NexDualStateButton.cpp:23</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html"><div class="ttname"><a href="class_nex_text.html">NexText</a></div><div class="ttdoc">NexText component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8h_source.html#l00030">NexText.h:30</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_56b2cc69259505f347a71fbc57576a27.html">CompDualStateButton</a></li><li class="navelem"><b>CompDualStateButton.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 08:58:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,173 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompDualStateButton/CompDualStateButton_v0_32.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_dual_state_button__v0__32_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompDualStateButton_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> * Declare a dual state button object [page id:0,component id:1, component name: "bt0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <a class="code" href="class_nex_d_s_button.html">NexDSButton</a> bt0 = <a class="code" href="class_nex_d_s_button.html">NexDSButton</a>(0, 1, <span class="stringliteral">"bt0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <a class="code" href="class_nex_text.html">NexText</a> t0 = <a class="code" href="class_nex_text.html">NexText</a>(0, 2, <span class="stringliteral">"t0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="keywordtype">char</span> buffer[100] = {0};</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment"> * Register a dual state button object to the touch event list. </span></div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> {</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  &bt0,</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> };</div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment"> * Dual state button component pop callback function. </span></div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment"> * In this example,the button's text value will plus one every time when it is released. </span></div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="keywordtype">void</span> bt0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> {</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  uint32_t dual_state;</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <a class="code" href="class_nex_d_s_button.html">NexDSButton</a> *btn = (<a class="code" href="class_nex_d_s_button.html">NexDSButton</a> *)ptr;</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  dbSerialPrintln(<span class="stringliteral">"b0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  dbSerialPrintln((uint32_t)ptr); </div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="comment">/* Get the state value of dual state button component . */</span></div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  bt0.<a class="code" href="class_nex_d_s_button.html#a63e08f9a79f326c47aa66e1d0f9648c8">getValue</a>(&dual_state);</div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="keywordflow">if</span>(dual_state) </div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  {</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(<span class="stringliteral">"HI! OPEN STATE"</span>);</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  }</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keywordflow">else</span></div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  {</div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(<span class="stringliteral">"HI! OFF STATE"</span>);</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  }</div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> }</div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> { </div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="comment">/* Set the baudrate which is for debug and communicate with Nextion screen. */</span></div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> </div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <span class="comment">/* Register the pop event callback function of the dual state button component. */</span></div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  bt0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(bt0PopCallback, &bt0);</div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  </div>
|
||||||
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>); </div>
|
||||||
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> }</div>
|
||||||
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div>
|
||||||
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> { </div>
|
||||||
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="comment"> * When a pop or push event occured every time,</span></div>
|
||||||
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="comment"> * the corresponding component[right page id and component id] in touch event list will be asked.</span></div>
|
||||||
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> }</div>
|
||||||
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> </div>
|
||||||
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div>
|
||||||
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div>
|
||||||
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div>
|
||||||
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div>
|
||||||
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div>
|
||||||
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div>
|
||||||
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> </div>
|
||||||
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> </div>
|
||||||
|
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span> </div>
|
||||||
|
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div>
|
||||||
|
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html_a19589b32c981436a1bbcfe407bc766e3"><div class="ttname"><a href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">NexText::setText</a></div><div class="ttdeci">bool setText(const char *buffer)</div><div class="ttdoc">Set text attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8cpp_source.html#l00032">NexText.cpp:32</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_d_s_button_html"><div class="ttname"><a href="class_nex_d_s_button.html">NexDSButton</a></div><div class="ttdoc">NexDSButton component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_dual_state_button_8h_source.html#l00036">NexDualStateButton.h:36</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_d_s_button_html_a63e08f9a79f326c47aa66e1d0f9648c8"><div class="ttname"><a href="class_nex_d_s_button.html#a63e08f9a79f326c47aa66e1d0f9648c8">NexDSButton::getValue</a></div><div class="ttdeci">bool getValue(uint32_t *number)</div><div class="ttdoc">Get number attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_dual_state_button_8cpp_source.html#l00023">NexDualStateButton.cpp:23</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html"><div class="ttname"><a href="class_nex_text.html">NexText</a></div><div class="ttdoc">NexText component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8h_source.html#l00030">NexText.h:30</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_56b2cc69259505f347a71fbc57576a27.html">CompDualStateButton</a></li><li class="navelem"><b>CompDualStateButton_v0_32.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:36 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,162 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompDualStateButton_v0_32.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_dual_state_button_v0_32_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompDualStateButton_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that when the dual state button component on the Nextion screen is released, the text of Text component will change one every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>huang xianming (email:<a href="#" onclick="location.href='mai'+'lto:'+'xia'+'nm'+'ing'+'.h'+'uan'+'g@'+'ite'+'ad'+'.cc'; return false;">xianm<span style="display: none;">.nosp@m.</span>ing.<span style="display: none;">.nosp@m.</span>huang<span style="display: none;">.nosp@m.</span>@ite<span style="display: none;">.nosp@m.</span>ad.cc</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/11/11 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"><div class="line"></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Declare a dual state button object [page id:0,component id:1, component name: "bt0"]. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="_a0"></a><a class="code" href="class_nex_d_s_button.html">NexDSButton</a> bt0 = <a class="code" href="class_nex_d_s_button.html">NexDSButton</a>(0, 1, <span class="stringliteral">"bt0"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a1"></a><a class="code" href="class_nex_text.html">NexText</a> t0 = <a class="code" href="class_nex_text.html">NexText</a>(0, 2, <span class="stringliteral">"t0"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">char</span> buffer[100] = {0};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Register a dual state button object to the touch event list. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="_a2"></a><a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> &bt0,</div>
|
||||||
|
<div class="line"> NULL</div>
|
||||||
|
<div class="line">};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Dual state button component pop callback function. </span></div>
|
||||||
|
<div class="line"><span class="comment"> * In this example,the button's text value will plus one every time when it is released. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> bt0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> uint32_t dual_state;</div>
|
||||||
|
<div class="line"> <a class="code" href="class_nex_d_s_button.html">NexDSButton</a> *btn = (<a class="code" href="class_nex_d_s_button.html">NexDSButton</a> *)ptr;</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"b0PopCallback"</span>);</div>
|
||||||
|
<div class="line"> dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"> dbSerialPrintln((uint32_t)ptr); </div>
|
||||||
|
<div class="line"> memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> <span class="comment">/* Get the state value of dual state button component . */</span></div>
|
||||||
|
<div class="line"> bt0.<a name="a3"></a><a class="code" href="class_nex_d_s_button.html#a63e08f9a79f326c47aa66e1d0f9648c8">getValue</a>(&dual_state);</div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span>(dual_state) </div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> t0.<a name="a4"></a><a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(<span class="stringliteral">"HI! OPEN STATE"</span>);</div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line"> <span class="keywordflow">else</span></div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(<span class="stringliteral">"HI! OFF STATE"</span>);</div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{ </div>
|
||||||
|
<div class="line"> <span class="comment">/* Set the baudrate which is for debug and communicate with Nextion screen. */</span></div>
|
||||||
|
<div class="line"> <a name="a5"></a><a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> <span class="comment">/* Register the pop event callback function of the dual state button component. */</span></div>
|
||||||
|
<div class="line"> bt0.<a name="a6"></a><a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(bt0PopCallback, &bt0);</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"setup done"</span>); </div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{ </div>
|
||||||
|
<div class="line"> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * When a pop or push event occured every time,</span></div>
|
||||||
|
<div class="line"><span class="comment"> * the corresponding component[right page id and component id] in touch event list will be asked.</span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"> <a name="a7"></a><a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
</div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Thu Jan 5 2017 16:47:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,84 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompGauge.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_gauge_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompGauge.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that ,when the "btn_up" component on the Nextion screen is released, the value of gauge component will plus 5, when the "btn_down" component released, the value of gauge component will minus 5 every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"></div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:35 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,154 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompGauge/CompGauge.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_gauge_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompGauge.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <a class="code" href="class_nex_gauge.html">NexGauge</a> pointer = <a class="code" href="class_nex_gauge.html">NexGauge</a>(0, 1, <span class="stringliteral">"pointer"</span>);</div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <a class="code" href="class_nex_button.html">NexButton</a> btn_up = <a class="code" href="class_nex_button.html">NexButton</a>(0, 2, <span class="stringliteral">"btn_up"</span>);</div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <a class="code" href="class_nex_button.html">NexButton</a> btn_down = <a class="code" href="class_nex_button.html">NexButton</a>(0, 3, <span class="stringliteral">"btn_down"</span>);</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> {</div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  &btn_up,</div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  &btn_down,</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> };</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keywordtype">void</span> buttonUpPopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> {</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  uint32_t number = 0;</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  dbSerialPrintln(<span class="stringliteral">"buttonUpPopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  pointer.<a class="code" href="class_nex_gauge.html#aeea8933513ebba11584ad97f8c8b5e69">getValue</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  number += 5;</div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keywordflow">if</span> (number >= 360)</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  {</div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  number = 0;</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  }</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  </div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  pointer.<a class="code" href="class_nex_gauge.html#a448ce9ad69f54c156c325d578a96b765">setValue</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> }</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="keywordtype">void</span> buttonDownPopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> {</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  uint32_t number = 0;</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  dbSerialPrintln(<span class="stringliteral">"buttonDownPopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  pointer.<a class="code" href="class_nex_gauge.html#aeea8933513ebba11584ad97f8c8b5e69">getValue</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keywordflow">if</span> (number >= 5)</div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  {</div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  number -= 5;</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  }</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  </div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  pointer.<a class="code" href="class_nex_gauge.html#a448ce9ad69f54c156c325d578a96b765">setValue</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> }</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> </div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> {</div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  btn_up.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(buttonUpPopCallback);</div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  btn_down.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(buttonDownPopCallback);</div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> }</div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> </div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> {</div>
|
||||||
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> }</div>
|
||||||
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div>
|
||||||
|
<div class="ttc" id="class_nex_gauge_html"><div class="ttname"><a href="class_nex_gauge.html">NexGauge</a></div><div class="ttdoc">NexGauge component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gauge_8h_source.html#l00030">NexGauge.h:30</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_gauge_html_a448ce9ad69f54c156c325d578a96b765"><div class="ttname"><a href="class_nex_gauge.html#a448ce9ad69f54c156c325d578a96b765">NexGauge::setValue</a></div><div class="ttdeci">bool setValue(uint32_t number)</div><div class="ttdoc">Set the value of gauge. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gauge_8cpp_source.html#l00032">NexGauge.cpp:32</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_button_html"><div class="ttname"><a href="class_nex_button.html">NexButton</a></div><div class="ttdoc">NexButton component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_button_8h_source.html#l00035">NexButton.h:35</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_gauge_html_aeea8933513ebba11584ad97f8c8b5e69"><div class="ttname"><a href="class_nex_gauge.html#aeea8933513ebba11584ad97f8c8b5e69">NexGauge::getValue</a></div><div class="ttdeci">bool getValue(uint32_t *number)</div><div class="ttdoc">Get the value of gauge. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gauge_8cpp_source.html#l00023">NexGauge.cpp:23</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_d3f8111a063a965b5243b82006fc3654.html">CompGauge</a></li><li class="navelem"><b>CompGauge.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 08:58:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,154 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompGauge/CompGauge_v0_32.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_gauge__v0__32_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompGauge_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <a class="code" href="class_nex_gauge.html">NexGauge</a> pointer = <a class="code" href="class_nex_gauge.html">NexGauge</a>(0, 1, <span class="stringliteral">"pointer"</span>);</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <a class="code" href="class_nex_button.html">NexButton</a> btn_up = <a class="code" href="class_nex_button.html">NexButton</a>(0, 2, <span class="stringliteral">"btn_up"</span>);</div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <a class="code" href="class_nex_button.html">NexButton</a> btn_down = <a class="code" href="class_nex_button.html">NexButton</a>(0, 3, <span class="stringliteral">"btn_down"</span>);</div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> {</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  &btn_up,</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  &btn_down,</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> };</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> </div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="keywordtype">void</span> buttonUpPopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> {</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  uint32_t number = 0;</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  dbSerialPrintln(<span class="stringliteral">"buttonUpPopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  pointer.<a class="code" href="class_nex_gauge.html#aeea8933513ebba11584ad97f8c8b5e69">getValue</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  number += 5;</div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keywordflow">if</span> (number >= 360)</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  {</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  number = 0;</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  }</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  </div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  pointer.<a class="code" href="class_nex_gauge.html#a448ce9ad69f54c156c325d578a96b765">setValue</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> }</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">void</span> buttonDownPopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> {</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  uint32_t number = 0;</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  dbSerialPrintln(<span class="stringliteral">"buttonDownPopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  pointer.<a class="code" href="class_nex_gauge.html#aeea8933513ebba11584ad97f8c8b5e69">getValue</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="keywordflow">if</span> (number >= 5)</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  {</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  number -= 5;</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  }</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  </div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  pointer.<a class="code" href="class_nex_gauge.html#a448ce9ad69f54c156c325d578a96b765">setValue</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> }</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> </div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> {</div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  btn_up.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(buttonUpPopCallback);</div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  btn_down.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(buttonDownPopCallback);</div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> }</div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div>
|
||||||
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> {</div>
|
||||||
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> }</div>
|
||||||
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> </div>
|
||||||
|
<div class="ttc" id="class_nex_gauge_html"><div class="ttname"><a href="class_nex_gauge.html">NexGauge</a></div><div class="ttdoc">NexGauge component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gauge_8h_source.html#l00030">NexGauge.h:30</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_gauge_html_a448ce9ad69f54c156c325d578a96b765"><div class="ttname"><a href="class_nex_gauge.html#a448ce9ad69f54c156c325d578a96b765">NexGauge::setValue</a></div><div class="ttdeci">bool setValue(uint32_t number)</div><div class="ttdoc">Set the value of gauge. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gauge_8cpp_source.html#l00032">NexGauge.cpp:32</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_button_html"><div class="ttname"><a href="class_nex_button.html">NexButton</a></div><div class="ttdoc">NexButton component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_button_8h_source.html#l00035">NexButton.h:35</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_gauge_html_aeea8933513ebba11584ad97f8c8b5e69"><div class="ttname"><a href="class_nex_gauge.html#aeea8933513ebba11584ad97f8c8b5e69">NexGauge::getValue</a></div><div class="ttdeci">bool getValue(uint32_t *number)</div><div class="ttdoc">Get the value of gauge. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gauge_8cpp_source.html#l00023">NexGauge.cpp:23</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_d3f8111a063a965b5243b82006fc3654.html">CompGauge</a></li><li class="navelem"><b>CompGauge_v0_32.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:36 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,143 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompGauge_v0_32.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_gauge_v0_32_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompGauge_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that ,when the "btn_up" component on the Nextion screen is released, the value of gauge component will plus 5, when the "btn_down" component released, the value of gauge component will minus 5 every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"><div class="line"></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a0"></a><a class="code" href="class_nex_gauge.html">NexGauge</a> pointer = <a class="code" href="class_nex_gauge.html">NexGauge</a>(0, 1, <span class="stringliteral">"pointer"</span>);</div>
|
||||||
|
<div class="line"><a name="_a1"></a><a class="code" href="class_nex_button.html">NexButton</a> btn_up = <a class="code" href="class_nex_button.html">NexButton</a>(0, 2, <span class="stringliteral">"btn_up"</span>);</div>
|
||||||
|
<div class="line"><a class="code" href="class_nex_button.html">NexButton</a> btn_down = <a class="code" href="class_nex_button.html">NexButton</a>(0, 3, <span class="stringliteral">"btn_down"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a2"></a><a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> &btn_up,</div>
|
||||||
|
<div class="line"> &btn_down,</div>
|
||||||
|
<div class="line"> NULL</div>
|
||||||
|
<div class="line">};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> buttonUpPopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> uint32_t number = 0;</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"buttonUpPopCallback"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> pointer.<a name="a3"></a><a class="code" href="class_nex_gauge.html#aeea8933513ebba11584ad97f8c8b5e69">getValue</a>(&number);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> number += 5;</div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span> (number >= 360)</div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> number = 0;</div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> pointer.<a name="a4"></a><a class="code" href="class_nex_gauge.html#a448ce9ad69f54c156c325d578a96b765">setValue</a>(number);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> buttonDownPopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> uint32_t number = 0;</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"buttonDownPopCallback"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> pointer.<a class="code" href="class_nex_gauge.html#aeea8933513ebba11584ad97f8c8b5e69">getValue</a>(&number);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span> (number >= 5)</div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> number -= 5;</div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> pointer.<a class="code" href="class_nex_gauge.html#a448ce9ad69f54c156c325d578a96b765">setValue</a>(number);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <a name="a5"></a><a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"> btn_up.<a name="a6"></a><a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(buttonUpPopCallback);</div>
|
||||||
|
<div class="line"> btn_down.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(buttonDownPopCallback);</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <a name="a7"></a><a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
</div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Thu Jan 5 2017 16:47:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,143 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompGpio/CompGpio/CompGpio.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_gpio_2_comp_gpio_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompGpio.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> </div>
|
||||||
|
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <a class="code" href="class_nex_gpio.html">NexGpio</a> gpio;</div>
|
||||||
|
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <a class="code" href="class_nex_number.html">NexNumber</a> n0 = <a class="code" href="class_nex_number.html">NexNumber</a>(0,1,<span class="stringliteral">"n0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <a class="code" href="class_nex_number.html">NexNumber</a> n1 = <a class="code" href="class_nex_number.html">NexNumber</a>(0,3,<span class="stringliteral">"n1"</span>);</div>
|
||||||
|
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> </div>
|
||||||
|
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#define GPIO_PUSH_PORT 1</span></div>
|
||||||
|
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#define GPIO_PWM_PORT 2</span></div>
|
||||||
|
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor">#define GPIO_PUSH_OUTPUT_MODE 2</span></div>
|
||||||
|
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#define GPIO_PWM_OUT_MODE 3</span></div>
|
||||||
|
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#define CONTROLS_ID 0 //when the modeel is 1 to be valid</span></div>
|
||||||
|
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span> </div>
|
||||||
|
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span> uint32_t pwm_value = 0;</div>
|
||||||
|
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div>
|
||||||
|
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="keywordtype">void</span> setup() </div>
|
||||||
|
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span> { </div>
|
||||||
|
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>  <a class="code" href="group___configuration.html#ga2738b05a77cd5052e440af5b00b0ecbd">nexSerial</a>.begin(115200);</div>
|
||||||
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  gpio.<a class="code" href="class_nex_gpio.html#adbe08eb11827d75c6b2e9c935d9da19a">pin_mode</a>(GPIO_PUSH_PORT,GPIO_PUSH_OUTPUT_MODE,CONTROLS_ID);</div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  gpio.<a class="code" href="class_nex_gpio.html#adbe08eb11827d75c6b2e9c935d9da19a">pin_mode</a>(GPIO_PWM_PORT,GPIO_PWM_OUT_MODE,CONTROLS_ID);</div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> }</div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="keywordtype">void</span> loop() </div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> {</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  <span class="keywordflow">if</span>(gpio.<a class="code" href="class_nex_gpio.html#a36386b97898f0960abda51c6010378eb">digital_read</a>(1) == 0)</div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  {</div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  gpio.<a class="code" href="class_nex_gpio.html#aaea4cb428fa0a2e26927073c20ed64ac">digital_write</a>(GPIO_PUSH_PORT,HIGH);</div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  n0.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(1);</div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  }</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <span class="keywordflow">else</span></div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  {</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  gpio.<a class="code" href="class_nex_gpio.html#aaea4cb428fa0a2e26927073c20ed64ac">digital_write</a>(GPIO_PUSH_PORT,LOW);</div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  n0.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(0);</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  }</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  </div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  gpio.<a class="code" href="class_nex_gpio.html#af21eb91b041d149193bc716202d4a462">analog_write</a>(GPIO_PWM_PORT,pwm_value);</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  n1.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(pwm_value);</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <span class="keywordflow">if</span>(pwm_value == 100)</div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  {</div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  pwm_value = 0;</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  }</div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keywordflow">else</span></div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  {</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  pwm_value += 20;</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  }</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> </div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  delay(1000);</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> }</div>
|
||||||
|
<div class="ttc" id="class_nex_number_html"><div class="ttname"><a href="class_nex_number.html">NexNumber</a></div><div class="ttdoc">NexNumber component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_number_8h_source.html#l00030">NexNumber.h:30</a></div></div>
|
||||||
|
<div class="ttc" id="group___configuration_html_ga2738b05a77cd5052e440af5b00b0ecbd"><div class="ttname"><a href="group___configuration.html#ga2738b05a77cd5052e440af5b00b0ecbd">nexSerial</a></div><div class="ttdeci">#define nexSerial</div><div class="ttdoc">Define nexSerial for communicate with Nextion touch panel. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_config_8h_source.html#l00037">NexConfig.h:37</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_gpio_html_aaea4cb428fa0a2e26927073c20ed64ac"><div class="ttname"><a href="class_nex_gpio.html#aaea4cb428fa0a2e26927073c20ed64ac">NexGpio::digital_write</a></div><div class="ttdeci">bool digital_write(uint32_t port, uint32_t value)</div><div class="ttdoc">write a HIGH or a LOW value to a digital pin </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gpio_8cpp_source.html#l00037">NexGpio.cpp:37</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_gpio_html_adbe08eb11827d75c6b2e9c935d9da19a"><div class="ttname"><a href="class_nex_gpio.html#adbe08eb11827d75c6b2e9c935d9da19a">NexGpio::pin_mode</a></div><div class="ttdeci">bool pin_mode(uint32_t port, uint32_t mode, uint32_t control_id)</div><div class="ttdoc">Set gpio mode. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gpio_8cpp_source.html#l00017">NexGpio.cpp:17</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_gpio_html"><div class="ttname"><a href="class_nex_gpio.html">NexGpio</a></div><div class="ttdoc">NexGpio component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gpio_8h_source.html#l00031">NexGpio.h:31</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_number_html_a9cef51f6b76b4ba03a31b2427ffd4526"><div class="ttname"><a href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">NexNumber::setValue</a></div><div class="ttdeci">bool setValue(uint32_t number)</div><div class="ttdoc">Set number attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_number_8cpp_source.html#l00031">NexNumber.cpp:31</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_gpio_html_af21eb91b041d149193bc716202d4a462"><div class="ttname"><a href="class_nex_gpio.html#af21eb91b041d149193bc716202d4a462">NexGpio::analog_write</a></div><div class="ttdeci">bool analog_write(uint32_t port, uint32_t value)</div><div class="ttdoc">writes an analog value (PWM wave) to a pin </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gpio_8cpp_source.html#l00068">NexGpio.cpp:68</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_gpio_html_a36386b97898f0960abda51c6010378eb"><div class="ttname"><a href="class_nex_gpio.html#a36386b97898f0960abda51c6010378eb">NexGpio::digital_read</a></div><div class="ttdeci">uint32_t digital_read(uint32_t port)</div><div class="ttdoc">read a HIGH or a LOW value to a digital pin </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gpio_8cpp_source.html#l00053">NexGpio.cpp:53</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_67a124841349777013960f48b4ca08cd.html">CompGpio</a></li><li class="navelem"><a class="el" href="dir_a239a53bd1465befb8d39895b56e9769.html">CompGpio</a></li><li class="navelem"><b>CompGpio.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 08:58:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,133 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompGpio.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_gpio_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompGpio.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that In nextion screen displays the current IO mouth level change, to show how to use the API.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>huangxiaoming (email:<a href="#" onclick="location.href='mai'+'lto:'+'xia'+'om'+'ing'+'.h'+'uan'+'g@'+'ite'+'ad'+'.cc'; return false;">xiaom<span style="display: none;">.nosp@m.</span>ing.<span style="display: none;">.nosp@m.</span>huang<span style="display: none;">.nosp@m.</span>@ite<span style="display: none;">.nosp@m.</span>ad.cc</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2016/12/8 </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"><div class="line"></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a0"></a><a class="code" href="class_nex_gpio.html">NexGpio</a> gpio;</div>
|
||||||
|
<div class="line"><a name="_a1"></a><a class="code" href="class_nex_number.html">NexNumber</a> n0 = <a class="code" href="class_nex_number.html">NexNumber</a>(0,1,<span class="stringliteral">"n0"</span>);</div>
|
||||||
|
<div class="line"><a class="code" href="class_nex_number.html">NexNumber</a> n1 = <a class="code" href="class_nex_number.html">NexNumber</a>(0,3,<span class="stringliteral">"n1"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="preprocessor">#define GPIO_PUSH_PORT 1</span></div>
|
||||||
|
<div class="line"><span class="preprocessor">#define GPIO_PWM_PORT 2</span></div>
|
||||||
|
<div class="line"><span class="preprocessor">#define GPIO_PUSH_OUTPUT_MODE 2</span></div>
|
||||||
|
<div class="line"><span class="preprocessor">#define GPIO_PWM_OUT_MODE 3</span></div>
|
||||||
|
<div class="line"><span class="preprocessor">#define CONTROLS_ID 0 //when the modeel is 1 to be valid</span></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line">uint32_t pwm_value = 0;</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> setup() </div>
|
||||||
|
<div class="line">{ </div>
|
||||||
|
<div class="line"> <a name="a2"></a><a class="code" href="group___configuration.html#ga2738b05a77cd5052e440af5b00b0ecbd">nexSerial</a>.begin(115200);</div>
|
||||||
|
<div class="line"> gpio.<a name="a3"></a><a class="code" href="class_nex_gpio.html#adbe08eb11827d75c6b2e9c935d9da19a">pin_mode</a>(GPIO_PUSH_PORT,GPIO_PUSH_OUTPUT_MODE,CONTROLS_ID);</div>
|
||||||
|
<div class="line"> gpio.<a class="code" href="class_nex_gpio.html#adbe08eb11827d75c6b2e9c935d9da19a">pin_mode</a>(GPIO_PWM_PORT,GPIO_PWM_OUT_MODE,CONTROLS_ID);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> loop() </div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span>(gpio.<a name="a4"></a><a class="code" href="class_nex_gpio.html#a36386b97898f0960abda51c6010378eb">digital_read</a>(1) == 0)</div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> gpio.<a name="a5"></a><a class="code" href="class_nex_gpio.html#aaea4cb428fa0a2e26927073c20ed64ac">digital_write</a>(GPIO_PUSH_PORT,HIGH);</div>
|
||||||
|
<div class="line"> n0.<a name="a6"></a><a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(1);</div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line"> <span class="keywordflow">else</span></div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> gpio.<a class="code" href="class_nex_gpio.html#aaea4cb428fa0a2e26927073c20ed64ac">digital_write</a>(GPIO_PUSH_PORT,LOW);</div>
|
||||||
|
<div class="line"> n0.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(0);</div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> gpio.<a name="a7"></a><a class="code" href="class_nex_gpio.html#af21eb91b041d149193bc716202d4a462">analog_write</a>(GPIO_PWM_PORT,pwm_value);</div>
|
||||||
|
<div class="line"> n1.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(pwm_value);</div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span>(pwm_value == 100)</div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> pwm_value = 0;</div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line"> <span class="keywordflow">else</span></div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> pwm_value += 20;</div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> delay(1000);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
</div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:35 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,144 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompGpio/CompGpio.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_gpio_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompGpio.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <a class="code" href="class_nex_gpio.html">NexGpio</a> gpio;</div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <a class="code" href="class_nex_number.html">NexNumber</a> n0 = <a class="code" href="class_nex_number.html">NexNumber</a>(0,1,<span class="stringliteral">"n0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <a class="code" href="class_nex_number.html">NexNumber</a> n1 = <a class="code" href="class_nex_number.html">NexNumber</a>(0,3,<span class="stringliteral">"n1"</span>);</div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#define GPIO_PUSH_PORT 1</span></div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#define GPIO_PWM_PORT 2</span></div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#define GPIO_PUSH_OUTPUT_MODE 2</span></div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#define GPIO_PWM_OUT_MODE 3</span></div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#define CONTROLS_ID 0 //when the modeel is 1 to be valid</span></div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> uint32_t pwm_value = 0;</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keywordtype">void</span> setup() </div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> { </div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <a class="code" href="group___configuration.html#ga2738b05a77cd5052e440af5b00b0ecbd">nexSerial</a>.begin(115200);</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  gpio.<a class="code" href="class_nex_gpio.html#adbe08eb11827d75c6b2e9c935d9da19a">pin_mode</a>(GPIO_PUSH_PORT,GPIO_PUSH_OUTPUT_MODE,CONTROLS_ID);</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  gpio.<a class="code" href="class_nex_gpio.html#adbe08eb11827d75c6b2e9c935d9da19a">pin_mode</a>(GPIO_PWM_PORT,GPIO_PWM_OUT_MODE,CONTROLS_ID);</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> }</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="keywordtype">void</span> loop() </div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> {</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <span class="keywordflow">if</span>(gpio.<a class="code" href="class_nex_gpio.html#a36386b97898f0960abda51c6010378eb">digital_read</a>(1) == 0)</div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  {</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  gpio.<a class="code" href="class_nex_gpio.html#aaea4cb428fa0a2e26927073c20ed64ac">digital_write</a>(GPIO_PUSH_PORT,HIGH);</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  n0.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(1);</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  }</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keywordflow">else</span></div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  {</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  gpio.<a class="code" href="class_nex_gpio.html#aaea4cb428fa0a2e26927073c20ed64ac">digital_write</a>(GPIO_PUSH_PORT,LOW);</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  n0.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(0);</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  }</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  </div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  gpio.<a class="code" href="class_nex_gpio.html#af21eb91b041d149193bc716202d4a462">analog_write</a>(GPIO_PWM_PORT,pwm_value);</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  n1.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(pwm_value);</div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keywordflow">if</span>(pwm_value == 100)</div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  {</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  pwm_value = 0;</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  }</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keywordflow">else</span></div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  {</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  pwm_value += 20;</div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  }</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  delay(1000);</div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> }</div>
|
||||||
|
<div class="ttc" id="class_nex_number_html"><div class="ttname"><a href="class_nex_number.html">NexNumber</a></div><div class="ttdoc">NexNumber component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_number_8h_source.html#l00030">NexNumber.h:30</a></div></div>
|
||||||
|
<div class="ttc" id="group___configuration_html_ga2738b05a77cd5052e440af5b00b0ecbd"><div class="ttname"><a href="group___configuration.html#ga2738b05a77cd5052e440af5b00b0ecbd">nexSerial</a></div><div class="ttdeci">#define nexSerial</div><div class="ttdoc">Define nexSerial for communicate with Nextion touch panel. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_config_8h_source.html#l00037">NexConfig.h:37</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_gpio_html_aaea4cb428fa0a2e26927073c20ed64ac"><div class="ttname"><a href="class_nex_gpio.html#aaea4cb428fa0a2e26927073c20ed64ac">NexGpio::digital_write</a></div><div class="ttdeci">bool digital_write(uint32_t port, uint32_t value)</div><div class="ttdoc">write a HIGH or a LOW value to a digital pin </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gpio_8cpp_source.html#l00037">NexGpio.cpp:37</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_gpio_html_adbe08eb11827d75c6b2e9c935d9da19a"><div class="ttname"><a href="class_nex_gpio.html#adbe08eb11827d75c6b2e9c935d9da19a">NexGpio::pin_mode</a></div><div class="ttdeci">bool pin_mode(uint32_t port, uint32_t mode, uint32_t control_id)</div><div class="ttdoc">Set gpio mode. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gpio_8cpp_source.html#l00017">NexGpio.cpp:17</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_gpio_html"><div class="ttname"><a href="class_nex_gpio.html">NexGpio</a></div><div class="ttdoc">NexGpio component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gpio_8h_source.html#l00031">NexGpio.h:31</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_number_html_a9cef51f6b76b4ba03a31b2427ffd4526"><div class="ttname"><a href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">NexNumber::setValue</a></div><div class="ttdeci">bool setValue(uint32_t number)</div><div class="ttdoc">Set number attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_number_8cpp_source.html#l00031">NexNumber.cpp:31</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_gpio_html_af21eb91b041d149193bc716202d4a462"><div class="ttname"><a href="class_nex_gpio.html#af21eb91b041d149193bc716202d4a462">NexGpio::analog_write</a></div><div class="ttdeci">bool analog_write(uint32_t port, uint32_t value)</div><div class="ttdoc">writes an analog value (PWM wave) to a pin </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gpio_8cpp_source.html#l00068">NexGpio.cpp:68</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_gpio_html_a36386b97898f0960abda51c6010378eb"><div class="ttname"><a href="class_nex_gpio.html#a36386b97898f0960abda51c6010378eb">NexGpio::digital_read</a></div><div class="ttdeci">uint32_t digital_read(uint32_t port)</div><div class="ttdoc">read a HIGH or a LOW value to a digital pin </div><div class="ttdef"><b>Definition:</b> <a href="_nex_gpio_8cpp_source.html#l00053">NexGpio.cpp:53</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_67a124841349777013960f48b4ca08cd.html">CompGpio</a></li><li class="navelem"><b>CompGpio.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:36 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,84 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompHotspot.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_hotspot_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompHotspot.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that ,when the hot component on the Nextion screen is pressed or released, the debug serial will output the debug information every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"></div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:35 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,148 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompHotspot/CompHotspot.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_hotspot_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompHotspot.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <a class="code" href="class_nex_hotspot.html">NexHotspot</a> hot0 = <a class="code" href="class_nex_hotspot.html">NexHotspot</a>(0, 1, <span class="stringliteral">"hot0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <a class="code" href="class_nex_hotspot.html">NexHotspot</a> hot1 = <a class="code" href="class_nex_hotspot.html">NexHotspot</a>(0, 2, <span class="stringliteral">"hot1"</span>);</div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> {</div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  &hot0,</div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  &hot1,</div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> };</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="keywordtype">void</span> hot0PushCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> {</div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  dbSerialPrintln(<span class="stringliteral">"hot0PushCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  dbSerialPrintln((uint32_t)ptr);</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> }</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="keywordtype">void</span> hot1PushCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> {</div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  dbSerialPrintln(<span class="stringliteral">"hot1PushCallback"</span>); </div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  dbSerialPrintln((uint32_t)ptr);</div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> }</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="keywordtype">void</span> hot0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> {</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  dbSerialPrintln(<span class="stringliteral">"hot0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  dbSerialPrintln((uint32_t)ptr);</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> }</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> </div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="keywordtype">void</span> hot1PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> {</div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  dbSerialPrintln(<span class="stringliteral">"hot1PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  dbSerialPrintln((uint32_t)ptr);</div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> }</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> {</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  hot0.<a class="code" href="class_nex_touch.html#a685a753aae5eb9fb9866a7807a310132">attachPush</a>(hot0PushCallback, &hot0);</div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  hot0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(hot0PopCallback, &hot0);</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  hot1.<a class="code" href="class_nex_touch.html#a685a753aae5eb9fb9866a7807a310132">attachPush</a>(hot1PushCallback, &hot1);</div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  hot1.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(hot1PopCallback, &hot1);</div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> }</div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> {</div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> }</div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_hotspot_html"><div class="ttname"><a href="class_nex_hotspot.html">NexHotspot</a></div><div class="ttdoc">NexHotspot component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hotspot_8h_source.html#l00030">NexHotspot.h:30</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a685a753aae5eb9fb9866a7807a310132"><div class="ttname"><a href="class_nex_touch.html#a685a753aae5eb9fb9866a7807a310132">NexTouch::attachPush</a></div><div class="ttdeci">void attachPush(NexTouchEventCb push, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of push touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00027">NexTouch.cpp:27</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_44a14d16127103fb968497cef18e2651.html">CompHotspot</a></li><li class="navelem"><b>CompHotspot.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 08:58:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,148 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompHotspot/CompHotspot_v0_32.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_hotspot__v0__32_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompHotspot_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <a class="code" href="class_nex_hotspot.html">NexHotspot</a> hot0 = <a class="code" href="class_nex_hotspot.html">NexHotspot</a>(0, 1, <span class="stringliteral">"hot0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <a class="code" href="class_nex_hotspot.html">NexHotspot</a> hot1 = <a class="code" href="class_nex_hotspot.html">NexHotspot</a>(0, 2, <span class="stringliteral">"hot1"</span>);</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> {</div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  &hot0,</div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  &hot1,</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> };</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keywordtype">void</span> hot0PushCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> {</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  dbSerialPrintln(<span class="stringliteral">"hot0PushCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  dbSerialPrintln((uint32_t)ptr);</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> }</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="keywordtype">void</span> hot1PushCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> {</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  dbSerialPrintln(<span class="stringliteral">"hot1PushCallback"</span>); </div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  dbSerialPrintln((uint32_t)ptr);</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> }</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> </div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="keywordtype">void</span> hot0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> {</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  dbSerialPrintln(<span class="stringliteral">"hot0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  dbSerialPrintln((uint32_t)ptr);</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> }</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="keywordtype">void</span> hot1PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> {</div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  dbSerialPrintln(<span class="stringliteral">"hot1PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  dbSerialPrintln((uint32_t)ptr);</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> }</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> </div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> {</div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  hot0.<a class="code" href="class_nex_touch.html#a685a753aae5eb9fb9866a7807a310132">attachPush</a>(hot0PushCallback, &hot0);</div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  hot0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(hot0PopCallback, &hot0);</div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  hot1.<a class="code" href="class_nex_touch.html#a685a753aae5eb9fb9866a7807a310132">attachPush</a>(hot1PushCallback, &hot1);</div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  hot1.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(hot1PopCallback, &hot1);</div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> }</div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> {</div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> }</div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_hotspot_html"><div class="ttname"><a href="class_nex_hotspot.html">NexHotspot</a></div><div class="ttdoc">NexHotspot component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hotspot_8h_source.html#l00030">NexHotspot.h:30</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a685a753aae5eb9fb9866a7807a310132"><div class="ttname"><a href="class_nex_touch.html#a685a753aae5eb9fb9866a7807a310132">NexTouch::attachPush</a></div><div class="ttdeci">void attachPush(NexTouchEventCb push, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of push touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00027">NexTouch.cpp:27</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_44a14d16127103fb968497cef18e2651.html">CompHotspot</a></li><li class="navelem"><b>CompHotspot_v0_32.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:36 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,139 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompHotspot_v0_32.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_hotspot_v0_32_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompHotspot_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that ,when the hot component on the Nextion screen is pressed or released, the debug serial will output the debug information every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"><div class="line"></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a0"></a><a class="code" href="class_nex_hotspot.html">NexHotspot</a> hot0 = <a class="code" href="class_nex_hotspot.html">NexHotspot</a>(0, 1, <span class="stringliteral">"hot0"</span>);</div>
|
||||||
|
<div class="line"><a class="code" href="class_nex_hotspot.html">NexHotspot</a> hot1 = <a class="code" href="class_nex_hotspot.html">NexHotspot</a>(0, 2, <span class="stringliteral">"hot1"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a1"></a><a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> &hot0,</div>
|
||||||
|
<div class="line"> &hot1,</div>
|
||||||
|
<div class="line"> NULL</div>
|
||||||
|
<div class="line">};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> hot0PushCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"hot0PushCallback"</span>);</div>
|
||||||
|
<div class="line"> dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"> dbSerialPrintln((uint32_t)ptr);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> hot1PushCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"hot1PushCallback"</span>); </div>
|
||||||
|
<div class="line"> dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"> dbSerialPrintln((uint32_t)ptr);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> hot0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"hot0PopCallback"</span>);</div>
|
||||||
|
<div class="line"> dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"> dbSerialPrintln((uint32_t)ptr);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> hot1PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"hot1PopCallback"</span>);</div>
|
||||||
|
<div class="line"> dbSerialPrint(<span class="stringliteral">"ptr="</span>);</div>
|
||||||
|
<div class="line"> dbSerialPrintln((uint32_t)ptr);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <a name="a2"></a><a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"> hot0.<a name="a3"></a><a class="code" href="class_nex_touch.html#a685a753aae5eb9fb9866a7807a310132">attachPush</a>(hot0PushCallback, &hot0);</div>
|
||||||
|
<div class="line"> hot0.<a name="a4"></a><a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(hot0PopCallback, &hot0);</div>
|
||||||
|
<div class="line"> hot1.<a class="code" href="class_nex_touch.html#a685a753aae5eb9fb9866a7807a310132">attachPush</a>(hot1PushCallback, &hot1);</div>
|
||||||
|
<div class="line"> hot1.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(hot1PopCallback, &hot1);</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <a name="a5"></a><a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
</div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Thu Jan 5 2017 16:47:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,84 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompNumber.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_number_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompNumber.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that ,when the "+" component on the Nextion screen is released, the value of number component will plus 1,when the "-" component released ,the value of number component will minus 1 every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>huang xianming (email:<a href="#" onclick="location.href='mai'+'lto:'+'xia'+'nm'+'ing'+'.h'+'uan'+'g@'+'ite'+'ad'+'.cc'; return false;">xianm<span style="display: none;">.nosp@m.</span>ing.<span style="display: none;">.nosp@m.</span>huang<span style="display: none;">.nosp@m.</span>@ite<span style="display: none;">.nosp@m.</span>ad.cc</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/11/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"></div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:35 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,200 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompNumber/CompNumber.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_number_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompNumber.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="keywordtype">void</span> n0PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="keywordtype">void</span> b1PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="comment"> * Declare a number object [page id:0,component id:3, component name: "n0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <a class="code" href="class_nex_number.html">NexNumber</a> n0 = <a class="code" href="class_nex_number.html">NexNumber</a>(0, 3, <span class="stringliteral">"n0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment"> * Declare a button object [page id:0,component id:1, component name: "b0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <a class="code" href="class_nex_button.html">NexButton</a> b0 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 1, <span class="stringliteral">"b0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment"> * Declare a button object [page id:0,component id:2, component name: "b1"]. </span></div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <a class="code" href="class_nex_button.html">NexButton</a> b1 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 2, <span class="stringliteral">"b1"</span>);</div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="keywordtype">char</span> buffer[100] = {0};</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment"> * Register object n0, b0, b1, to the touch event list. </span></div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> {</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  &n0,</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  &b0,</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  &b1,</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> };</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="comment"> * number component pop callback function. </span></div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="keywordtype">void</span> n0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> {</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  dbSerialPrintln(<span class="stringliteral">"n0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  n0.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(50);</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> }</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="comment"> * Button0 component pop callback function.</span></div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="comment"> * In this example,the value of the number component will plus one every time when button0 is released.</span></div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> {</div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  uint32_t number;</div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  </div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  dbSerialPrintln(<span class="stringliteral">"b0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> </div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  n0.<a class="code" href="class_nex_number.html#ad184ed818666ec482efddf840185c7b8">getValue</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  </div>
|
||||||
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  number += 1;</div>
|
||||||
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  </div>
|
||||||
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  n0.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> }</div>
|
||||||
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> </div>
|
||||||
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="comment"> * Button1 component pop callback function.</span></div>
|
||||||
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="comment"> * In this example,the value of the number component will minus one every time when button1 is released.</span></div>
|
||||||
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="keywordtype">void</span> b1PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> {</div>
|
||||||
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  uint32_t number;</div>
|
||||||
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  </div>
|
||||||
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  dbSerialPrintln(<span class="stringliteral">"b1PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div>
|
||||||
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  n0.<a class="code" href="class_nex_number.html#ad184ed818666ec482efddf840185c7b8">getValue</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  </div>
|
||||||
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  number -= 1;</div>
|
||||||
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  </div>
|
||||||
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  n0.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span> }</div>
|
||||||
|
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div>
|
||||||
|
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> {</div>
|
||||||
|
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="comment">/* Set the baudrate which is for debug and communicate with Nextion screen. */</span></div>
|
||||||
|
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span> </div>
|
||||||
|
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="comment">/* Register the pop event callback function of the current number component. */</span></div>
|
||||||
|
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  n0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(n0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span> </div>
|
||||||
|
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="comment">/* Register the pop event callback function of the current button0 component. */</span></div>
|
||||||
|
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  b0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span> </div>
|
||||||
|
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="comment">/* Register the pop event callback function of the current button1 component. */</span></div>
|
||||||
|
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  b1.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b1PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div>
|
||||||
|
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span> }</div>
|
||||||
|
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span> </div>
|
||||||
|
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> {</div>
|
||||||
|
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="comment"> * When a pop or push event occured every time, </span></div>
|
||||||
|
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="comment"> * the corresponding component[right page id and component id] in touch event list will be asked.</span></div>
|
||||||
|
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> }</div>
|
||||||
|
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span> </div>
|
||||||
|
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span> </div>
|
||||||
|
<div class="ttc" id="class_nex_number_html"><div class="ttname"><a href="class_nex_number.html">NexNumber</a></div><div class="ttdoc">NexNumber component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_number_8h_source.html#l00030">NexNumber.h:30</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_button_html"><div class="ttname"><a href="class_nex_button.html">NexButton</a></div><div class="ttdoc">NexButton component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_button_8h_source.html#l00035">NexButton.h:35</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_number_html_a9cef51f6b76b4ba03a31b2427ffd4526"><div class="ttname"><a href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">NexNumber::setValue</a></div><div class="ttdeci">bool setValue(uint32_t number)</div><div class="ttdoc">Set number attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_number_8cpp_source.html#l00031">NexNumber.cpp:31</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_number_html_ad184ed818666ec482efddf840185c7b8"><div class="ttname"><a href="class_nex_number.html#ad184ed818666ec482efddf840185c7b8">NexNumber::getValue</a></div><div class="ttdeci">bool getValue(uint32_t *number)</div><div class="ttdoc">Get number attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_number_8cpp_source.html#l00022">NexNumber.cpp:22</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_a121929b9544fab6b74c5c8052ef2940.html">CompNumber</a></li><li class="navelem"><b>CompNumber.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 08:58:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,200 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompNumber/CompNumber_v0_32.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_number__v0__32_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompNumber_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="keywordtype">void</span> n0PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="keywordtype">void</span> b1PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment"> * Declare a number object [page id:0,component id:3, component name: "n0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <a class="code" href="class_nex_number.html">NexNumber</a> n0 = <a class="code" href="class_nex_number.html">NexNumber</a>(0, 3, <span class="stringliteral">"n0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment"> * Declare a button object [page id:0,component id:1, component name: "b0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <a class="code" href="class_nex_button.html">NexButton</a> b0 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 1, <span class="stringliteral">"b0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment"> * Declare a button object [page id:0,component id:2, component name: "b1"]. </span></div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <a class="code" href="class_nex_button.html">NexButton</a> b1 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 2, <span class="stringliteral">"b1"</span>);</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="keywordtype">char</span> buffer[100] = {0};</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="comment"> * Register object n0, b0, b1, to the touch event list. </span></div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> {</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  &n0,</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  &b0,</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  &b1,</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> };</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="comment"> * number component pop callback function. </span></div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="keywordtype">void</span> n0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> {</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  dbSerialPrintln(<span class="stringliteral">"n0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  n0.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(50);</div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> }</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment"> * Button0 component pop callback function.</span></div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="comment"> * In this example,the value of the number component will plus one every time when button0 is released.</span></div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> {</div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  uint32_t number;</div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  </div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  dbSerialPrintln(<span class="stringliteral">"b0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div>
|
||||||
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  n0.<a class="code" href="class_nex_number.html#ad184ed818666ec482efddf840185c7b8">getValue</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  </div>
|
||||||
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  number += 1;</div>
|
||||||
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  </div>
|
||||||
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  n0.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> }</div>
|
||||||
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div>
|
||||||
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="comment"> * Button1 component pop callback function.</span></div>
|
||||||
|
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="comment"> * In this example,the value of the number component will minus one every time when button1 is released.</span></div>
|
||||||
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="keywordtype">void</span> b1PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> {</div>
|
||||||
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  uint32_t number;</div>
|
||||||
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  </div>
|
||||||
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  dbSerialPrintln(<span class="stringliteral">"b1PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div>
|
||||||
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  n0.<a class="code" href="class_nex_number.html#ad184ed818666ec482efddf840185c7b8">getValue</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  </div>
|
||||||
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  number -= 1;</div>
|
||||||
|
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  </div>
|
||||||
|
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  n0.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span> }</div>
|
||||||
|
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> </div>
|
||||||
|
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span> {</div>
|
||||||
|
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="comment">/* Set the baudrate which is for debug and communicate with Nextion screen. */</span></div>
|
||||||
|
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span> </div>
|
||||||
|
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="comment">/* Register the pop event callback function of the current number component. */</span></div>
|
||||||
|
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  n0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(n0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span> </div>
|
||||||
|
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="comment">/* Register the pop event callback function of the current button0 component. */</span></div>
|
||||||
|
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  b0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span> </div>
|
||||||
|
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="comment">/* Register the pop event callback function of the current button1 component. */</span></div>
|
||||||
|
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  b1.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b1PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span> </div>
|
||||||
|
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span> }</div>
|
||||||
|
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> </div>
|
||||||
|
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span> {</div>
|
||||||
|
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="comment"> * When a pop or push event occured every time, </span></div>
|
||||||
|
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span> <span class="comment"> * the corresponding component[right page id and component id] in touch event list will be asked.</span></div>
|
||||||
|
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span> }</div>
|
||||||
|
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> </div>
|
||||||
|
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span> </div>
|
||||||
|
<div class="ttc" id="class_nex_number_html"><div class="ttname"><a href="class_nex_number.html">NexNumber</a></div><div class="ttdoc">NexNumber component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_number_8h_source.html#l00030">NexNumber.h:30</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_button_html"><div class="ttname"><a href="class_nex_button.html">NexButton</a></div><div class="ttdoc">NexButton component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_button_8h_source.html#l00035">NexButton.h:35</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_number_html_a9cef51f6b76b4ba03a31b2427ffd4526"><div class="ttname"><a href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">NexNumber::setValue</a></div><div class="ttdeci">bool setValue(uint32_t number)</div><div class="ttdoc">Set number attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_number_8cpp_source.html#l00031">NexNumber.cpp:31</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_number_html_ad184ed818666ec482efddf840185c7b8"><div class="ttname"><a href="class_nex_number.html#ad184ed818666ec482efddf840185c7b8">NexNumber::getValue</a></div><div class="ttdeci">bool getValue(uint32_t *number)</div><div class="ttdoc">Get number attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_number_8cpp_source.html#l00022">NexNumber.cpp:22</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_a121929b9544fab6b74c5c8052ef2940.html">CompNumber</a></li><li class="navelem"><b>CompNumber_v0_32.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:36 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,189 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompNumber_v0_32.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_number_v0_32_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompNumber_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that ,when the "+" component on the Nextion screen is released, the value of number component will plus 1,when the "-" component released ,the value of number component will minus 1 every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>huang xianming (email:<a href="#" onclick="location.href='mai'+'lto:'+'xia'+'nm'+'ing'+'.h'+'uan'+'g@'+'ite'+'ad'+'.cc'; return false;">xianm<span style="display: none;">.nosp@m.</span>ing.<span style="display: none;">.nosp@m.</span>huang<span style="display: none;">.nosp@m.</span>@ite<span style="display: none;">.nosp@m.</span>ad.cc</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/11/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"><div class="line"></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> n0PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> b1PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Declare a number object [page id:0,component id:3, component name: "n0"]. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="_a0"></a><a class="code" href="class_nex_number.html">NexNumber</a> n0 = <a class="code" href="class_nex_number.html">NexNumber</a>(0, 3, <span class="stringliteral">"n0"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Declare a button object [page id:0,component id:1, component name: "b0"]. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="_a1"></a><a class="code" href="class_nex_button.html">NexButton</a> b0 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 1, <span class="stringliteral">"b0"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Declare a button object [page id:0,component id:2, component name: "b1"]. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a class="code" href="class_nex_button.html">NexButton</a> b1 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 2, <span class="stringliteral">"b1"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">char</span> buffer[100] = {0};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Register object n0, b0, b1, to the touch event list. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="_a2"></a><a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> &n0,</div>
|
||||||
|
<div class="line"> &b0,</div>
|
||||||
|
<div class="line"> &b1,</div>
|
||||||
|
<div class="line"> NULL</div>
|
||||||
|
<div class="line">};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * number component pop callback function. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> n0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"n0PopCallback"</span>);</div>
|
||||||
|
<div class="line"> n0.<a name="a3"></a><a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(50);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Button0 component pop callback function.</span></div>
|
||||||
|
<div class="line"><span class="comment"> * In this example,the value of the number component will plus one every time when button0 is released.</span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> uint32_t number;</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"b0PopCallback"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> n0.<a name="a4"></a><a class="code" href="class_nex_number.html#ad184ed818666ec482efddf840185c7b8">getValue</a>(&number);</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> number += 1;</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> n0.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(number);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Button1 component pop callback function.</span></div>
|
||||||
|
<div class="line"><span class="comment"> * In this example,the value of the number component will minus one every time when button1 is released.</span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> b1PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> uint32_t number;</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"b1PopCallback"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> n0.<a class="code" href="class_nex_number.html#ad184ed818666ec482efddf840185c7b8">getValue</a>(&number);</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> number -= 1;</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> n0.<a class="code" href="class_nex_number.html#a9cef51f6b76b4ba03a31b2427ffd4526">setValue</a>(number);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="comment">/* Set the baudrate which is for debug and communicate with Nextion screen. */</span></div>
|
||||||
|
<div class="line"> <a name="a5"></a><a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> <span class="comment">/* Register the pop event callback function of the current number component. */</span></div>
|
||||||
|
<div class="line"> n0.<a name="a6"></a><a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(n0PopCallback);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> <span class="comment">/* Register the pop event callback function of the current button0 component. */</span></div>
|
||||||
|
<div class="line"> b0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b0PopCallback);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> <span class="comment">/* Register the pop event callback function of the current button1 component. */</span></div>
|
||||||
|
<div class="line"> b1.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b1PopCallback);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * When a pop or push event occured every time, </span></div>
|
||||||
|
<div class="line"><span class="comment"> * the corresponding component[right page id and component id] in touch event list will be asked.</span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"> <a name="a7"></a><a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
</div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Thu Jan 5 2017 16:47:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,84 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompPage.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_page_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompPage.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>Show how to use API of class <a class="el" href="class_nex_page.html" title="A special component , which can contain other components such as NexButton, NexText and NexWaveform...">NexPage</a>.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"></div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:35 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,151 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompPage/CompPage.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_page_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompPage.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> </div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <a class="code" href="class_nex_page.html">NexPage</a> page0 = <a class="code" href="class_nex_page.html">NexPage</a>(0, 0, <span class="stringliteral">"page0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <a class="code" href="class_nex_page.html">NexPage</a> page1 = <a class="code" href="class_nex_page.html">NexPage</a>(1, 0, <span class="stringliteral">"page1"</span>);</div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <a class="code" href="class_nex_page.html">NexPage</a> page2 = <a class="code" href="class_nex_page.html">NexPage</a>(2, 0, <span class="stringliteral">"page2"</span>);</div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <a class="code" href="class_nex_page.html">NexPage</a> page3 = <a class="code" href="class_nex_page.html">NexPage</a>(3, 0, <span class="stringliteral">"page3"</span>);</div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> {</div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  &page0,</div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  &page1,</div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  &page2,</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  &page3,</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> };</div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="keywordtype">void</span> page0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> {</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  dbSerialPrintln(<span class="stringliteral">"page0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  page1.<a class="code" href="class_nex_page.html#a5714e41d4528b991eda4bbe578005418">show</a>();</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> }</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="keywordtype">void</span> page1PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> {</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  dbSerialPrintln(<span class="stringliteral">"page1PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  page2.<a class="code" href="class_nex_page.html#a5714e41d4528b991eda4bbe578005418">show</a>();</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> }</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> </div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="keywordtype">void</span> page2PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> {</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  dbSerialPrintln(<span class="stringliteral">"page2PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  page3.<a class="code" href="class_nex_page.html#a5714e41d4528b991eda4bbe578005418">show</a>();</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> }</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> </div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="keywordtype">void</span> page3PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> {</div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  dbSerialPrintln(<span class="stringliteral">"page3PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  page0.<a class="code" href="class_nex_page.html#a5714e41d4528b991eda4bbe578005418">show</a>();</div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> }</div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> </div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> { </div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  dbSerialPrintln(<span class="stringliteral">"setup begin"</span>);</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  </div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  page0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(page0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  page1.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(page1PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  page2.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(page2PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  page3.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(page3PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  </div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  dbSerialPrintln(<span class="stringliteral">"setup end"</span>);</div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> }</div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> {</div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> }</div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_page_html_a5714e41d4528b991eda4bbe578005418"><div class="ttname"><a href="class_nex_page.html#a5714e41d4528b991eda4bbe578005418">NexPage::show</a></div><div class="ttdeci">bool show(void)</div><div class="ttdoc">Show itself. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_page_8cpp_source.html#l00023">NexPage.cpp:23</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_page_html"><div class="ttname"><a href="class_nex_page.html">NexPage</a></div><div class="ttdoc">A special component , which can contain other components such as NexButton, NexText and NexWaveform...</div><div class="ttdef"><b>Definition:</b> <a href="_nex_page_8h_source.html#l00031">NexPage.h:31</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_88b085927d35ec3e069c44673959ea9f.html">CompPage</a></li><li class="navelem"><b>CompPage.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 08:58:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,151 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompPage/CompPage_v0_32.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_page__v0__32_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompPage_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <a class="code" href="class_nex_page.html">NexPage</a> page0 = <a class="code" href="class_nex_page.html">NexPage</a>(0, 0, <span class="stringliteral">"page0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <a class="code" href="class_nex_page.html">NexPage</a> page1 = <a class="code" href="class_nex_page.html">NexPage</a>(1, 0, <span class="stringliteral">"page1"</span>);</div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <a class="code" href="class_nex_page.html">NexPage</a> page2 = <a class="code" href="class_nex_page.html">NexPage</a>(2, 0, <span class="stringliteral">"page2"</span>);</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <a class="code" href="class_nex_page.html">NexPage</a> page3 = <a class="code" href="class_nex_page.html">NexPage</a>(3, 0, <span class="stringliteral">"page3"</span>);</div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> {</div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  &page0,</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  &page1,</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  &page2,</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  &page3,</div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> };</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="keywordtype">void</span> page0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> {</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  dbSerialPrintln(<span class="stringliteral">"page0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  page1.<a class="code" href="class_nex_page.html#a5714e41d4528b991eda4bbe578005418">show</a>();</div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> }</div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="keywordtype">void</span> page1PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> {</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  dbSerialPrintln(<span class="stringliteral">"page1PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  page2.<a class="code" href="class_nex_page.html#a5714e41d4528b991eda4bbe578005418">show</a>();</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> }</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> </div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="keywordtype">void</span> page2PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> {</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  dbSerialPrintln(<span class="stringliteral">"page2PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  page3.<a class="code" href="class_nex_page.html#a5714e41d4528b991eda4bbe578005418">show</a>();</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> }</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="keywordtype">void</span> page3PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> {</div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  dbSerialPrintln(<span class="stringliteral">"page3PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  page0.<a class="code" href="class_nex_page.html#a5714e41d4528b991eda4bbe578005418">show</a>();</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> }</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> { </div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  dbSerialPrintln(<span class="stringliteral">"setup begin"</span>);</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  </div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  page0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(page0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  page1.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(page1PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  page2.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(page2PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  page3.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(page3PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  </div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  dbSerialPrintln(<span class="stringliteral">"setup end"</span>);</div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> }</div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> </div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> {</div>
|
||||||
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> }</div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_page_html_a5714e41d4528b991eda4bbe578005418"><div class="ttname"><a href="class_nex_page.html#a5714e41d4528b991eda4bbe578005418">NexPage::show</a></div><div class="ttdeci">bool show(void)</div><div class="ttdoc">Show itself. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_page_8cpp_source.html#l00023">NexPage.cpp:23</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_page_html"><div class="ttname"><a href="class_nex_page.html">NexPage</a></div><div class="ttdoc">A special component , which can contain other components such as NexButton, NexText and NexWaveform...</div><div class="ttdef"><b>Definition:</b> <a href="_nex_page_8h_source.html#l00031">NexPage.h:31</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_88b085927d35ec3e069c44673959ea9f.html">CompPage</a></li><li class="navelem"><b>CompPage_v0_32.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:36 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,142 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompPage_v0_32.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_page_v0_32_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompPage_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>Show how to use API of class <a class="el" href="class_nex_page.html" title="A special component , which can contain other components such as NexButton, NexText and NexWaveform...">NexPage</a>.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"><div class="line"></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a0"></a><a class="code" href="class_nex_page.html">NexPage</a> page0 = <a class="code" href="class_nex_page.html">NexPage</a>(0, 0, <span class="stringliteral">"page0"</span>);</div>
|
||||||
|
<div class="line"><a class="code" href="class_nex_page.html">NexPage</a> page1 = <a class="code" href="class_nex_page.html">NexPage</a>(1, 0, <span class="stringliteral">"page1"</span>);</div>
|
||||||
|
<div class="line"><a class="code" href="class_nex_page.html">NexPage</a> page2 = <a class="code" href="class_nex_page.html">NexPage</a>(2, 0, <span class="stringliteral">"page2"</span>);</div>
|
||||||
|
<div class="line"><a class="code" href="class_nex_page.html">NexPage</a> page3 = <a class="code" href="class_nex_page.html">NexPage</a>(3, 0, <span class="stringliteral">"page3"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a1"></a><a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> &page0,</div>
|
||||||
|
<div class="line"> &page1,</div>
|
||||||
|
<div class="line"> &page2,</div>
|
||||||
|
<div class="line"> &page3,</div>
|
||||||
|
<div class="line"> NULL</div>
|
||||||
|
<div class="line">};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> page0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"page0PopCallback"</span>);</div>
|
||||||
|
<div class="line"> page1.<a name="a2"></a><a class="code" href="class_nex_page.html#a5714e41d4528b991eda4bbe578005418">show</a>();</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> page1PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"page1PopCallback"</span>);</div>
|
||||||
|
<div class="line"> page2.<a class="code" href="class_nex_page.html#a5714e41d4528b991eda4bbe578005418">show</a>();</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> page2PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"page2PopCallback"</span>);</div>
|
||||||
|
<div class="line"> page3.<a class="code" href="class_nex_page.html#a5714e41d4528b991eda4bbe578005418">show</a>();</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> page3PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"page3PopCallback"</span>);</div>
|
||||||
|
<div class="line"> page0.<a class="code" href="class_nex_page.html#a5714e41d4528b991eda4bbe578005418">show</a>();</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{ </div>
|
||||||
|
<div class="line"> <a name="a3"></a><a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"setup begin"</span>);</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> page0.<a name="a4"></a><a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(page0PopCallback);</div>
|
||||||
|
<div class="line"> page1.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(page1PopCallback);</div>
|
||||||
|
<div class="line"> page2.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(page2PopCallback);</div>
|
||||||
|
<div class="line"> page3.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(page3PopCallback);</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"setup end"</span>);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <a name="a5"></a><a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
</div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Thu Jan 5 2017 16:47:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,84 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompPicture.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_picture_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompPicture.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that ,when the picture component on the Nextion screen is released, the picture of current component will be changed every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"></div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:35 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,140 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompPicture/CompPicture.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_picture_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompPicture.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> * Declare a picture object [page id:0,component id:1, component name: "p0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <a class="code" href="class_nex_picture.html">NexPicture</a> p0 = <a class="code" href="class_nex_picture.html">NexPicture</a>(0, 1, <span class="stringliteral">"p0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> {</div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  &p0,</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> };</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keywordtype">void</span> p0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> {</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  uint32_t number = 0;</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  dbSerialPrintln(<span class="stringliteral">"p0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  p0.<a class="code" href="class_nex_picture.html#a11bd68ef9fe1d03d9e0d02ef1c7527e9">getPic</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="keywordflow">if</span> (number == 1)</div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  {</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  number = 2; </div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  }</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <span class="keywordflow">else</span></div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  {</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  number = 1;</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  }</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  </div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  p0.<a class="code" href="class_nex_picture.html#ab1c6adff615d48261ce10c2095859abd">setPic</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> }</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> </div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> {</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  p0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(p0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> }</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> {</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> }</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_picture_html_ab1c6adff615d48261ce10c2095859abd"><div class="ttname"><a href="class_nex_picture.html#ab1c6adff615d48261ce10c2095859abd">NexPicture::setPic</a></div><div class="ttdeci">bool setPic(uint32_t number)</div><div class="ttdoc">Set picture's number. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_picture_8cpp_source.html#l00055">NexPicture.cpp:55</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_picture_html"><div class="ttname"><a href="class_nex_picture.html">NexPicture</a></div><div class="ttdoc">NexPicture component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_picture_8h_source.html#l00030">NexPicture.h:30</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_picture_html_a11bd68ef9fe1d03d9e0d02ef1c7527e9"><div class="ttname"><a href="class_nex_picture.html#a11bd68ef9fe1d03d9e0d02ef1c7527e9">NexPicture::getPic</a></div><div class="ttdeci">bool getPic(uint32_t *number)</div><div class="ttdoc">Get picture's number. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_picture_8cpp_source.html#l00046">NexPicture.cpp:46</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_a1532c81ac7ffe94cd7af0c8adbf41fd.html">CompPicture</a></li><li class="navelem"><b>CompPicture.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 08:58:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,140 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompPicture/CompPicture_v0_32.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_picture__v0__32_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompPicture_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment"> * Declare a picture object [page id:0,component id:1, component name: "p0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <a class="code" href="class_nex_picture.html">NexPicture</a> p0 = <a class="code" href="class_nex_picture.html">NexPicture</a>(0, 1, <span class="stringliteral">"p0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> {</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  &p0,</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> };</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> </div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="keywordtype">void</span> p0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> {</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  uint32_t number = 0;</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  dbSerialPrintln(<span class="stringliteral">"p0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  p0.<a class="code" href="class_nex_picture.html#a11bd68ef9fe1d03d9e0d02ef1c7527e9">getPic</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <span class="keywordflow">if</span> (number == 1)</div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  {</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  number = 2; </div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  }</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="keywordflow">else</span></div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  {</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  number = 1;</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  }</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  </div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  p0.<a class="code" href="class_nex_picture.html#ab1c6adff615d48261ce10c2095859abd">setPic</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> }</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> {</div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  p0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(p0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> }</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> {</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> }</div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_picture_html_ab1c6adff615d48261ce10c2095859abd"><div class="ttname"><a href="class_nex_picture.html#ab1c6adff615d48261ce10c2095859abd">NexPicture::setPic</a></div><div class="ttdeci">bool setPic(uint32_t number)</div><div class="ttdoc">Set picture's number. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_picture_8cpp_source.html#l00055">NexPicture.cpp:55</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_picture_html"><div class="ttname"><a href="class_nex_picture.html">NexPicture</a></div><div class="ttdoc">NexPicture component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_picture_8h_source.html#l00030">NexPicture.h:30</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_picture_html_a11bd68ef9fe1d03d9e0d02ef1c7527e9"><div class="ttname"><a href="class_nex_picture.html#a11bd68ef9fe1d03d9e0d02ef1c7527e9">NexPicture::getPic</a></div><div class="ttdeci">bool getPic(uint32_t *number)</div><div class="ttdoc">Get picture's number. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_picture_8cpp_source.html#l00046">NexPicture.cpp:46</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_a1532c81ac7ffe94cd7af0c8adbf41fd.html">CompPicture</a></li><li class="navelem"><b>CompPicture_v0_32.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:36 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,130 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompPicture_v0_32.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_picture_v0_32_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompPicture_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that ,when the picture component on the Nextion screen is released, the picture of current component will be changed every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"><div class="line"></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Declare a picture object [page id:0,component id:1, component name: "p0"]. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="_a0"></a><a class="code" href="class_nex_picture.html">NexPicture</a> p0 = <a class="code" href="class_nex_picture.html">NexPicture</a>(0, 1, <span class="stringliteral">"p0"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a1"></a><a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> &p0,</div>
|
||||||
|
<div class="line"> NULL</div>
|
||||||
|
<div class="line">};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> p0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> uint32_t number = 0;</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"p0PopCallback"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> p0.<a name="a2"></a><a class="code" href="class_nex_picture.html#a11bd68ef9fe1d03d9e0d02ef1c7527e9">getPic</a>(&number);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span> (number == 1)</div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> number = 2; </div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line"> <span class="keywordflow">else</span></div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> number = 1;</div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> p0.<a name="a3"></a><a class="code" href="class_nex_picture.html#ab1c6adff615d48261ce10c2095859abd">setPic</a>(number);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <a name="a4"></a><a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"> p0.<a name="a5"></a><a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(p0PopCallback);</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <a name="a6"></a><a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
</div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Thu Jan 5 2017 16:47:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,84 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompProgressBar.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_progress_bar_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompProgressBar.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that,when the "btn_up" component on the Nextion screen is released, the value of progress bar component will plus 5,when the "btn_down" component released ,the value of progress bar component will minus 5 every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"></div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:35 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,153 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompProgressBar/CompProgressBar.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_progress_bar_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompProgressBar.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <a class="code" href="class_nex_progress_bar.html">NexProgressBar</a> j0 = <a class="code" href="class_nex_progress_bar.html">NexProgressBar</a>(0, 3, <span class="stringliteral">"j0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <a class="code" href="class_nex_button.html">NexButton</a> btn_up = <a class="code" href="class_nex_button.html">NexButton</a>(0, 1, <span class="stringliteral">"btn_up"</span>);</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <a class="code" href="class_nex_button.html">NexButton</a> btn_down = <a class="code" href="class_nex_button.html">NexButton</a>(0, 2, <span class="stringliteral">"btn_down"</span>);</div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> {</div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  &btn_up,</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  &btn_down,</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> };</div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="keywordtype">void</span> buttonUpPopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> {</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  uint32_t number = 0;</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  dbSerialPrintln(<span class="stringliteral">"buttonUpPopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  j0.<a class="code" href="class_nex_progress_bar.html#a3e5eb13b2aa014c8f6a9e16439917bf2">getValue</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  number += 5;</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <span class="keywordflow">if</span> (number >= 100)</div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  {</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  number = 100;</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  }</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  </div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  j0.<a class="code" href="class_nex_progress_bar.html#aaa7937d364cb63151bd1e1bc4729334d">setValue</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> }</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">void</span> buttonDownPopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> {</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  uint32_t number = 0;</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  dbSerialPrintln(<span class="stringliteral">"buttonDownPopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  j0.<a class="code" href="class_nex_progress_bar.html#a3e5eb13b2aa014c8f6a9e16439917bf2">getValue</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="keywordflow">if</span> (number >= 5)</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  {</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  number -= 5;</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  }</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  </div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  j0.<a class="code" href="class_nex_progress_bar.html#aaa7937d364cb63151bd1e1bc4729334d">setValue</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> }</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> {</div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  btn_up.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(buttonUpPopCallback);</div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  btn_down.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(buttonDownPopCallback);</div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> }</div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> </div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> {</div>
|
||||||
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> }</div>
|
||||||
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_progress_bar_html_aaa7937d364cb63151bd1e1bc4729334d"><div class="ttname"><a href="class_nex_progress_bar.html#aaa7937d364cb63151bd1e1bc4729334d">NexProgressBar::setValue</a></div><div class="ttdeci">bool setValue(uint32_t number)</div><div class="ttdoc">Set the value of progress bar. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_progress_bar_8cpp_source.html#l00032">NexProgressBar.cpp:32</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_button_html"><div class="ttname"><a href="class_nex_button.html">NexButton</a></div><div class="ttdoc">NexButton component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_button_8h_source.html#l00035">NexButton.h:35</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_progress_bar_html_a3e5eb13b2aa014c8f6a9e16439917bf2"><div class="ttname"><a href="class_nex_progress_bar.html#a3e5eb13b2aa014c8f6a9e16439917bf2">NexProgressBar::getValue</a></div><div class="ttdeci">bool getValue(uint32_t *number)</div><div class="ttdoc">Get the value of progress bar. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_progress_bar_8cpp_source.html#l00023">NexProgressBar.cpp:23</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_progress_bar_html"><div class="ttname"><a href="class_nex_progress_bar.html">NexProgressBar</a></div><div class="ttdoc">NexProgressBar component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_progress_bar_8h_source.html#l00030">NexProgressBar.h:30</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_b3d36b9fee6f94e0e9351d3ce179e46a.html">CompProgressBar</a></li><li class="navelem"><b>CompProgressBar.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 08:58:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,153 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompProgressBar/CompProgressBar_v0_32.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_progress_bar__v0__32_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompProgressBar_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <a class="code" href="class_nex_progress_bar.html">NexProgressBar</a> j0 = <a class="code" href="class_nex_progress_bar.html">NexProgressBar</a>(0, 3, <span class="stringliteral">"j0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <a class="code" href="class_nex_button.html">NexButton</a> btn_up = <a class="code" href="class_nex_button.html">NexButton</a>(0, 1, <span class="stringliteral">"btn_up"</span>);</div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <a class="code" href="class_nex_button.html">NexButton</a> btn_down = <a class="code" href="class_nex_button.html">NexButton</a>(0, 2, <span class="stringliteral">"btn_down"</span>);</div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> {</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  &btn_up,</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  &btn_down,</div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> };</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="keywordtype">void</span> buttonUpPopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> {</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  uint32_t number = 0;</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  dbSerialPrintln(<span class="stringliteral">"buttonUpPopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  j0.<a class="code" href="class_nex_progress_bar.html#a3e5eb13b2aa014c8f6a9e16439917bf2">getValue</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  number += 5;</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <span class="keywordflow">if</span> (number >= 100)</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  {</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  number = 100;</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  }</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  </div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  j0.<a class="code" href="class_nex_progress_bar.html#aaa7937d364cb63151bd1e1bc4729334d">setValue</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> }</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> </div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="keywordtype">void</span> buttonDownPopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> {</div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  uint32_t number = 0;</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  dbSerialPrintln(<span class="stringliteral">"buttonDownPopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  j0.<a class="code" href="class_nex_progress_bar.html#a3e5eb13b2aa014c8f6a9e16439917bf2">getValue</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keywordflow">if</span> (number >= 5)</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  {</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  number -= 5;</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  }</div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  </div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  j0.<a class="code" href="class_nex_progress_bar.html#aaa7937d364cb63151bd1e1bc4729334d">setValue</a>(number);</div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> }</div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> {</div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  btn_up.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(buttonUpPopCallback);</div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  btn_down.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(buttonDownPopCallback);</div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> }</div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div>
|
||||||
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> {</div>
|
||||||
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> }</div>
|
||||||
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_progress_bar_html_aaa7937d364cb63151bd1e1bc4729334d"><div class="ttname"><a href="class_nex_progress_bar.html#aaa7937d364cb63151bd1e1bc4729334d">NexProgressBar::setValue</a></div><div class="ttdeci">bool setValue(uint32_t number)</div><div class="ttdoc">Set the value of progress bar. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_progress_bar_8cpp_source.html#l00032">NexProgressBar.cpp:32</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_button_html"><div class="ttname"><a href="class_nex_button.html">NexButton</a></div><div class="ttdoc">NexButton component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_button_8h_source.html#l00035">NexButton.h:35</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_progress_bar_html_a3e5eb13b2aa014c8f6a9e16439917bf2"><div class="ttname"><a href="class_nex_progress_bar.html#a3e5eb13b2aa014c8f6a9e16439917bf2">NexProgressBar::getValue</a></div><div class="ttdeci">bool getValue(uint32_t *number)</div><div class="ttdoc">Get the value of progress bar. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_progress_bar_8cpp_source.html#l00023">NexProgressBar.cpp:23</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_progress_bar_html"><div class="ttname"><a href="class_nex_progress_bar.html">NexProgressBar</a></div><div class="ttdoc">NexProgressBar component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_progress_bar_8h_source.html#l00030">NexProgressBar.h:30</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_b3d36b9fee6f94e0e9351d3ce179e46a.html">CompProgressBar</a></li><li class="navelem"><b>CompProgressBar_v0_32.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:36 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,142 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompProgressBar_v0_32.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_progress_bar_v0_32_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompProgressBar_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that,when the "btn_up" component on the Nextion screen is released, the value of progress bar component will plus 5,when the "btn_down" component released ,the value of progress bar component will minus 5 every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"><div class="line"></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a0"></a><a class="code" href="class_nex_progress_bar.html">NexProgressBar</a> j0 = <a class="code" href="class_nex_progress_bar.html">NexProgressBar</a>(0, 3, <span class="stringliteral">"j0"</span>);</div>
|
||||||
|
<div class="line"><a name="_a1"></a><a class="code" href="class_nex_button.html">NexButton</a> btn_up = <a class="code" href="class_nex_button.html">NexButton</a>(0, 1, <span class="stringliteral">"btn_up"</span>);</div>
|
||||||
|
<div class="line"><a class="code" href="class_nex_button.html">NexButton</a> btn_down = <a class="code" href="class_nex_button.html">NexButton</a>(0, 2, <span class="stringliteral">"btn_down"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a2"></a><a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> &btn_up,</div>
|
||||||
|
<div class="line"> &btn_down,</div>
|
||||||
|
<div class="line"> NULL</div>
|
||||||
|
<div class="line">};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> buttonUpPopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> uint32_t number = 0;</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"buttonUpPopCallback"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> j0.<a name="a3"></a><a class="code" href="class_nex_progress_bar.html#a3e5eb13b2aa014c8f6a9e16439917bf2">getValue</a>(&number);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> number += 5;</div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span> (number >= 100)</div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> number = 100;</div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> j0.<a name="a4"></a><a class="code" href="class_nex_progress_bar.html#aaa7937d364cb63151bd1e1bc4729334d">setValue</a>(number);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> buttonDownPopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> uint32_t number = 0;</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"buttonDownPopCallback"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> j0.<a class="code" href="class_nex_progress_bar.html#a3e5eb13b2aa014c8f6a9e16439917bf2">getValue</a>(&number);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span> (number >= 5)</div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> number -= 5;</div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> j0.<a class="code" href="class_nex_progress_bar.html#aaa7937d364cb63151bd1e1bc4729334d">setValue</a>(number);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <a name="a5"></a><a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"> btn_up.<a name="a6"></a><a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(buttonUpPopCallback);</div>
|
||||||
|
<div class="line"> btn_down.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(buttonDownPopCallback);</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <a name="a7"></a><a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
</div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Thu Jan 5 2017 16:47:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,104 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompRtc.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_rtc_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompRtc.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that in nextion screen displays the current read the RTC time and show how to use the API.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>huangxiaoming (email:<a href="#" onclick="location.href='mai'+'lto:'+'xia'+'om'+'ing'+'.h'+'uan'+'g@'+'ite'+'ad'+'.cc'; return false;">xiaom<span style="display: none;">.nosp@m.</span>ing.<span style="display: none;">.nosp@m.</span>huang<span style="display: none;">.nosp@m.</span>@ite<span style="display: none;">.nosp@m.</span>ad.cc</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2016/12/8 </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"><div class="line"></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a0"></a><a class="code" href="class_nex_text.html">NexText</a> t0 = <a class="code" href="class_nex_text.html">NexText</a>(0,1,<span class="stringliteral">"t0"</span>);</div>
|
||||||
|
<div class="line"><a name="_a1"></a><a class="code" href="class_nex_rtc.html">NexRtc</a> rtc;</div>
|
||||||
|
<div class="line">uint32_t time[7] = {2016,11,25,12,34,50};</div>
|
||||||
|
<div class="line">uint8_t time_buf[30] = {0};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> setup() </div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <a name="a2"></a><a class="code" href="group___configuration.html#ga2738b05a77cd5052e440af5b00b0ecbd">nexSerial</a>.begin(115200);</div>
|
||||||
|
<div class="line"> rtc.<a name="a3"></a>write_rtc_time(time);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> loop() </div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> rtc.<a name="a4"></a><a class="code" href="class_nex_rtc.html#a17230cd9342a905778fa4ee2e8609f02">read_rtc_time</a>(time_buf,30);</div>
|
||||||
|
<div class="line"> t0.<a name="a5"></a><a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(time_buf);</div>
|
||||||
|
<div class="line"> delay(1000);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
</div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:35 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,112 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompRtc/CompRtc.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_rtc_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompRtc.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <a class="code" href="class_nex_text.html">NexText</a> t0 = <a class="code" href="class_nex_text.html">NexText</a>(0,1,<span class="stringliteral">"t0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <a class="code" href="class_nex_rtc.html">NexRtc</a> rtc;</div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> uint32_t time[7] = {2016,11,25,12,34,50};</div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> uint8_t time_buf[30] = {0};</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="keywordtype">void</span> setup() </div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> {</div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  <a class="code" href="group___configuration.html#ga2738b05a77cd5052e440af5b00b0ecbd">nexSerial</a>.begin(115200);</div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  rtc.write_rtc_time(time);</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> }</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="keywordtype">void</span> loop() </div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> {</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  rtc.<a class="code" href="class_nex_rtc.html#a17230cd9342a905778fa4ee2e8609f02">read_rtc_time</a>(time_buf,30);</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(time_buf);</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  delay(1000);</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> }</div>
|
||||||
|
<div class="ttc" id="class_nex_rtc_html"><div class="ttname"><a href="class_nex_rtc.html">NexRtc</a></div><div class="ttdoc">NexRtc component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_rtc_8h_source.html#l00031">NexRtc.h:31</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html_a19589b32c981436a1bbcfe407bc766e3"><div class="ttname"><a href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">NexText::setText</a></div><div class="ttdeci">bool setText(const char *buffer)</div><div class="ttdoc">Set text attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8cpp_source.html#l00032">NexText.cpp:32</a></div></div>
|
||||||
|
<div class="ttc" id="group___configuration_html_ga2738b05a77cd5052e440af5b00b0ecbd"><div class="ttname"><a href="group___configuration.html#ga2738b05a77cd5052e440af5b00b0ecbd">nexSerial</a></div><div class="ttdeci">#define nexSerial</div><div class="ttdoc">Define nexSerial for communicate with Nextion touch panel. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_config_8h_source.html#l00037">NexConfig.h:37</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_rtc_html_a17230cd9342a905778fa4ee2e8609f02"><div class="ttname"><a href="class_nex_rtc.html#a17230cd9342a905778fa4ee2e8609f02">NexRtc::read_rtc_time</a></div><div class="ttdeci">uint32_t read_rtc_time(char *time, uint32_t len)</div><div class="ttdoc">read rtc time </div><div class="ttdef"><b>Definition:</b> <a href="_nex_rtc_8cpp_source.html#l00166">NexRtc.cpp:166</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html"><div class="ttname"><a href="class_nex_text.html">NexText</a></div><div class="ttdoc">NexText component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8h_source.html#l00030">NexText.h:30</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_2c7bb7af606a816dc5d12b9c9f93cdb0.html">CompRtc</a></li><li class="navelem"><b>CompRtc.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:36 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,84 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompSlider.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_slider_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompSlider.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that ,when the slider component on the Nextion screen is released, the text value of text component will be changed every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/8/11 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"></div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:35 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,131 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompSlider/CompSlider.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_slider_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompSlider.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <a class="code" href="class_nex_text.html">NexText</a> t0 = <a class="code" href="class_nex_text.html">NexText</a>(0, 2, <span class="stringliteral">"t0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <a class="code" href="class_nex_slider.html">NexSlider</a> h0 = <a class="code" href="class_nex_slider.html">NexSlider</a>(0, 1, <span class="stringliteral">"h0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> {</div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  &h0,</div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> };</div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="keywordtype">void</span> h0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> {</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  uint32_t number = 0;</div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  <span class="keywordtype">char</span> temp[10] = {0};</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  </div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  dbSerialPrintln(<span class="stringliteral">"h0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  h0.<a class="code" href="class_nex_slider.html#a384d5488b421efd6affbfd32f45bb107">getValue</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  utoa(number, temp, 10);</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(temp);</div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> }</div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> {</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  h0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(h0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> }</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> </div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> {</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> }</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_slider_html"><div class="ttname"><a href="class_nex_slider.html">NexSlider</a></div><div class="ttdoc">NexSlider component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_slider_8h_source.html#l00030">NexSlider.h:30</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html_a19589b32c981436a1bbcfe407bc766e3"><div class="ttname"><a href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">NexText::setText</a></div><div class="ttdeci">bool setText(const char *buffer)</div><div class="ttdoc">Set text attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8cpp_source.html#l00032">NexText.cpp:32</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_slider_html_a384d5488b421efd6affbfd32f45bb107"><div class="ttname"><a href="class_nex_slider.html#a384d5488b421efd6affbfd32f45bb107">NexSlider::getValue</a></div><div class="ttdeci">bool getValue(uint32_t *number)</div><div class="ttdoc">Get the value of slider. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_slider_8cpp_source.html#l00022">NexSlider.cpp:22</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html"><div class="ttname"><a href="class_nex_text.html">NexText</a></div><div class="ttdoc">NexText component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8h_source.html#l00030">NexText.h:30</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_362f30179229d7166f5b27ed31213abf.html">CompSlider</a></li><li class="navelem"><b>CompSlider.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 08:58:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,131 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompSlider/CompSlider_v0_32.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_slider__v0__32_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompSlider_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <a class="code" href="class_nex_text.html">NexText</a> t0 = <a class="code" href="class_nex_text.html">NexText</a>(0, 2, <span class="stringliteral">"t0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <a class="code" href="class_nex_slider.html">NexSlider</a> h0 = <a class="code" href="class_nex_slider.html">NexSlider</a>(0, 1, <span class="stringliteral">"h0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> {</div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  &h0,</div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> };</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="keywordtype">void</span> h0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> {</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  uint32_t number = 0;</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <span class="keywordtype">char</span> temp[10] = {0};</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  </div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  dbSerialPrintln(<span class="stringliteral">"h0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  h0.<a class="code" href="class_nex_slider.html#a384d5488b421efd6affbfd32f45bb107">getValue</a>(&number);</div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  utoa(number, temp, 10);</div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(temp);</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> }</div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> </div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> {</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  h0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(h0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> }</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> {</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> }</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_slider_html"><div class="ttname"><a href="class_nex_slider.html">NexSlider</a></div><div class="ttdoc">NexSlider component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_slider_8h_source.html#l00030">NexSlider.h:30</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html_a19589b32c981436a1bbcfe407bc766e3"><div class="ttname"><a href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">NexText::setText</a></div><div class="ttdeci">bool setText(const char *buffer)</div><div class="ttdoc">Set text attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8cpp_source.html#l00032">NexText.cpp:32</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_slider_html_a384d5488b421efd6affbfd32f45bb107"><div class="ttname"><a href="class_nex_slider.html#a384d5488b421efd6affbfd32f45bb107">NexSlider::getValue</a></div><div class="ttdeci">bool getValue(uint32_t *number)</div><div class="ttdoc">Get the value of slider. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_slider_8cpp_source.html#l00022">NexSlider.cpp:22</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html"><div class="ttname"><a href="class_nex_text.html">NexText</a></div><div class="ttdoc">NexText component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8h_source.html#l00030">NexText.h:30</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_362f30179229d7166f5b27ed31213abf.html">CompSlider</a></li><li class="navelem"><b>CompSlider_v0_32.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:36 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,120 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompSlider_v0_32.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_slider_v0_32_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompSlider_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that ,when the slider component on the Nextion screen is released, the text value of text component will be changed every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/8/11 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"><div class="line"></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a0"></a><a class="code" href="class_nex_text.html">NexText</a> t0 = <a class="code" href="class_nex_text.html">NexText</a>(0, 2, <span class="stringliteral">"t0"</span>);</div>
|
||||||
|
<div class="line"><a name="_a1"></a><a class="code" href="class_nex_slider.html">NexSlider</a> h0 = <a class="code" href="class_nex_slider.html">NexSlider</a>(0, 1, <span class="stringliteral">"h0"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><a name="_a2"></a><a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> &h0,</div>
|
||||||
|
<div class="line"> NULL</div>
|
||||||
|
<div class="line">};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> h0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> uint32_t number = 0;</div>
|
||||||
|
<div class="line"> <span class="keywordtype">char</span> temp[10] = {0};</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"h0PopCallback"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> h0.<a name="a3"></a><a class="code" href="class_nex_slider.html#a384d5488b421efd6affbfd32f45bb107">getValue</a>(&number);</div>
|
||||||
|
<div class="line"> utoa(number, temp, 10);</div>
|
||||||
|
<div class="line"> t0.<a name="a4"></a><a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(temp);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <a name="a5"></a><a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"> h0.<a name="a6"></a><a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(h0PopCallback);</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <a name="a7"></a><a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
</div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Thu Jan 5 2017 16:47:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,84 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompText.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_text_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompText.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that ,when the "+" component on the Nextion screen is released, the value of text component will plus 1,when the "-" component released ,the value of text component will minus 1 every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"></div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:35 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,211 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompText/CompText.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_text_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompText.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="keywordtype">void</span> t0PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="keywordtype">void</span> b1PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="comment"> * Declare a text object [page id:0,component id:1, component name: "t0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <a class="code" href="class_nex_text.html">NexText</a> t0 = <a class="code" href="class_nex_text.html">NexText</a>(0, 1, <span class="stringliteral">"t0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment"> * Declare a button object [page id:0,component id:2, component name: "b0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <a class="code" href="class_nex_button.html">NexButton</a> b0 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 2, <span class="stringliteral">"b0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment"> * Declare a button object [page id:0,component id:3, component name: "b1"]. </span></div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <a class="code" href="class_nex_button.html">NexButton</a> b1 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 3, <span class="stringliteral">"b1"</span>);</div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="keywordtype">char</span> buffer[100] = {0};</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment"> * Register object t0, b0, b1, to the touch event list. </span></div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> {</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  &t0,</div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  &b0,</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  &b1,</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span> };</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="comment"> * Text component pop callback function. </span></div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="keywordtype">void</span> t0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> {</div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  dbSerialPrintln(<span class="stringliteral">"t0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(<span class="stringliteral">"50"</span>);</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span> }</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="comment"> * Button0 component pop callback function.</span></div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="comment"> * In this example,the value of the text component will plus one every time when button0 is released.</span></div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> {</div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  uint16_t len;</div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  uint16_t number;</div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  </div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  dbSerialPrintln(<span class="stringliteral">"b0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> </div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  t0.<a class="code" href="class_nex_text.html#a9cf417b2f25df2872492c55bdc9f5b30">getText</a>(buffer, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  </div>
|
||||||
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  number = atoi(buffer);</div>
|
||||||
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  number += 1;</div>
|
||||||
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> </div>
|
||||||
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  itoa(number, buffer, 10);</div>
|
||||||
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  </div>
|
||||||
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(buffer);</div>
|
||||||
|
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> }</div>
|
||||||
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> </div>
|
||||||
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> <span class="comment"> * Button1 component pop callback function.</span></div>
|
||||||
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span> <span class="comment"> * In this example,the value of the text component will minus one every time when button1 is released.</span></div>
|
||||||
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span> <span class="keywordtype">void</span> b1PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> {</div>
|
||||||
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  uint16_t len;</div>
|
||||||
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  uint16_t number;</div>
|
||||||
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  </div>
|
||||||
|
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  dbSerialPrintln(<span class="stringliteral">"b1PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div>
|
||||||
|
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  t0.<a class="code" href="class_nex_text.html#a9cf417b2f25df2872492c55bdc9f5b30">getText</a>(buffer, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  </div>
|
||||||
|
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  number = atoi(buffer);</div>
|
||||||
|
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  number -= 1;</div>
|
||||||
|
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span> </div>
|
||||||
|
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  itoa(number, buffer, 10);</div>
|
||||||
|
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  </div>
|
||||||
|
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(buffer);</div>
|
||||||
|
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span> }</div>
|
||||||
|
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span> </div>
|
||||||
|
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span> {</div>
|
||||||
|
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="comment">/* Set the baudrate which is for debug and communicate with Nextion screen. */</span></div>
|
||||||
|
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span> </div>
|
||||||
|
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="comment">/* Register the pop event callback function of the current text component. */</span></div>
|
||||||
|
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  t0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(t0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span> </div>
|
||||||
|
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="comment">/* Register the pop event callback function of the current button0 component. */</span></div>
|
||||||
|
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  b0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span> </div>
|
||||||
|
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="comment">/* Register the pop event callback function of the current button1 component. */</span></div>
|
||||||
|
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  b1.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b1PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span> </div>
|
||||||
|
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> }</div>
|
||||||
|
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span> </div>
|
||||||
|
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> {</div>
|
||||||
|
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> <span class="comment"> * When a pop or push event occured every time, </span></div>
|
||||||
|
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="comment"> * the corresponding component[right page id and component id] in touch event list will be asked.</span></div>
|
||||||
|
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span> }</div>
|
||||||
|
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html_a19589b32c981436a1bbcfe407bc766e3"><div class="ttname"><a href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">NexText::setText</a></div><div class="ttdeci">bool setText(const char *buffer)</div><div class="ttdoc">Set text attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8cpp_source.html#l00032">NexText.cpp:32</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_button_html"><div class="ttname"><a href="class_nex_button.html">NexButton</a></div><div class="ttdoc">NexButton component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_button_8h_source.html#l00035">NexButton.h:35</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html_a9cf417b2f25df2872492c55bdc9f5b30"><div class="ttname"><a href="class_nex_text.html#a9cf417b2f25df2872492c55bdc9f5b30">NexText::getText</a></div><div class="ttdeci">uint16_t getText(char *buffer, uint16_t len)</div><div class="ttdoc">Get text attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8cpp_source.html#l00022">NexText.cpp:22</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html"><div class="ttname"><a href="class_nex_text.html">NexText</a></div><div class="ttdoc">NexText component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8h_source.html#l00030">NexText.h:30</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_e79857bc4faa7405ea054e9dea791d5c.html">CompText</a></li><li class="navelem"><b>CompText.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 08:58:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,211 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompText/CompText_v0_32.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_text__v0__32_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompText_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="keywordtype">void</span> t0PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="keywordtype">void</span> b1PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment"> * Declare a text object [page id:0,component id:1, component name: "t0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <a class="code" href="class_nex_text.html">NexText</a> t0 = <a class="code" href="class_nex_text.html">NexText</a>(0, 1, <span class="stringliteral">"t0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment"> * Declare a button object [page id:0,component id:2, component name: "b0"]. </span></div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <a class="code" href="class_nex_button.html">NexButton</a> b0 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 2, <span class="stringliteral">"b0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment"> * Declare a button object [page id:0,component id:3, component name: "b1"]. </span></div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <a class="code" href="class_nex_button.html">NexButton</a> b1 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 3, <span class="stringliteral">"b1"</span>);</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="keywordtype">char</span> buffer[100] = {0};</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="comment"> * Register object t0, b0, b1, to the touch event list. </span></div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> {</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  &t0,</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  &b0,</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  &b1,</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  NULL</div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> };</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="comment"> * Text component pop callback function. </span></div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="keywordtype">void</span> t0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> {</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  dbSerialPrintln(<span class="stringliteral">"t0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(<span class="stringliteral">"50"</span>);</div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> }</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment"> * Button0 component pop callback function.</span></div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="comment"> * In this example,the value of the text component will plus one every time when button0 is released.</span></div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> {</div>
|
||||||
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  uint16_t len;</div>
|
||||||
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  uint16_t number;</div>
|
||||||
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  </div>
|
||||||
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  dbSerialPrintln(<span class="stringliteral">"b0PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div>
|
||||||
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  t0.<a class="code" href="class_nex_text.html#a9cf417b2f25df2872492c55bdc9f5b30">getText</a>(buffer, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  </div>
|
||||||
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  number = atoi(buffer);</div>
|
||||||
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  number += 1;</div>
|
||||||
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div>
|
||||||
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  itoa(number, buffer, 10);</div>
|
||||||
|
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  </div>
|
||||||
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(buffer);</div>
|
||||||
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> }</div>
|
||||||
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div>
|
||||||
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <span class="comment"> * Button1 component pop callback function.</span></div>
|
||||||
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span> <span class="comment"> * In this example,the value of the text component will minus one every time when button1 is released.</span></div>
|
||||||
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> <span class="keywordtype">void</span> b1PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> {</div>
|
||||||
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  uint16_t len;</div>
|
||||||
|
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  uint16_t number;</div>
|
||||||
|
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  </div>
|
||||||
|
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  dbSerialPrintln(<span class="stringliteral">"b1PopCallback"</span>);</div>
|
||||||
|
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span> </div>
|
||||||
|
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  t0.<a class="code" href="class_nex_text.html#a9cf417b2f25df2872492c55bdc9f5b30">getText</a>(buffer, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  </div>
|
||||||
|
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  number = atoi(buffer);</div>
|
||||||
|
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  number -= 1;</div>
|
||||||
|
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span> </div>
|
||||||
|
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  itoa(number, buffer, 10);</div>
|
||||||
|
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  </div>
|
||||||
|
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(buffer);</div>
|
||||||
|
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span> }</div>
|
||||||
|
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span> </div>
|
||||||
|
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span> {</div>
|
||||||
|
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="comment">/* Set the baudrate which is for debug and communicate with Nextion screen. */</span></div>
|
||||||
|
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> </div>
|
||||||
|
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="comment">/* Register the pop event callback function of the current text component. */</span></div>
|
||||||
|
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  t0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(t0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> </div>
|
||||||
|
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="comment">/* Register the pop event callback function of the current button0 component. */</span></div>
|
||||||
|
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  b0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b0PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> </div>
|
||||||
|
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="comment">/* Register the pop event callback function of the current button1 component. */</span></div>
|
||||||
|
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  b1.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b1PopCallback);</div>
|
||||||
|
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> </div>
|
||||||
|
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> }</div>
|
||||||
|
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span> </div>
|
||||||
|
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> {</div>
|
||||||
|
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <span class="comment"> * When a pop or push event occured every time, </span></div>
|
||||||
|
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span> <span class="comment"> * the corresponding component[right page id and component id] in touch event list will be asked.</span></div>
|
||||||
|
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span> <span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span> }</div>
|
||||||
|
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_ga91c549e696b0ca035cf18901e6a50d5a"><div class="ttname"><a href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a></div><div class="ttdeci">void nexLoop(NexTouch *nex_listen_list[])</div><div class="ttdoc">Listen touch event and calling callbacks attached before. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00235">NexHardware.cpp:235</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html_a19589b32c981436a1bbcfe407bc766e3"><div class="ttname"><a href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">NexText::setText</a></div><div class="ttdeci">bool setText(const char *buffer)</div><div class="ttdoc">Set text attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8cpp_source.html#l00032">NexText.cpp:32</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html_a4da1c4fcdfadb7eabfb9ccaba9ecad11"><div class="ttname"><a href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">NexTouch::attachPop</a></div><div class="ttdeci">void attachPop(NexTouchEventCb pop, void *ptr=NULL)</div><div class="ttdoc">Attach an callback function of pop touch event. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8cpp_source.html#l00039">NexTouch.cpp:39</a></div></div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_button_html"><div class="ttname"><a href="class_nex_button.html">NexButton</a></div><div class="ttdoc">NexButton component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_button_8h_source.html#l00035">NexButton.h:35</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html_a9cf417b2f25df2872492c55bdc9f5b30"><div class="ttname"><a href="class_nex_text.html#a9cf417b2f25df2872492c55bdc9f5b30">NexText::getText</a></div><div class="ttdeci">uint16_t getText(char *buffer, uint16_t len)</div><div class="ttdoc">Get text attribute of component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8cpp_source.html#l00022">NexText.cpp:22</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_touch_html"><div class="ttname"><a href="class_nex_touch.html">NexTouch</a></div><div class="ttdoc">Father class of the components with touch events. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_touch_8h_source.html#l00053">NexTouch.h:53</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_text_html"><div class="ttname"><a href="class_nex_text.html">NexText</a></div><div class="ttdoc">NexText component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_text_8h_source.html#l00030">NexText.h:30</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_e79857bc4faa7405ea054e9dea791d5c.html">CompText</a></li><li class="navelem"><b>CompText_v0_32.ino</b></li>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:36 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,200 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompText_v0_32.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_text_v0_32_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompText_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>This example shows that ,when the "+" component on the Nextion screen is released, the value of text component will plus 1,when the "-" component released ,the value of text component will minus 1 every time.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>Wu Pengfei (email:<a href="#" onclick="location.href='mai'+'lto:'+'pen'+'gf'+'ei.'+'wu'+'@it'+'ea'+'d.c'+'c'; return false;">pengf<span style="display: none;">.nosp@m.</span>ei.w<span style="display: none;">.nosp@m.</span>u@ite<span style="display: none;">.nosp@m.</span>ad.c<span style="display: none;">.nosp@m.</span>c</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/7/10 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"><div class="line"></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> t0PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> b1PopCallback(<span class="keywordtype">void</span> *ptr);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Declare a text object [page id:0,component id:1, component name: "t0"]. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="_a0"></a><a class="code" href="class_nex_text.html">NexText</a> t0 = <a class="code" href="class_nex_text.html">NexText</a>(0, 1, <span class="stringliteral">"t0"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Declare a button object [page id:0,component id:2, component name: "b0"]. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="_a1"></a><a class="code" href="class_nex_button.html">NexButton</a> b0 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 2, <span class="stringliteral">"b0"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Declare a button object [page id:0,component id:3, component name: "b1"]. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a class="code" href="class_nex_button.html">NexButton</a> b1 = <a class="code" href="class_nex_button.html">NexButton</a>(0, 3, <span class="stringliteral">"b1"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">char</span> buffer[100] = {0};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Register object t0, b0, b1, to the touch event list. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a name="_a2"></a><a class="code" href="class_nex_touch.html">NexTouch</a> *nex_listen_list[] = </div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> &t0,</div>
|
||||||
|
<div class="line"> &b0,</div>
|
||||||
|
<div class="line"> &b1,</div>
|
||||||
|
<div class="line"> NULL</div>
|
||||||
|
<div class="line">};</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Text component pop callback function. </span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> t0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"t0PopCallback"</span>);</div>
|
||||||
|
<div class="line"> t0.<a name="a3"></a><a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(<span class="stringliteral">"50"</span>);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Button0 component pop callback function.</span></div>
|
||||||
|
<div class="line"><span class="comment"> * In this example,the value of the text component will plus one every time when button0 is released.</span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> b0PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> uint16_t len;</div>
|
||||||
|
<div class="line"> uint16_t number;</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"b0PopCallback"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"> t0.<a name="a4"></a><a class="code" href="class_nex_text.html#a9cf417b2f25df2872492c55bdc9f5b30">getText</a>(buffer, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> number = atoi(buffer);</div>
|
||||||
|
<div class="line"> number += 1;</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"> itoa(number, buffer, 10);</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(buffer);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * Button1 component pop callback function.</span></div>
|
||||||
|
<div class="line"><span class="comment"> * In this example,the value of the text component will minus one every time when button1 is released.</span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> b1PopCallback(<span class="keywordtype">void</span> *ptr)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> uint16_t len;</div>
|
||||||
|
<div class="line"> uint16_t number;</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"b1PopCallback"</span>);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"> t0.<a class="code" href="class_nex_text.html#a9cf417b2f25df2872492c55bdc9f5b30">getText</a>(buffer, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> number = atoi(buffer);</div>
|
||||||
|
<div class="line"> number -= 1;</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> memset(buffer, 0, <span class="keyword">sizeof</span>(buffer));</div>
|
||||||
|
<div class="line"> itoa(number, buffer, 10);</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> t0.<a class="code" href="class_nex_text.html#a19589b32c981436a1bbcfe407bc766e3">setText</a>(buffer);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="comment">/* Set the baudrate which is for debug and communicate with Nextion screen. */</span></div>
|
||||||
|
<div class="line"> <a name="a5"></a><a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> <span class="comment">/* Register the pop event callback function of the current text component. */</span></div>
|
||||||
|
<div class="line"> t0.<a name="a6"></a><a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(t0PopCallback);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> <span class="comment">/* Register the pop event callback function of the current button0 component. */</span></div>
|
||||||
|
<div class="line"> b0.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b0PopCallback);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> <span class="comment">/* Register the pop event callback function of the current button1 component. */</span></div>
|
||||||
|
<div class="line"> b1.<a class="code" href="class_nex_touch.html#a4da1c4fcdfadb7eabfb9ccaba9ecad11">attachPop</a>(b1PopCallback);</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"> dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="comment">/*</span></div>
|
||||||
|
<div class="line"><span class="comment"> * When a pop or push event occured every time, </span></div>
|
||||||
|
<div class="line"><span class="comment"> * the corresponding component[right page id and component id] in touch event list will be asked.</span></div>
|
||||||
|
<div class="line"><span class="comment"> */</span></div>
|
||||||
|
<div class="line"> <a name="a7"></a><a class="code" href="group___core_a_p_i.html#ga91c549e696b0ca035cf18901e6a50d5a">nexLoop</a>(nex_listen_list);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"></div>
|
||||||
|
</div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Thu Jan 5 2017 16:47:29 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,142 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: examples/CompTimer/CompWaveform_v0_32.ino Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li class="current"><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div id="navrow2" class="tabs2">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="files.html"><span>File List</span></a></li>
|
||||||
|
<li><a href="globals.html"><span>File Members</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_timer_2_comp_waveform__v0__32_8ino_source.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompWaveform_v0_32.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||||
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include "<a class="code" href="_nextion_8h.html">Nextion.h</a>"</span></div>
|
||||||
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div>
|
||||||
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#define LEVEL_HIGH (30)</span></div>
|
||||||
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#define LEVEL_LOW (0)</span></div>
|
||||||
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||||
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#define CH0_OFFSET (40 - LEVEL_HIGH/2)</span></div>
|
||||||
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#define CH1_OFFSET (CH0_OFFSET + 40 * 1)</span></div>
|
||||||
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#define CH2_OFFSET (CH0_OFFSET + 40 * 2)</span></div>
|
||||||
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#define CH3_OFFSET (CH0_OFFSET + 40 * 3)</span></div>
|
||||||
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div>
|
||||||
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||||
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <a class="code" href="class_nex_waveform.html">NexWaveform</a> s0 = <a class="code" href="class_nex_waveform.html">NexWaveform</a>(0, 1, <span class="stringliteral">"s0"</span>);</div>
|
||||||
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||||
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="keyword">static</span> uint8_t ch0_data = LEVEL_LOW;</div>
|
||||||
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keyword">static</span> uint8_t ch1_data = LEVEL_LOW;</div>
|
||||||
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="keyword">static</span> uint8_t ch2_data = LEVEL_LOW;</div>
|
||||||
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="keyword">static</span> uint8_t ch3_data = LEVEL_LOW;</div>
|
||||||
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div>
|
||||||
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="keywordtype">void</span> setup(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> {</div>
|
||||||
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <a class="code" href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a>();</div>
|
||||||
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  dbSerialPrintln(<span class="stringliteral">"setup done"</span>);</div>
|
||||||
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> }</div>
|
||||||
|
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||||
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="keywordtype">void</span> loop(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> {</div>
|
||||||
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keyword">static</span> uint32_t started = 0;</div>
|
||||||
|
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="keywordflow">if</span> (millis() - started >= 2000)</div>
|
||||||
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  {</div>
|
||||||
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  started = millis(); </div>
|
||||||
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keywordflow">if</span> (LEVEL_HIGH == ch0_data)</div>
|
||||||
|
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  {</div>
|
||||||
|
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  ch0_data = LEVEL_LOW;</div>
|
||||||
|
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  }</div>
|
||||||
|
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keywordflow">else</span></div>
|
||||||
|
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  {</div>
|
||||||
|
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  ch0_data = LEVEL_HIGH;</div>
|
||||||
|
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  }</div>
|
||||||
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  }</div>
|
||||||
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  </div>
|
||||||
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  ch1_data = ch0_data + random(0, 2);</div>
|
||||||
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  ch2_data = ch0_data + random(0, 5);</div>
|
||||||
|
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  ch3_data = ch0_data + random(0, 8);</div>
|
||||||
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  </div>
|
||||||
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  s0.<a class="code" href="class_nex_waveform.html#a5b04ea7397b784947b845e2a03fc77e4">addValue</a>(0, CH0_OFFSET + ch0_data);</div>
|
||||||
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  s0.<a class="code" href="class_nex_waveform.html#a5b04ea7397b784947b845e2a03fc77e4">addValue</a>(1, CH1_OFFSET + ch1_data);</div>
|
||||||
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  s0.<a class="code" href="class_nex_waveform.html#a5b04ea7397b784947b845e2a03fc77e4">addValue</a>(2, CH2_OFFSET + ch2_data);</div>
|
||||||
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  s0.<a class="code" href="class_nex_waveform.html#a5b04ea7397b784947b845e2a03fc77e4">addValue</a>(3, CH3_OFFSET + ch3_data);</div>
|
||||||
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  </div>
|
||||||
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> }</div>
|
||||||
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> </div>
|
||||||
|
<div class="ttc" id="group___core_a_p_i_html_gab09ddba6b72334d30ae091a7b038d790"><div class="ttname"><a href="group___core_a_p_i.html#gab09ddba6b72334d30ae091a7b038d790">nexInit</a></div><div class="ttdeci">bool nexInit(void)</div><div class="ttdoc">Init Nextion. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_hardware_8cpp_source.html#l00220">NexHardware.cpp:220</a></div></div>
|
||||||
|
<div class="ttc" id="class_nex_waveform_html_a5b04ea7397b784947b845e2a03fc77e4"><div class="ttname"><a href="class_nex_waveform.html#a5b04ea7397b784947b845e2a03fc77e4">NexWaveform::addValue</a></div><div class="ttdeci">bool addValue(uint8_t ch, uint8_t number)</div><div class="ttdoc">Add value to show. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_waveform_8cpp_source.html#l00022">NexWaveform.cpp:22</a></div></div>
|
||||||
|
<div class="ttc" id="_nextion_8h_html"><div class="ttname"><a href="_nextion_8h.html">Nextion.h</a></div><div class="ttdoc">The header file including all other header files provided by this library. </div></div>
|
||||||
|
<div class="ttc" id="class_nex_waveform_html"><div class="ttname"><a href="class_nex_waveform.html">NexWaveform</a></div><div class="ttdoc">NexWaveform component. </div><div class="ttdef"><b>Definition:</b> <a href="_nex_waveform_8h_source.html#l00029">NexWaveform.h:29</a></div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_13cb27e7707bad7dfc51e3225831c378.html">examples</a></li><li class="navelem"><a class="el" href="dir_ca98f8e97468ceedc413f5dac34c5fa4.html">CompTimer</a></li><li class="navelem"><b>CompWaveform_v0_32.ino</b></li>
|
||||||
|
<li class="footer">Generated on Thu Jan 5 2017 17:05:52 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,84 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.8.7"/>
|
||||||
|
<title>Documentation: CompTimer.ino</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="resize.js"></script>
|
||||||
|
<script type="text/javascript" src="navtree.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(initResizable);
|
||||||
|
$(window).load(resizeHeight);
|
||||||
|
</script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr style="height: 56px;">
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="Logo.png"/></td>
|
||||||
|
<td style="padding-left: 0.5em;">
|
||||||
|
<div id="projectname">Documentation
|
||||||
|
</div>
|
||||||
|
<div id="projectbrief">For Arduino users</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.8.7 -->
|
||||||
|
<div id="navrow1" class="tabs">
|
||||||
|
<ul class="tablist">
|
||||||
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
||||||
|
<li><a href="pages.html"><span>Related Pages</span></a></li>
|
||||||
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
||||||
|
<li><a href="annotated.html"><span>Classes</span></a></li>
|
||||||
|
<li><a href="files.html"><span>Files</span></a></li>
|
||||||
|
<li><a href="examples.html"><span>Examples</span></a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||||
|
<div id="nav-tree">
|
||||||
|
<div id="nav-tree-contents">
|
||||||
|
<div id="nav-sync" class="sync"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||||||
|
class="ui-resizable-handle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){initNavTree('_comp_timer_8ino-example.html','');});
|
||||||
|
</script>
|
||||||
|
<div id="doc-content">
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle">
|
||||||
|
<div class="title">CompTimer.ino</div> </div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<dl class="section user"><dt>How to Use</dt><dd>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.</dd></dl>
|
||||||
|
<dl class="section author"><dt>Author</dt><dd>huang xianming (email:<a href="#" onclick="location.href='mai'+'lto:'+'xia'+'nm'+'ing'+'.h'+'uan'+'g@'+'ite'+'ad'+'.cc'; return false;">xianm<span style="display: none;">.nosp@m.</span>ing.<span style="display: none;">.nosp@m.</span>huang<span style="display: none;">.nosp@m.</span>@ite<span style="display: none;">.nosp@m.</span>ad.cc</a>) </dd></dl>
|
||||||
|
<dl class="section date"><dt>Date</dt><dd>2015/8/25 2016/12/25 bring HMI up to v0.32 to avoid too old issues by Patrick Martin, no other changes made </dd></dl>
|
||||||
|
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. <br />
|
||||||
|
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.</dd></dl>
|
||||||
|
<div class="fragment"></div><!-- fragment --> </div><!-- contents -->
|
||||||
|
</div><!-- doc-content -->
|
||||||
|
<!-- start footer part -->
|
||||||
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
|
<ul>
|
||||||
|
<li class="footer">Generated on Fri Jan 6 2017 14:00:35 for Documentation by
|
||||||
|
<a href="http://www.doxygen.org/index.html">
|
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.7 </li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue