chipmc / Serial-Communications-Demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Serial-Communications-Demo

This firmware project was created using Particle Developer Tools and is compatible with all Particle Devices.

Feel free to replace this README.md file with your own content, or keep it for reference.

Table of Contents

Introduction

For an in-depth understanding of this project template, please refer to our documentation.

Prerequisites To Use This Repository

To use this software/firmware on a device, you'll need:

  • A Particle Device.
  • Windows/Mac/Linux for building the software and flashing it to a device.
  • Particle Development Tools installed and set up on your computer.
  • Optionally, a nice cup of tea (and perhaps a biscuit).

Getting Started

  1. While not essential, we recommend running the device setup process on your Particle device first. This ensures your device's firmware is up-to-date and you have a solid baseline to start from.

  2. If you haven't already, open this project in Visual Studio Code (File -> Open Folder). Then compile and flash your device. Ensure your device's USB port is connected to your computer.

  3. Verify the device's operation by monitoring its logging output:

    • In Visual Studio Code with the Particle Plugin, open the command palette and choose "Particle: Serial Monitor".
    • Or, using the Particle CLI, execute:
    particle serial monitor --follow
    
  4. Uncomment the code at the bottom of the cpp file in your src directory to publish to the Particle Cloud! Login to console.particle.io to view your devices events in real time.

  5. Customize this project! For firmware details, see Particle firmware. For information on the project's directory structure, visit this link.

Particle Firmware At A Glance

Logging

The firmware includes a logging library. You can display messages at different levels and filter them:

Log.trace("This is trace message");
Log.info("This is info message");
Log.warn("This is warn message");
Log.error("This is error message");

Setup and Loop

Particle projects originate from the Wiring/Processing framework, which is based on C++. Typically, one-time setup functions are placed in setup(), and the main application runs from the loop() function.

For advanced scenarios, explore our threading support.

Delays and Timing

By default, the setup() and loop() functions are blocking whilst they run, meaning that if you put in a delay, your entire application will wait for that delay to finish before anything else can run.

For techniques that allow you to run multiple tasks in parallel without creating threads, checkout the code example here.

(Note: Although using delay() isn't recommended for best practices, it's acceptable for testing.)

Testing and Debugging

For firmware testing and debugging guidance, check this documentation.

GitHub Actions (CI/CD)

This project provides a YAML file for GitHub, automating firmware compilation whenever changes are pushed. More details on Particle GitHub Actions are available.

OTA

To learn how to utilize Particle's OTA service for device updates, consult this documentation.

Test OTA with the 'Particle: Cloud Flash' command in Visual Studio Code or the CLI command 'particle flash'!

This firmware supports binary assets in OTA packages, allowing the inclusion of audio, images, configurations, and external microcontroller firmware. More details are here.

Support and Feedback

For support or feedback on this template or any Particle products, please join our community!

Version

Template version 1.0.2

About


Languages

Language:C++ 100.0%