Create and execute button demo program Pro Preview

You already know the process. Open nano, copy and paste the material code with a right mouse click, save the file and execute the program.

To access the full video please subscribe to FLLCasts.com

Subscribe

  • #834
  • 09 Apr 2018

TL;DR.

  1. Copy ledButtonDemo from the material;
  2. Type nano ledButtonDemo.py;
  3. Right click in the editor to paste;
  4. Ctrl+O to save, Ctlr + X to close nano;
  5. Type python ledButtonDemo.py and follow the on-screen instructions.

 

 

Let's use that button

We will repeat the drill from the previous section: Open the material in a text editor and copy all the code.

Then type

nano ledButtonDemo.py

and right click in nano, in order to paste the code.

Control key and O will save the code and Control key and X will close the nano editor.

Type

python ledButtonDemo.py

and follow the on-screen instructions.

Python demo program using a button to control our car LED

Part of the perfect STEM course, this program needs a Raspberry Pi, a button connected on GPIO 26 and 3.3V, and an LED connected to GPIO 18.

Courses and lessons with this Tutorial

This Tutorial is used in the following courses and lessons

Image for Perfect STEM course. Module 1 - Smart Car with Raspberry PI
  • 118
  • 42:47
  • 136