Skip to content

support for other main boards based on Arduino like z-uno (http://z-uno.z-wave.me/) #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 113 commits into
base: old_discarded
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
7d9afd1
New Nextion Begin.
Jul 15, 2015
9713823
Update README.md
Jul 15, 2015
8405fec
English HMI project version edit ok
zhangabc Jul 15, 2015
eaad704
add note to all files
zhangabc Jul 16, 2015
f43f8f8
Add doc and doxygen config file.
zhangabc Jul 16, 2015
fe923a8
doc is generated ok,no error
zhangabc Jul 16, 2015
2104317
online API release
zhangabc Jul 16, 2015
0bde200
add NexSerialConfig.h
zhangabc Jul 16, 2015
9294653
edit readme.md
zhangabc Jul 16, 2015
6bfe006
new function add ok
zhangabc Jul 17, 2015
ba181ad
UNO lib is work normal
zhangabc Jul 20, 2015
fc7aa0f
node is ok
zhangabc Jul 20, 2015
2846374
new function add ok
zhangabc Jul 20, 2015
55f6cd8
debug serial maco edit
zhangabc Jul 27, 2015
d9007f5
edit readme,edit macro for enable/disable debug serial
zhangabc Jul 27, 2015
620345f
fix spelling mistakes
zhangabc Jul 28, 2015
ded12eb
Remove while(true) in nexLoop API. Remove example's dbSerial info.
Jul 29, 2015
8c0d6ad
Rename class name NexSlice to NexCrop.
Jul 29, 2015
0b37683
update document
zhangabc Jul 29, 2015
d307735
update document
zhangabc Jul 29, 2015
2ba034b
Update readme.md
Jul 30, 2015
03301a5
Update readme.md
Jul 30, 2015
be00d09
Update readme.md
Jul 30, 2015
cba2cce
Update dbSerial.
Jul 30, 2015
22c3a96
Disable some unusable APIs.
Jul 30, 2015
68cd0d0
Update readme.md
Jul 30, 2015
d05a857
update document about UNO
zhangabc Jul 30, 2015
e911e8e
respair readme error ----> nexserial
zhangabc Jul 30, 2015
91d7cdb
add blog link to readme
zhangabc Jul 30, 2015
e9ebdd1
Added support for Nextion Editor v0.26 bkcmd=1 at startup.
Aug 11, 2015
093cc0b
Update some HMI projects of examples.
Aug 11, 2015
f8bc04e
Add class NexSlider and example.
Aug 11, 2015
394e816
Add Waveform class and example.
Aug 11, 2015
74bf2bc
Rename NexPointer class as NexGauge and other minor changes.
Aug 12, 2015
32a2652
Update Waveform example.
Aug 12, 2015
0786cf7
Changed nex serial rx buffer size from 256 to 64 for saving ram.
Aug 12, 2015
3ffabaa
Change structure of Classes.
Aug 12, 2015
ec21d9d
Fixed sytax error.
Aug 12, 2015
d8e5d01
Update minor things.
Aug 12, 2015
0d2088f
Add Nextion.h only one header.
Aug 12, 2015
42c9f10
Add Nextion.h for all examples.
Aug 12, 2015
04ec064
Update doc.
Aug 12, 2015
c3c9807
Add Nextion Module in API doc.
Aug 12, 2015
ced5da9
Modified:char *name to const char *name in all constructors.
Aug 13, 2015
88290e6
Modified: class tree structure.
Aug 13, 2015
f8e9b4e
Update docs
Aug 13, 2015
050b9ab
Update doc
Aug 14, 2015
98850de
Update doc of file comments.
Aug 14, 2015
6d8006c
Update comments.
Aug 14, 2015
8776da8
Deleted NexCid and NexPid.
Aug 14, 2015
14240e1
Deleted NexEventType.
Aug 14, 2015
763a2e3
Updated comments of NexObject.
Aug 14, 2015
1b8b1d8
Update doc.
Aug 14, 2015
4ca5031
Update doc.
Aug 14, 2015
7e1fbe1
Update docs.
Aug 14, 2015
2997884
Update docs.
Aug 14, 2015
9f7679c
Update README.md
Aug 14, 2015
bd27952
Update README.md
Aug 17, 2015
69dc52a
Update docs.
Aug 17, 2015
0c2301d
Update docs
Aug 17, 2015
087130b
Update docs
Aug 17, 2015
83af2e0
Update README.md and Added release_notes.md
Aug 18, 2015
1134f42
Update readme.md
Aug 18, 2015
78eb3bc
Update readme.md
Aug 18, 2015
2040d91
Update release_notes.md
Aug 18, 2015
ccacb56
Update readme.md
Aug 18, 2015
71978c9
Update readme.md
Aug 18, 2015
73a7726
Update docs for prerelease of v0.26.
Aug 18, 2015
2e268a4
Release first version:0.7.0
Aug 20, 2015
9cb4824
add note for arduino example
zhangabc Aug 24, 2015
1886005
add NexTimer
huangxianming Aug 26, 2015
bbcf8cb
change a little(NexButton->NexTimer)
huangxianming Aug 26, 2015
652520a
(__NEXBUTTON_H__)->(__NEXTIMER_H__)
huangxianming Aug 26, 2015
6f7560d
note change (the cycle value must be greater than 50)
huangxianming Aug 27, 2015
2444d02
Update version.txt
Aug 27, 2015
26dc361
add note for CompText.ino
zhangabc Sep 2, 2015
769378f
add NexNumber
huangxianming Nov 10, 2015
b84e91a
add dual state button component support
huangxianming Nov 11, 2015
be7c29b
add download API and download example
yzjczp Apr 6, 2016
7b413aa
modify example
yzjczp Apr 6, 2016
f899bae
add macro USE_SOFTWARE_SERIAL
yzjczp Apr 6, 2016
d3c7a02
modify comment and modify example name
yzjczp Apr 6, 2016
f5e38b5
Merge pull request #12 from cszp17/master
Apr 6, 2016
989c220
modify library name to upload
yzjczp Apr 20, 2016
01699c3
modify example *.h file
yzjczp Apr 20, 2016
5d505d5
Merge pull request #13 from cszp17/master
Apr 20, 2016
d6c42db
add api for button
hxming123456 Sep 26, 2016
f104dd8
Add functions for new items based on the IDE.
hxming123456 Sep 27, 2016
3109644
keep origin API
hxming123456 Sep 30, 2016
820e1ce
keep origin API too
hxming123456 Sep 30, 2016
1781d88
updata class index
hxming123456 Oct 10, 2016
a02acca
Organize the annotation
hxming123456 Oct 11, 2016
b4f8330
Organize the annotation again
hxming123456 Oct 11, 2016
68bf0cf
Merge pull request #19 from hxming123456/update_items_based_on_ide
Oct 11, 2016
ffb6b9c
Version 0.9.0
Oct 11, 2016
4f6f614
Update readme.md
Oct 11, 2016
92b7f4c
Added Release Notes for v0.9.0
Oct 11, 2016
c38a234
Update readme.md to use proper "AS IS" MIT License (MIT)
Hedda Oct 11, 2016
35b4d37
Add a proper "AS IS" MIT License (MIT)
Hedda Oct 11, 2016
879341c
Update NexHardware.cpp
zarya Nov 2, 2016
bb09f20
add gpio and rtc function
hxming123456 Nov 28, 2016
ee26de2
add gpio and rtc function
hxming123456 Nov 28, 2016
099c710
Merge pull request #22 from zarya/master
Nov 28, 2016
79763d4
Merge pull request #20 from Hedda/patch-2
Nov 28, 2016
6a61466
Merge pull request #21 from Hedda/patch-3
Nov 28, 2016
1b3afa9
update doc
hxming123456 Dec 1, 2016
bf370db
add gpio and rtc example
hxming123456 Dec 8, 2016
a5f7da5
Merge branch 'master' into update_items_based_on_ide
hxming123456 Dec 8, 2016
5f65df5
update example doc
hxming123456 Dec 8, 2016
e26f025
Merge pull request #29 from hxming123456/update_items_based_on_ide
Jan 5, 2017
19fbe31
update example and doc
hxming123456 Jan 5, 2017
268d352
update example version and doc
hxming123456 Jan 6, 2017
5a5cf0a
Merge pull request #34 from hxming123456/update_items_based_on_ide
Jan 6, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
351 changes: 351 additions & 0 deletions NexButton.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,351 @@
/**
* @file NexButton.cpp
*
* The implementation of class NexButton.
*
* @author Wu Pengfei (email:<[email protected]>)
* @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();
}
Loading