Visual Studio Code for programming a Raspberry Pi

Lesser Detail

To wrap up the VS Code console tour, I'll describe some of the Activity Bar items not used. The magnifying glass icon represents the Search view, in which you can search for and optionally replace content within the current editor or across multiple files.

The Source Control view (the source tree icon) provides access to source control software that tracks and manages changes to code. Recall when first preparing the Raspberry Pi environment that you installed the Git software package. Git is the most commonly used version control system today. VS Code provides support for Git through the Source Control view.

If Git is established in the Source Control environment and the project being worked on is in a Git repository, then the view will show relevant Git information, such as how many files have been changed and which files have been changed and staged, and will even commit your changes.

Source Control is important even to the amateur developer, and it can be relied on as a form of code backup. After you have spent your time writing the code, it would be nice for it to stick around if your Raspberry Pi development environment were to fail. If Git is using a repository, then the code is safe.

The Run view (an arrow with a bug), the final Activity Bar item to be mentioned, establishes a Python debugging environment. When you select the Run view icon, the debugger needs the launch.json configuration file. The file will be displayed with some default configurations. A .vscode folder is created to hold this file.

VS Code debugging allows you to step through code line by line and fix problems. To stop code at a specific point, you can establish breakpoints and conditional breakpoints. Debugging also enables log points for coding [4].

Summary

VS Code provides a development environment that will make you a more efficient Raspberry Pi coder by taking over some of the tasks and freeing time for you to focus on what is important – writing code. Until next time, keep your Pi in that creative oven.

The Author

Sean D. Conway (the D in the name is to keep his mail from being delivered to his neighbor with the same name) is a retired IT security specialist for a national telecommunication company. In addition to designing, installing, maintaining, and securing computer systems in a telecommunications environment, his 40-year career has spanned engineering ground-based aviation navigation and communications electronic systems and teaching data communication in a community college.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Web Serial API

    Upgrade your computer with LEDs, buttons, or sensors to control a microcontroller board over USB from your web browser.

  • Raspberry Pi WebIDE
  • PyPy and Nuitka

    PyPy and Nuitka improve the performance of Python on a Raspberry Pi.

  • GitHub Codespaces

    Imagine you want to build a program from the source code and discover that your distribution lacks the tool and software package versions you need to do so. Instead of using your own virtual machine, you can now switch to GitHub Codespaces.

  • influZend Studio 4

    PHP experts consider Zend Studio the most mature and feature-rich IDE for PHP. The latest version offers enhanced database manipulation and other improvements. We’ll put the Zend Studio IDE through its paces and show you how you can use it to speed up PHP development.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News