BRLAB DOCS
HomeTutorialsHardware
Control Relays with the Nextion HMI and Arduino
Control Relays with the Nextion HMI and Arduino
  • Introduction
  • GETTING STARTED
    • What You Will Need
    • Wiring
  • HMI GUI
    • Nextion HMI Setup
    • GUI Design
    • HMI Code
    • Load Code on the HMI
  • NANO EVERY CODE
    • Task to Complete
    • Writing the Code
      • Comment Header
      • Define Global Variables
      • void setup()
      • void loop()
      • void serial_input()
    • Application Code
    • Files
Powered by GitBook
On this page
  1. NANO EVERY CODE
  2. Writing the Code

Comment Header

Its helpful to include details about the code you wrote in a comment header. That way if you come back in a few months or years later to either reuse or make changes you can remember exactly what the code you wrote does.

/*
Title: Control Relays with Nextion HMI
Written By: (Place your name here)
Date: 03/11/2023

Description:
This code can read messages from the Nextion HMI over serial. 
The code will then turn these messages into commands for the Arduino
Nano Every to perfrom. Thus turning on or off the 2 relays based on
the state of the switch widgets on the HMI.

*/
PreviousWriting the CodeNextDefine Global Variables

Last updated 2 years ago