Node-RED introduction: Difference between revisions

From Sensors in Schools
Jump to navigation Jump to search
No edit summary
Line 20: Line 20:


[[File:Screen Shot 2021-12-31 at 3.41.21 pm.png]]
[[File:Screen Shot 2021-12-31 at 3.41.21 pm.png]]
[[File:Screen Shot 2021-12-31 at 3.43.35 pm.png]]
* Run the program by selecting Run > Run module.
* The program will send output to the Python Shell.
* A typical output in the Shell is presented below.
[[File:Screen Shot 2021-12-31 at 3.44.31 pm.png]]

Revision as of 04:45, 31 December 2021

Overview

  • The aim of this lesson is to start learning to use Node-RED which is a block-based programming language.
  • The appeal of Node-RED is that individual code segments are hidden in nodes.
  • Individual nodes can be connected using wires.
  • This makes the program much easier to visualise and program.

Learning Objectives

  • Learn how to start node-red on the Raspberry Pi.
  • Learn how to run Python programs in Node-RED.

Introduction to Node-RED on the raspberry Pi

  • Node-RED is a powerful and intuitive programming language pre-installed on the Raspberry Pi.
  • This lesson will serve as an introduction to the use of this platform.
  • In this lesson we will learn how to execute python programs.

Run the python file peter_hopper_get_data.py

  • From the main Raspberry Pi menu navigate to Programming and open Python3 IDLE
  • Open the saved file peter_hopper_get_data.py
  • The full listing is below.

  • Run the program by selecting Run > Run module.
  • The program will send output to the Python Shell.
  • A typical output in the Shell is presented below.