Difference between revisions of "Examples and Tutorials"
Line 2: | Line 2: | ||
We recommend going through the Flowcode section of the https://www.matrixtsl.com/resources/files/datasheets/Microcontroller%20compete%20course.pdf course which has been updated for the latest version of Flowcode and is available for free at the learning center section on the main [http://www.matrixtsl.com www.matrixtsl.com] website. | We recommend going through the Flowcode section of the https://www.matrixtsl.com/resources/files/datasheets/Microcontroller%20compete%20course.pdf course which has been updated for the latest version of Flowcode and is available for free at the learning center section on the main [http://www.matrixtsl.com www.matrixtsl.com] website. | ||
+ | |||
+ | If you have a Raspberry Pi you can look at | ||
+ | [[https://www.flowcode.co.uk/wiki/index.php?title=Raspberry_Pi_Getting_Started_Guide]|RPI getting started guide] | ||
+ | |||
==Embedded== | ==Embedded== | ||
Line 48: | Line 52: | ||
The component type can be changed within its properties. | The component type can be changed within its properties. | ||
+ | {{Fcfile|Current_measure_ACS7xx.fcfx|ACS712 example}} | ||
− | {{Fcfile| | + | |
+ | |||
+ | ===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. | ||
+ | |||
+ | {{Fcfile|CommsBuffer.fcfx|UART to USB Serial Data Bridge}} | ||
Some components have examples on the Wiki | Some components have examples on the Wiki | ||
Line 71: | Line 84: | ||
*[[Traffic Light 1-Way]] | *[[Traffic Light 1-Way]] | ||
− | |||
*[[Pedestrian Crossing]] | *[[Pedestrian Crossing]] | ||
*[[Airplane Landing Gear]] | *[[Airplane Landing Gear]] | ||
*[[CNC Machine]] | *[[CNC Machine]] | ||
*[[Car Seat]] | *[[Car Seat]] |
Revision as of 14:23, 9 August 2023
Contents
Introduction to Microcontrollers Course
We recommend going through the Flowcode section of the https://www.matrixtsl.com/resources/files/datasheets/Microcontroller%20compete%20course.pdf course which has been updated for the latest version of Flowcode and is available for free at the learning center section on the main www.matrixtsl.com website.
If you have a Raspberry Pi you can look at [[1]|RPI getting started guide]
Embedded
Heat Control - Coarse
lots of 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.
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.
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 (Resetable).
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.
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.
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.
UART to USB Serial Data Bridge
Some components have examples on the Wiki
To access the example, with the component on the 2D or 3D panel, right click on the component and select help
Scroll down to examples.
App Developer
A range of example App Developer projects are available from here: https://www.flowcode.co.uk/app-developer/free-apps/
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.