Last active
October 3, 2023 08:26
-
-
Save MMMZZZZ/1e57e81bdf9324e5573fd808ef6f1658 to your computer and use it in GitHub Desktop.
Nextion Simulator Detection and Startup Messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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