I'm using your example code to stop and start a pulse motor that the Arduino MEGA runs. Your code is simple as Panali mentionned. Eventually it will be a 3phases PMSM... Just learning right now!
i have on situation.... i using two page. in the 2 page i use the dual state button. if i change the state of the button from OFF to ON and back to the page 1, when i back again to the page 2, the button state is not keep the state, button state is off. why?
Thank you for the easy-to-understand Tutorial. I have something to ask you. Could you give me any good ideas? My goal is to display the Arduino EEPROM stored values in a box (x0.val) on a particular page. I'm stumbling right now, I don't know how to get the page ID currently displayed on the TFT screen. Could you please teach me?
😮Hello. Your code works well for one dual state switch. However it won’t work for multiple dual state switches on one page or dual state switches on several pages. I’ve tried the following code on an Arduino 2560 but it doesn’t turn on the built-in LED on the Arduino board (pin 13). I'm using a dual state button with this. Any help would be appreciated. #include "Nextion.h" int ledPin = 13; NexDSButton bt0 = NexDSButton(2, 9, "bt0"); uint32_t dual_state=0; void setup(void){ nexInit(); pinMode(ledPin, OUTPUT); } void loop(void){ bt0.getValue(&dual_state); delay(200); if(dual_state==1) { digitalWrite(ledPin, HIGH); } else if(dual_state==0) { digitalWrite(ledPin, LOW); } }
Hello Sir, Hope you are doing well. Please let me know is it possible to proceed same project with Raspberry Pi Pico ? If yes please make a toturial on it. Thanks
Good evening, excellent project but this error appears to me: print bt0.val if bt0.val == 1 { t0.txt = "LED ON"} else if (bt0.val == 0) { t0.txt = "LED OFF"} SYNTAX ERROR :EXTRA "{{( appears. Can you tell me what to do thanks
Probably not helpful to you now, but in the debug panel there's an option in the bottom left corner called User MCU input. This brings up a COM port selector tool. From there I'm sure you could hook in an arduino or even just simulate an arduino using PUTTY
Pete. Hi Saravanan. i am new to this Arduino Program. Trying to run your code but keep getting error message ( EXPECTED INITIALIZER BEFORE NUMERIC CONSTANT )
let me know if it works #define SWITCH_ON 1 #define SWITCH_OFF 0 const int led = 12; byte received_data[4]; int switch_pos; void setup() { // put your setup code here, to run once: Serial.begin(9600); Serial.println("ready"); pinMode(led,OUTPUT); digitalWrite(led, LOW); } void loop() { // put your main code here, to run repeatedly: int i; while (Serial.available() > 0) { switch_control(); } } void switch_control() { int size = Serial.readBytesUntil(' ', received_data, 4); // First Byte has the switch position data switch_pos = received_data[0]; Serial.print("SWITCH:"); if (switch_pos == SWITCH_ON) { Serial.println("ON"); digitalWrite(led, HIGH); } else if (switch_pos == SWITCH_OFF) { Serial.println("OFF"); digitalWrite(led, LOW); } }
Morning sir AL, with Nexion software it's possible to dowload a project from display to computer for make some modifications ? Example text, color, ecc. Thanks
Excellent and simple. Good product demo.Can you please extend the project for practical application like home device control or as security application.
I use it to show the RPM, frequency of a pulse motor. Also instaured a dual button to start and stop the pulse motor. The pulse motor was in part 3D printed and salvage a relay coil that I modified to adapt as a stator coil to my 3D pulse motor. Regards.
hello sir , i love your videos. but can you make a program similar to this but using software serial instead of rx tx in the arduino?? that would be more helpfull thanks :)
But this is a very bad solution , because you never send the id of the button to the microproccessor , whath happens if you have two buttons ? how can you detect from wich button send the command? do the same with 3 buttons ... and you see what i talking about....Thanks
Hi there! i really like all your Nextion display video thank you ! it really help on some of my project, is there any way that i can message u when i face any coding problem? email
Thank you for your efforts, we'll explained and demonstrated, greatly appreciated 🙏
Great video! I can now use a duel state button on my project. Thank you!
Let me go ahead and leave a like for this straightforward tutorial
I learned something, so I clicked thumps-up. Thanks.
I'm using your example code to stop and start a pulse motor that the Arduino MEGA runs. Your code is simple as Panali mentionned. Eventually it will be a 3phases PMSM... Just learning right now!
do you have example use more than 1 button?
sir nextion or dwin is better display
Nice project. Very good
nice example
but what should I do if I want to have similar such buttons??
i have on situation.... i using two page. in the 2 page i use the dual state button. if i change the state of the button from OFF to ON and back to the page 1, when i back again to the page 2, the button state is not keep the state, button state is off. why?
Thank you for the easy-to-understand Tutorial. I have something to ask you. Could you give me any good ideas? My goal is to display the Arduino EEPROM stored values in a box (x0.val) on a particular page. I'm stumbling right now, I don't know how to get the page ID currently displayed on the TFT screen. Could you please teach me?
Very useful video thank you sir
😮Hello. Your code works well for one dual state switch. However it won’t work for multiple dual state switches on one page or dual state switches on several pages. I’ve tried the following code on an Arduino 2560 but it doesn’t turn on the built-in LED on the Arduino board (pin 13). I'm using a dual state button with this. Any help would be appreciated.
#include "Nextion.h"
int ledPin = 13;
NexDSButton bt0 = NexDSButton(2, 9, "bt0");
uint32_t dual_state=0;
void setup(void){
nexInit();
pinMode(ledPin, OUTPUT);
}
void loop(void){
bt0.getValue(&dual_state);
delay(200);
if(dual_state==1)
{
digitalWrite(ledPin, HIGH);
}
else if(dual_state==0)
{
digitalWrite(ledPin, LOW);
}
}
How to add one or two more buttons to a sketch, please?
Very very nice.... Regards to you 👍
Hello Sir,
Hope you are doing well.
Please let me know is it possible to proceed same project with Raspberry Pi Pico ?
If yes please make a toturial on it.
Thanks
Very helpfull video.Thank you
Sir,
Please make a video on Nextion display sleep and wake mode
Very nice. What if I have two switches. How Arduino is going to distinguish, which is on and which is off.
Hi will you consider to look at the DWIN display?kindly send me an email or message referring to my banner contact info.
Whu did yo put ") " in else if statement..?
The coding that is used in the editor. What language is it?
Good evening, excellent project but this error appears to me:
print bt0.val
if bt0.val == 1
{
t0.txt = "LED ON"}
else if (bt0.val == 0)
{
t0.txt = "LED OFF"}
SYNTAX ERROR :EXTRA "{{( appears. Can you tell me what to do thanks
Signor Savaranan,gentilmente puo' rispondere alla mia domanda?.Grazie
It is possible to do it without the screen? I mean, just from the debug mode simulation, connecting the computer to the Arduino
Probably not helpful to you now, but in the debug panel there's an option in the bottom left corner called User MCU input. This brings up a COM port selector tool. From there I'm sure you could hook in an arduino or even just simulate an arduino using PUTTY
Pete.
Hi Saravanan.
i am new to this Arduino Program.
Trying to run your code but keep getting error message ( EXPECTED INITIALIZER BEFORE NUMERIC CONSTANT )
let me know if it works
#define SWITCH_ON 1
#define SWITCH_OFF 0
const int led = 12;
byte received_data[4];
int switch_pos;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("ready");
pinMode(led,OUTPUT);
digitalWrite(led, LOW);
}
void loop() {
// put your main code here, to run repeatedly:
int i;
while (Serial.available() > 0) {
switch_control();
}
}
void switch_control() {
int size = Serial.readBytesUntil('
', received_data, 4);
// First Byte has the switch position data
switch_pos = received_data[0];
Serial.print("SWITCH:");
if (switch_pos == SWITCH_ON) {
Serial.println("ON");
digitalWrite(led, HIGH);
} else if (switch_pos == SWITCH_OFF) {
Serial.println("OFF");
digitalWrite(led, LOW);
}
}
Did you ever figure this out Pete?
Morning sir AL, with Nexion software it's possible to dowload a project from display to computer for make some modifications ? Example text, color, ecc. Thanks
Hi will you consider to look at the DWIN display?kindly send me an email or message referring to my banner contact info.
Excellent and simple.
Good product demo.Can you please extend the project for practical application like home device control or as security application.
I use it to show the RPM, frequency of a pulse motor. Also instaured a dual button to start and stop the pulse motor. The pulse motor was in part 3D printed and salvage a relay coil that I modified to adapt as a stator coil to my 3D pulse motor.
Regards.
I used it to make a "dark mode" switch for my wather station project. The limits are in your imagination.
Thanks alot sir
hello sir , i love your videos. but can you make a program similar to this but using software serial instead of rx tx in the arduino?? that would be more helpfull thanks :)
Comprei um celular,já faz 1mês e não chegou,e me cobraram também 77 90não sei de que
Hi can not get to UPLOAD to my Arduino UNO.
Can anybody help with this project.
Thanks
you have the answer in the post below.
let me know if it works
А у нас выключатели включаются в верх а в низ выключаются.
link is down
i nned link driver ch340
But this is a very bad solution , because you never send the id of the button to the microproccessor , whath happens if you have two buttons ? how can you detect from wich button send the command? do the same with 3 buttons ... and you see what i talking about....Thanks
No problem, every button have other ID...
Hello, I ran into this problem. I don't know how to fix the problem.
@@jokkiossaka3306 help me
@@kritsadaonkhong3148 Hi will you consider to look at the DWIN display?kindly send me an email or message referring to my banner contact info.
Hi there! i really like all your Nextion display video thank you ! it really help on some of my project, is there any way that i can message u when i face any coding problem? email