Control Pascal Tutorial

This is a new tutorial started Aug. 2015 (also linked on the wiki page). Our goal is to develop a tutorial that a child (ten years old?) or an engineer (who hasn't studied or done any programming) can use to get started with Free Pascal. We've done this already for about fifteen years (for electronics and Basic) using the Parallax What's a Microcontroller kit (you can read the PDFs here).

We've also used an easy tutorial to get started on Arduino, and done similar things to show how to get started with Python for CNC work (ask if you'd like to see that).

The most simple way we've found to teach basic electronics:
1) study the first two chapters (atomic structure and DC electricity) of the Basic Electronics book here
2) learn to troubleshoot vehicle batteries.  The page here is a good start but the following should be added?  If starter motor turns engine over *slowly*, test battery voltage when not starting (should be about 12.5 V).  Keep voltmeter directly on battery terminals (not on any clamps) and see how voltage changes when someone tries to start the vehicle.  If the voltage remains almost the same, there probably is a bad clamp connection that maybe can be fixed by tightening.  If the voltage drops to a much lower value, then the battery does not have sufficient charge.  This is a quick, easy test that often reveals bad connections.

New Oct. 2017: The SparkFun Inventor’s Kit (Arduino) has a very nice 88 page PDF (can also be viewed online)!

New Oct. 2017: The Raspberry Pi also can be used with a breadboard and Python for Physical Computing with Python, and also the RasP.IO Pro Hat with this tutorial (need
sudo apt-get install python3-gpiozero),  and also the CamJam EduKits. We hope to combine the breadboard kits with the least expensive PicoScope so students can "see" some of what is happening! This recent article shows how to use a scope to "see" Arduino timing. We have another page here (PicoScope), though it isn't for beginners. Here is an interesting tutorial about spectrum analyzers.

FreePascal From Square One (rev 12/12/2017 277 page 4.9 MB PDF) is a great introduction to programming (Part 1) and to the core of Pascal (Part 3).  With the small distributions available below you can put off installing anything (Part 2) until later.

A corrected table of contents for the PDF above
Introduction: How This Book Came About. . . . . . . . . . . 7
Part 1: The Fundamental Ideas of Programming . . . . 11
 1. The Box That Follows a Plan . . . . . . . . . . . . . . . . . . 13
 2. The Nature of Software Development . . . . . . . . . . . 41
 3. The Secret Word Is “Structure” . . . . . . . . . . . . . . . . 67
Part 2: Installing, Learning, and Using FreePascal . . . 89
 4. Installing FreePascal and Lazarus . . . . . . . . . . . . . . 91 UF
 5. Using the Lazarus Environment . . . . . . . . . . . . . . . 109 UF
Part 3: The Core of the Pascal Language . . . . . . . . . . 121
 6. Pascal Atoms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 UF
 7. Data and Data Types. . . . . . . . . . . . . . . . . . . . . . . 149
 8. Derived Types and Data Structures . . . . . . . . . . . 179
 9. Controlling the Flow of Program Execution . . . . . 219 UF
10. Procedures and Functions . . . . . . . . . . . . . . . . . . 249

There are only 10 kinds of people in the world. Those who understand binary and those who don’t. Figure out the 6 character English word (programming "string") here using this page, then search for that word and Android and see the first about page to see where the picture came from...

And if you are just starting out, Learning Computer Architecture with Raspberry Pi book (much by the same author as the PDF above) might be the next thing to study (after purchasing a Raspberry Pi).

If you are an experienced programmer, here is a quick introduction to Free Pascal.

The companion website for a good Raspberry Pi book (also one for Beaglebone).

Here is another recommended tutorial for Pascal.


The first tutorial below introduces the Pascal programming language, file managers, the command prompt, the Free Pascal compiler, and the minimal files needed to compile a program.
Win32 Hello World Tutorial: doc - PDF - web
(we hope to add tutorials for Linux soon!)
New May 2016 - If you are using Windows you can easily try Linux using LevinUx.

The second tutorial requires the DLP-TEMP-G 3-Channel Data/Temperature Acquisition Board.
Win32 Simple Serial Tutorial: doc - PDF - web
(we hope to add tutorials for Linux soon!)

No tutorial (yet) but if you have the DLP-TEMP-G you can monitor a (remote) location (with Internet access) and send emails and/or text messages if the temperature is outside of the limits. Some unfinished code is released here.  We hope to add a new page here that discusses different communication options for remote devices. If WiFi is available you can use an inexpensive Raspberry Pi Zero W. Moving up the ladder you might want to check out the Waspmote which is an industrial Arduino! If you use cellular there are warnings in this message thread.

No tutorial (yet) but you can use fpGUI to see how easy it is to create GUI programs.  You can also see how easy it is to create the Control Terminal GUI program which is useful for diagnosing communication issues!

We'd also like to add a tutorial for programming the Teensy (a complete USB-based microcontroller development system) using Free Pascal.  And if you are really into engineering you should check out our Comedi and PicoScope pages on the home page.

If you are just starting out hopefully something above got your interest, so if you'd like to do more Free Pascal programming you'll need to learn and install an IDE and possibly other tools (text editor, git, svn).

New! Here is a powerful IDE that is simple to install and use: ideU.

New! Here is a new project (Ultibo) for using the Raspberry Pi as a no OS embedded device!

We hope to add more instructions here soon.


Return to home page.

Please share your ideas, comments and suggestions. Thanks!