Examples and Tutorials

From Flowcode Help
Jump to navigationJump to search

This page provides a comprehensive set of resources to help users get started with Flowcode across multiple platforms, including ESP32, PIC, and Arduino Uno. The page features a variety of beginner-level examples that guide users through controlling sensors, displays, motors, and communication protocols, allowing for a hands-on introduction to embedded systems development.

In addition to microcontroller-focused examples, the page also offers tutorials for web development, PC applications, and Raspberry Pi integration. Projects range from simple flashing patterns and motor control to advanced topics like signal processing, temperature monitoring, and graphical display interfaces.

These examples make it easy for beginners to explore Flowcode's capabilities while also providing the flexibility for advanced users to delve into specific hardware and software integrations. Real-world scenarios such as traffic light control, CNC machines, and MQTT communication further illustrate Flowcode’s application in practical projects.

Flowcode’s platform-agnostic approach ensures users can seamlessly work across ESP, PIC16, and Arduino, with support for Matrix's EBlocks programmers for each platform.

Beginner Examples

ESP32

These ESP32 Flowcode example projects provide a hands-on introduction to working with various sensors, displays, and control mechanisms using the ESP32 platform.
From testing motor functionality to interacting with I2C components and creating simple flashing patterns, these examples are ideal for beginners looking to explore embedded systems development with ESP32.

These will also work with Matrix's EBlocks ESP32 Programmer.

Flasher - ESP32

This example creates a basic flashing LED pattern, controlled by the ESP32.
FC6 Icon.png Flasher - ESP

Counter - ESP32

A simple counter program that increments values based on input signals using the ESP32.
FC6 Icon.png Counter - ESP

Potentiometer ESP32

This example shows how to read analog values from a potentiometer and display them on the ESP32.
FC6 Icon.png Potentiometer ESP

Macros ESP32

Learn how to create and use macros to simplify repetitive tasks in Flowcode projects with ESP32.
FC6 Icon.png Macros ESP

LCDs ESP32

This example explores how to control and display information on an LCD using the ESP32.
FC6 Icon.png LCDs ESP

Motor Test - ESP32

This project tests motor control functionality using the ESP32 as the controller.
FC6 Icon.png motor test - ESP32

Grove I2C Temperature and Humidity ESP32

This program shows how to read temperature and humidity data from a Grove I2C sensor with the ESP32.
FC6 Icon.png Grove I2C temp and hum ESP

Grove I2C Quad 7-Segment ESP32

This example demonstrates how to interface with a Grove I2C quad 7-segment display using the ESP32.
FC6 Icon.png Grove I2C quad 7-seg ESP

PIC

These PIC16F18877 Flowcode example projects provide a hands-on introduction to working with various sensors, displays, and control mechanisms using the PIC16F18877 platform.
From testing motor functionality to interacting with I2C components and creating simple flashing patterns, these examples are ideal for beginners looking to explore embedded systems development with PIC microcontrollers.

These will also work with Matrix's EBlocks PIC Programmer.

Flasher - PIC

This example creates a basic flashing LED pattern, controlled by a PIC microcontroller.
FC6 Icon.png Flasher - PIC

Counter - PIC

A simple counter program that increments values based on input signals using a PIC microcontroller.
FC6 Icon.png Counter - PIC

Potentiometer PIC

This example shows how to read analog values from a potentiometer and display them on a PIC microcontroller.
FC6 Icon.png Potentiometer PIC

Macros PIC

Learn how to create and use macros to simplify repetitive tasks in Flowcode projects with a PIC microcontroller.
FC6 Icon.png Macros PIC

LCDs PIC

This example explores how to control and display information on an LCD using a PIC microcontroller.
FC6 Icon.png LCDs PIC

Motor Test - PIC

This project tests motor control functionality using a PIC microcontroller as the controller.
FC6 Icon.png motor test - PIC

Grove I2C Temperature and Humidity PIC

This program shows how to read temperature and humidity data from a Grove I2C sensor with a PIC microcontroller.
FC6 Icon.png Grove I2C temp and hum PIC

Grove I2C Quad 7-Segment PIC

This example demonstrates how to interface with a Grove I2C quad 7-segment display using a PIC microcontroller.
FC6 Icon.png Grove I2C quad 7-seg PIC

Arduino

Arduino Uno These Arduino Uno Flowcode example projects provide a hands-on introduction to working with various sensors, motors, and control mechanisms using the Arduino Uno platform.
From controlling DC motors to interacting with I2C components and creating flashing patterns, these examples are perfect for beginners looking to explore embedded systems development with the Arduino Uno.

These will also work with Matrix's EBlocks Arduino Programmer.

Flasher - Uno

This example creates a basic flashing LED pattern, controlled by the Arduino Uno.
FC6 Icon.png Flasher - Uno

Counter - Uno

A simple counter program that increments values based on input signals using the Arduino Uno.
FC6 Icon.png Counter - Uno

Potentiometer Uno

This example shows how to read analog values from a potentiometer and display them on the Arduino Uno.
FC6 Icon.png Potentiometer Uno

Macros Uno

Learn how to create and use macros to simplify repetitive tasks in Flowcode projects with the Arduino Uno.
FC6 Icon.png Macros Uno

LCDs Uno

This example explores how to control and display information on an LCD using the Arduino Uno.
FC6 Icon.png LCDs Uno

DC Motor Test - Uno

This project tests DC motor control functionality using the Arduino Uno.
FC6 Icon.png DC motor test - Uno

Grove Temperature and Humidity Sensor - Uno

This program shows how to read temperature and humidity data from a Grove sensor with the Arduino Uno.
FC6 Icon.png Grove temp hum sensor - Uno

Grove I2C Quad 7-Segment - Uno

This example demonstrates how to interface with a Grove I2C quad 7-segment display using the Arduino Uno.
FC6 Icon.png Grove I2C quad 7-seg - Uno

Introduction to Microcontrollers Course

We recommend going through the Flowcode section (section 3 page 28-38) of the Free Introduction to Microcontroller Programming Course.

This section of the course teaches the following basic concepts about Flowcode:

  • How to Design a Flowchart: Learn how to create flowcharts by dragging and dropping icons, which represent commands and functions, to develop microcontroller applications.
  • How to Add and Configure Components: Understand how to include and manage external devices, such as LEDs, switches, and displays, by using Flowcode’s extensive component libraries. You will also learn to configure the properties and connections of these components to the microcontroller.
  • How to Simulate Programs: Explore how to run simulations of your flowchart, allowing you to check the behavior of your application before transferring it to the microcontroller. Flowcode offers real-time variable and macro tracking during simulations.
  • How to Compile and Transfer Flowcharts: Once your flowchart is complete, you will learn how to compile it into C code and transfer it to the microcontroller for real-world testing and implementation.
  • How to Use the Flowcode Interface: Gain familiarity with the key panels and toolbars in Flowcode, such as the main workspace for building flowcharts, the 2D Dashboard and 3D System panels for managing components, and the Project Explorer for organizing variables, macros, and components.

By the end of this section of the course, you will have learned how to use Flowcode to create and simulate embedded applications, manage microcontroller interactions, and troubleshoot your programs effectively.

Embedded Getting Started Guide

The Embedded Getting Started Guide introduces you to the Flowcode environment and take you though to programming a microcontroller.


Web Developer getting started

New with the release of Flowcode v10.1 is Web Developer which allows the development of interactive web pages using the Flowcode IDE environment on any platform that supports HTML browsers.

The Web Developer Getting Started Guide takes you through your first experience of Web Developer and demonstrates how to generate interactive HTML files.


PC Developer Getting Started Guide

The PC Developer Getting Started Guide takes you through the various stages of creating PC developer code that includes switches, timer and graph logging.


Using PC_Developer APIs to Control an Arduino

The Using PC Developer APIs to Control an Arduino Takes you through creating HMI (Human machine Interface) Windows-based applications. that can control ESP32, and Arduino hardware in real time.


Raspberry Pi_Getting Started Guide

The Raspberry Pi Getting Started Guide shows you how to set up the Raspberry Pi to enable it to be programmed via Flowcode.


Sysblocks Getting Started Guide

The Sysblocks Getting Started Guide take you through signal processing for Music Technology, DSP, Communications and Software Defined Radio.

Sysblocks is an exciting piece of hardware for use with education in mind.

Examples

There are loads of examples available. To find an example of a component you are interested in. Search for the component by selecting the magnifying glass on the left Components Libraries ribbon. Right-click on the component you would like to look at an example for, then select help. If there are no examples available then you can request an example on the forums.

Embedded

Heat Control - Coarse

Many modern electronic systems include some form of simple closed loop heat control to function. Some examples include a kitchen oven, a microwave oven, an iron, hair straighteners, electric heater, etc.

These devices typically work by monitoring the temperature and then switching on a heating element when the temperature is less then the required temperature. The element is then switched off again when the required temperature is reached.

The electronics involved could be a microcontroller digital output pin connected to a simple transistor, diode and relay to control the heater element and a thermistor to measure the heat.

FC6 Icon.png DSP Heater Coarse Control


Heat Control - Fine

More advanced electronic systems may require a bit more fine control of the temperature to avoid overshoot and improve response to load changes. Some examples include a SMD reflow oven, 3D printer hotend, soldering iron, etc.

These devices typically work by monitoring the temperature and then providing an analogue output to a heating element. The analogue value is calculated using a transfer function in this case we are using PID control.

The electronics involved could be a microcontroller PWM output pin connected to logic level FET or TRIAC to control the heater element and a thermocouple to measure the heat.

FC6 Icon.png DSP Heater Fine Control


Multi-function AC Power Monitor

The PZEM-004T is Multifunction AC Power Monitor which uses MODBUS to communicate with the microcontroller.

It can measure Voltage, Current, Frequency Power, Power Factor & Energy used (Resettable).

The power level threshold can be set to give OVERPOWER warning.

Before programming, check LCD address and Power Level Threshold are correct within the 2D Panel Properties.

As the MODBUS uses UART channel on the Arduino Uno, the UART software timer is used to send all the power values. Therefore you will require a TTL to USB converter or an analyser that can decode UART.

FC6 Icon.png Arduino Uno AC Multi-function Monitor v1.2

Current Sensor (ACS7xx) component

ACS7XX range of unidirectional and bidirectional 5, 20, 30, 50, 100, 150 & 200A current sensors

A simple example shows how to use a ASC712 component to measure a current range of +/- 5A. The component type can be changed within its properties.

FC6 Icon.png ACS712 example


Circular Buffer - Reliable Communications Data

This example takes bytes received from the Serial UART and uses the circular buffer to store the bytes as they come in using an interrupt. The main routine then forwards the bytes through to a PC using a USB serial connection.

This example would work equally well for creating a bridge between several UARTs or translating Serial to SPI or I2C etc.

FC6 Icon.png UART to USB Serial Data Bridge

The LCD will retain the contents of the display, for high speed data we only want to have to write to the portion of the display that can change.

FC6 Icon.png LCD Demo

FC6 Icon.png BME280 Barometer plus Altitude v1.0 This example reads and displays the pressure, temperature & humidity. If the pressure is increasing then Rise will be displayed.

Alternatively if the pressure is falling, then Fall will be displayed.

The altitude displayed is calculated based on the current pressure reading.

What makes the altitude useful is the ability to tare it, then after going up or downstairs for example the feet & meters are displayed.

Note since the altitude is calculated based on pressure, then if the sensor is left at the same height, the height displayed can be different each day.


Programming Touch and Graphical Displays

These programs are used in the Youtube video Touch and graphical displays parts 1 and 2

FC6 Icon.png gLCD Demo for SPI HGY 480 x 320 Display

FC6 Icon.png gLCD Demo for Cap Touch Display on Rowland Technology PCB

ZIP Icon.png Image for Test_card_6_for_Rowland

ZIP Icon.png Images for Test_card_7_for_HGY_480_320

FC6 Icon.png Menu system example for a gLCD

ZIP Icon.png Images for Menu system example

Place the bitmap files in the same folder as the project file for the simulation to work.

M5stack dial

FC6 Icon.png M5stack demo shows you how you can develop a simple test card for the M5 stack dial using Flowcode

FC6 Icon.png M5stack demo shows you how you can make an electronic safe project for the M5stack Dial

ZIP Icon.png Image for M5stack_Dial_simple

ZIP Icon.png Image for M5stack_Dial_Safe



Place the bitmap file in the same folder as the project file for the simulation to work.

App Developer

Freeapp-io-monitor2.png

A range of example App Developer projects are available from here: https://www.flowcode.co.uk/app-developer/free-apps/

A simple example that shows how to use some common functions of the potentiometer in conjunction with an LCD.

FC6 Icon.png Potentiometer Example


A basic worked example showing how to use Flowcode to create an embedded project that is controlled via a web app using HTTP.

This set of 6 projects provides a detailed look at simple communications between an ESP32 device and a web browser using Flowcode to construct both the embedded app and the web app.

HTTP Comms Worked Example - Web Developer



A worked example showing how to create an embedded project that communicates with a PC via the serial port.

This simple example shows two projects - an embedded app and a PC-based app - that communicate with each other using the serial port, exchanging text messages between the embedded device and the PC.

Serial Comms Worked Example - PC Developer



A worked example showing how to develop Flowcode MQTT apps.

This project details a simple application for exchanging messages between embedded and non-embedded devices using the popular MQTT protocol. Flowcode is used to create three apps - an embedded app running on an ESP32 device, a PC app running on Windows and a web app running in a browser.

MQTT Worked Example - Web & PC Developer

Scenarios

This page contains a list of the scenarios included with Flowcode.

The corresponding components can be found in the Runtime section of the component toolbar.