Skip to content

Instantly share code, notes, and snippets.

@MMMZZZZ
Last active October 3, 2023 08:26
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MMMZZZZ/1e57e81bdf9324e5573fd808ef6f1658 to your computer and use it in GitHub Desktop.
Save MMMZZZZ/1e57e81bdf9324e5573fd808ef6f1658 to your computer and use it in GitHub Desktop.
Nextion Simulator Detection and Startup Messages
// Copyright 2021 Max Zuidberg
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
// If a copy of the MPL was not distributed with this file, You can obtain one at
// https://mozilla.org/MPL/2.0/.
//
// The MPL is easy to comply with as described here:
// https://tldrlegal.com/license/mozilla-public-license-2.0-(mpl-2)
// Tested with Nexton Editor v1.63.3. Might not work with future versions.
// Set baudrate in case its wrong.
if(bauds!=115200)
{
bauds=115200
if(bauds!=115200)
{
// bauds will always return 9600 in the Nextion Editor/Simulator. Hence we enter this
// section only if we are running within the simulator.
// The simulator does not send the startup messages that Nextion devices send.
// Since the MCU may rely on them, we do it manually here. Depending on your setup
// you might want to add delays for a more realistic simulation of your device.
//
// Power Up
printh 00 00 00 ff ff ff
//
// Ready
printh 88 ff ff ff
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment