This is the new version of my old website. You can find the old website here: old.dl2sba.com. If you miss any information or you find bugs, please let me know by E-Mail

The original library from Dan is not working as expected for me. So I adopted the code a little bit.

You can find the changes below. You can also download "my version" of the library here. Unzip into the Arduino's library folder.

 INextionWidget.cpp

bool INextionWidget::sendCommand(char *commandStr, bool checkComplete) {
  // if (m_pageID != m_nextion.getCurrentPage()) return false;

  m_nextion.sendCommand(commandStr);

  if (checkComplete)
    return m_nextion.checkCommandComplete();
  else
    return true;
}

Nextion.cpp

/*!
 * \brief Initialises the device.
 * \return True if initialisation was successful.
 */
bool Nextion::init()
{
  while ( m_serialPort.read() != -1 ) ;

  sendCommand("");

  sendCommand("bkcmd=0");
  bool result1 = checkCommandComplete();

  sendCommand("page 0");
  bool result2 = checkCommandComplete();

  return (result1 && result2);
}

/*!
 * \brief Checks if the last command was successful.
 * \return True if command was successful
 */
bool Nextion::checkCommandComplete() {
  return true;
}

(c) Dietmar Krause, DL2SBA 2026 Impressum Datenschutz
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Quantcast
Save