В момента ресурсът е наличен само на английски

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.

Необходимо е да се абонирате за FLLCasts.com, за да достъпите това видео

Абонирай се

  • #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.

Курсове и занятия включващи този Урок

Този Урок е използван в следните курсове и занятия.

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