author
4Comments

Tell us about yourself!

Complete Your Profile
  • Make Your Own High Quality CO2 Lasercutter! With Touch Control!

    Waw man, great work! Industry is searching for guys like you. Keep these comments as references, but I doubt you will need them. Good luck with the carreer!

    View Instructable »
  • Getting Started With Nextion and Arduino Uno

    Hi, Hm... I suspect somewhere that the problem is in the Nextion LCD or configuration (with nextion editor)... but I ordered my Nextion 7" 1 week ago, and I will receive it within 1-2 weeks. Maybe there is some small difference with the 4,2" I'm using at the moment. I will be happy to try it out then.1/Did you measure the 5V on the display. is it really 5Vdc?: I noticed ( and is commonly known) that they are sensible to low voltage. I got problems because my voltage was 4,8V ( slow or no reaction).2/ I suppose that the grounds of mega and nextion are connected with each other?Best regardsKarl

    I used an 'case' statement. Every button sent its code, and here I defined the actions to do per button.grkarl

    View Instructable »
  • KarlL35 completed the lesson Fats in the class Science of Baking2 years ago
  • Getting started with Nextion and Arduino Uno

    Ho Gideon, Works great! I made some changes to use it with the Mega. I bumped into some limitations of the Itead library ( global variables and lots and lots of lines). This is right to the point and lots easier. Finally I like the Nextion display./*Changes to use it with the MEGA *///#include <SoftwareSerial.h> //Include the librarybool button = false; //will store the button state//SoftwareSerial mySerial(10, 11); // RX, TXString message;void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); //open the serial port //while (!Serial2) { ; // wait for serial port to connect. Needed for native USB port only Serial.println("Serial On"); pinMode(13, OUTPUT); // set the data rate for the SoftwareSerial port Serial2.begin(9600);}v...

    see more »

    Ho Gideon, Works great! I made some changes to use it with the Mega. I bumped into some limitations of the Itead library ( global variables and lots and lots of lines). This is right to the point and lots easier. Finally I like the Nextion display./*Changes to use it with the MEGA *///#include <SoftwareSerial.h> //Include the librarybool button = false; //will store the button state//SoftwareSerial mySerial(10, 11); // RX, TXString message;void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); //open the serial port //while (!Serial2) { ; // wait for serial port to connect. Needed for native USB port only Serial.println("Serial On"); pinMode(13, OUTPUT); // set the data rate for the SoftwareSerial port Serial2.begin(9600);}void loop() { // run over and over while (!Serial2.available()){ //While no data is coming in from the Nextion if (message.length() > 14){ //This was the easiest way for me to check that the whole message has been received. Some messages might be longer, but the shortest ones are 15 characters. Serial.println(message); //See what the entire message that the Arduino receives from the Nextion Serial.print("button state: "); Serial.println(button); //See what state the button is in Serial.print("message[3]: "); //according to the Nextion message structure, item 4 will be the page number. Serial.println(message[3]); //See what message[3] (the fourth character in the message) is Serial.print("message[4]: "); //according to the Nextion message structure, item5 will be the component number. Serial.println(message[4]); //See what message[4] (the fifth character in the message) is if (button == false && message[3] == '0' && message[4] == '1' ){ //Test that the button is off and that it was indeed this button that has been pressed button = true; //The button is now pressed digitalWrite(13, HIGH); //Switch on the led Serial.println("case 1"); //For debugging. Check that the 'if' was entered message = ""; //Clear the message, otherwise the next if will also be activated } else{ //Else the button is on and that it was indeed this button that has been pressed button = false; //The button has been deactivated digitalWrite(13, LOW); //Switch the led off Serial.println("case 2"); //For debugging. Check that the 'if' was entered message = ""; //Clear the message, otherwise we might get mixed messages } } } while (Serial2.available()){ //Is data coming through the serial from the Nextion? message.concat(Serial2.read()); //If so, construct the message } }

    View Instructable »
  • KarlL35 followed robots, electronics, cars, arduino and 6 others channel 2 years ago