HOME

Ardino and Pascal Programming Tutorials

C for Arduino, and Pascal for other environments

I give details of three good free Pascal compilers further down the page.

- - - - but I've become excited about the Arduino of late. It uses a C-like language, but if you can program in Pascal, you can program in the Arduino language. You say "goodbye" to the finger- annoying ":=", but "hello" to anm equally annoying "/*", and semicolons remain a "little joy" to stay on top of.....

For the Arduino: Besides these tutorials, I've started a series of "How To" articles which you can dip into at random.

Also for the Arduino, I have an alternative, "quickstart" guide. The alternative guide is written for people who already know something about programming.

For the Arduino: You may want to go to the main Arduino site, www.arduino.cc if you haven't been there before.

Lastly, please someday visit the introduction and guide to the site these tutorials are part of, if only for the site search button!



Tutorials Table of Contents

Level 1 Tutorials:


Start Here FPC version: Setting up. And some general points.
Start Here TP version: Setting up. And some general points.
Start Here Pascalite version: Setting up. And some general points.
Arduino Start Here Setting up. And some general points. ** PLEASE SEE general Arduino caveat


Second tutorial FPC/TP version: Going loopy.
Second tutorial Pascalite version: Going loopy.
Arduino Second tutorial Going loopy. ** PLEASE SEE general Arduino caveat


Third tutorial FPC/TP version: Introducing variables.
Third tutorial Pascalite version: Introducing variables.
Arduino Third tutorial Introducing variables. ** PLEASE SEE general Arduino caveat


Special Arduino- only tutorial "3c" Getting letters and digits output during development ** Please see: general Arduino caveat
Special Arduino- only tutorial "3b" Surviving with or without an LCD display. YOU DO NOT NEED TO DO THIS ONE** Please see: general Arduino caveat


Fourth tutorial FPC/TP version: More on variables.
Fourth tutorial Pascalite version: More on variables.
Arduino Fourth tutorial More on variables. ** PLEASE SEE general Arduino caveat


Fifth tutorial FPC/TP version: Counting in binary. ("For" loop)
Fifth tutorial Pascalite version: Let there be light. ("For" loop and LEDs)

Revolution counting: What has that hamster been up to? (One version for all three flavors of Pascal.)

Arrays tutorial FPC/TP version: Super variables
Arrays tutorial Pascalite version: Super variables

User Defined Procedures FPC/TP version: Make your own language! (Part 1)
User Defined Procedures Pascalite version: Make your own language! (Part 1)


Level 2 Tutorials:


At 6/07, the Pascalite thread is the most mature. The FPC/TP thread is a work in progress. Until FPC/TP specific pages become available, readers are invited to study the Pascalite page.
Not a tutorial. The rest! (Miscellaneous features introduced)

User Defined Procedures: Make your own language! (Part 2- parameters)

Generalized Rules of Program Structure: Let's have some backbone! (A hard and not ESSENTIAL tutorial covering some basics)

Program Structure Suggested by Pascalite Default: (Not essential, but may help if you want to use default.)

Things You Could Do: Sketches of some ways to use a Pascalite


Level 3 Tutorials:

User Defined Procedures: Make your own language! (Part 3- more on parameters)

Generalized Rules of Program Structure: More backbone!

An Overview of Binary Mostly theory.


Which Pascal compiler should I use?

Details of some good free Pascal compilers

See below for Arduino information. It is not Pascal based... it uses something close to C.

FPC Pascal: I discovered the delights of FPC Pascal, aka Free Pascal, aka FPK Pascal in June 2007. While I may have to come back to this page and eat (or at least revise) my words, I strongly suspect that this is your best bet for an introduction to Pascal in a easy- to- use environment. I've written a separate page about its virtues, setting it up, and a small test program you can use to see the installation went okay. I will be very disappointed if this Pascal is not capable of serious work. It is the basis of the Lazarus Project, which may be a "free Delphi"... i.e. a GUI for producing Windows and Linux applications. (I only say "may" because I haven't tried it. It looks promising.)

I will be working through the tutorials on this site, doing FPC versions of them for you because I like this open source product so much.

Borland Turbo Pascal: Traditionally, we used Borland's Turbo Pascal as the industrial strength, de facto "standard" Pascal. You can obtain a free copy of the powerful version 5.5, but it does come from "pre-Windows" days, and is less "Windows friendly"... although it, and the applications it produces, will run, in MS-DOS windows. I have prepared a separate page about installing Borland's Pascal, (with a first project, to test the installation). That is written primarily for XP users, but it will work... probably better... on earlier Windows, too.

Pascalite: Pascalite compiler: While less widely supported than the other two, less "powerful", this one has some special strengths arising from the fact that there is a microcontroller available which is designed to run Pascalite code, and Pascalite is equipped with special commands to access the microcontroller's inputs and outputs, which include ADCs and counters.

Recommendations: If you have not done much programming, or much Pascal programming before now, perhaps you should start with FPC Pascal, or Pascalite, and move on to the Borland product should your needs require it. FPC Pascal and Pascalite work more easily under Windows, and is easily un-installed if you grow beyond it's strengths.




Introduction and Guide to these Tutorials

See below for Arduino information.

This site offers you a sequence of lessons which should help you master prgramming the Arduino in its version of C, or master Pascal programming. You don't need to pay for a compiler: the tutorials can be followed with any of the free Pascal compilers, or wiht the free software that comes with Arduinos. All run on Windows, from Win98* to XP, and maybe Vista. Two (FPC and the Arduino) can also be used on Linux boxes ('Ray!) and Macs. Thus, the material should be of general use. Feel free to use the tutorials in programming courses, but a credit of the source would be appreciated. (*I haven't checked the Arduino's ability to run on Win98, sorry!)

You can follow two threads through the tutorials. One is for users of Free Pascal, aka FPC. That thread will also help users of Borland's Turbo Pascal. The other thread is written with users of the Pascalite in mind.

If you follow the Pascalite thread through these tutorials, you do not have to have the Pascalite hardware to do most things in these programming tutorials. IF YOU DO have the hardware, especially if you have just obtained it, PLEASE have a look at my Using the Pascalite Hardware It has details of how to access various features of the splendid Pascalite.

Pascalite is two things: A Pascal software programming package which you can download for free, and an inexpensive microcontroller, which is remarkably capable. The software includes not only the compiler, but also a splendid integrated working environment including editor, debugging tools and simulation of the Pascalite hardware. The download was only 482kb in late 2002, but don't be fooled into thinking that it can't be very capable in so "few" bytes. It simply wasn't written at Microsoft.

Click here to visit the Control Plus site, which gives away the software and sells the hardware. By the way, this site and the tutorials were created without payment from or affiliation to Control Plus. I just thought the product deserved publicity, and liked the fact that I could teach Pascal without requiring expenditure by my pupils. I have also done an overview of the Pascalite for you.

The exercises work exactly as presented if you are using Pascalite. However, it (mostly) obeys the rules of any good Pascal and they will need little modification to run in other dialects of Pascal.

What you learn here will help you if you ever set out to learn Delphi, the outstanding way to program Windows. It will also help you if you set out to learn Kylix, which is virtually "Delphi for Linux".

Delphi is a much under-rated programming tool for Windows, and it has, hurrah, recently become reasonably available to hobbyists again. See my Delphi Tutorials site for more information on these matters.





General Arudino Caveat

The pages about Arduino programming were started in February 2008. I don't know much about the Arduino yet, and I don't have a lot of time to work on this right now, and it is programmed in a totally non-Pascal language!

So what IS here, and WHY!

What is here is a start. I hope to build it up in the months ahead. We'll see what enthusiam is shown.

I'm doing this because I think the Arduino is a great product. I like the support it already has, and hope to see it go from considererable strenght to even greater success.

I say that on the basis of working with computers since 1968, and as someone who taught for twenty years. I don't yet say it on the basis of extensive experience with the Arduino.

Why is my Arduino material on my Pascal page? Because the Pascal page grew from my work with the Pascalite microcontroller. The Arduino is suited... better suited... to the same things that a Pascalite is good at. The differences look huge to a neophyte, but, in regard to the device's function, there are great similarities. Doing the Pascalite things the Arduino way is mostly a matter of different vocabulary and punctuation. If you were in charge of a team building a garden shed, the job would be much the same in New York as in Madrid. You'd have to uuse a different language, but the underlying job would be the same.

I hope you will bear with me as the Arduino pages here come online. Not because I want the glory, but because I hope that you will find them useful! By all means go to Google, if you don't... there are plenty of other places to find out about the Arduino, and you don't want to miss out on that, I assure you!

I've also produced a Getting Started guide for the Arduino.

(If you think microcontrollers seem pretty cool, but you're not sure that the Pascalite or the Arduino is what you need, my introduction to microcontrollers might be just what you need!)


To search THIS site....
Click this to search this site without using forms, or just use......
powered by FreeFind
Site search Web search
Be sure to spell the words you are searching for correctly!
The search engine doesn't understand English. Searching for "How do I use repeat" will just return pages with "how", "do", "I", "use", or "repeat".
(Go to my other sites (see bottom of page) and use their search buttons if you want to search them.)...



Other Tutorials by me, not integrated with the above:

Introduction to Dallas 1-Wire... Overview and links to tutorials with source code for accessing 1-Wire (aka MicroLan) devices, as used in iButtons. Dallas is now part of Maxim. ("1-Wire" is a registered trademark. The Pascalite hardware can access at least some 1-Wire devices, at least a little. I would guess that more functionality will be forthcoming in due course.)
Pascal for those who know Basic... but who haven't done much Pascal.
Making it work... Help with debugging.. and on preventing the need for it. Also useful to programmers using other languages.


       Editorial Philosophy

I dislike 'fancy' websites where there's more medium than message.... especially if that means I have to wait while multiple little items get downloaded. For a pretty picture, I can go to an art gallery. (Of course an attractive site with content deserves praise... as long as that pretty face doesn't cost download time.) In any case....

I am trying to present this material in a format which makes it easy for you to USE it. There are two aspects to that: The way it is split up and the way it is posted.

The way it is split up...

I have tried to split it up into 'bite-sized' pieces and to indicate which pieces are basic and of general importance, and which address more specific issues which may also be more complex, or require prior understanding of other issues. In other words, I try to show you how to walk before running. The 'Level 1' tutorials cover the basics. If you have no experience, start with the level one tutorials. If you decide to jump in at a more advanced level, and things are not clear, it might be an idea to skim the level one topics if only to learn about my way of expressing the concepts.

The way it is posted...

You should be able to read the tutorials on-line without difficulty. However, you should ALSO find it easy to capture them for off-line use, including editing for your own purposes. The following should work. I would suggest that you create a folder for the tutorials so that you can retain my filenames with no risk of clashes:

On-line, use your browser to view the tutorial you want to capture.

Use your browser's File|Save As... to save the web-page to your disc. At this point you can log off or visit other pages, perhaps saving them, too.

When you have logged off, use your browser's File|Open file to access what you saved.


Filenames...

I've tried to be organized: Names start "plt" or "pt" for Pascalite / Pascal Tutorial. Next is a digit, for the level, then I've used letters one after the other, e.g. ptl2a, ptl2b, ptl3a. The letter doesn't mean much... it merely shows when I got around to that particular topic! And, appended to all of the above, you will sometimes find a "p" or an "f". These indicate that the file is a "Pascalite" or "FPC/TP" version of the tutorial, respectively, when present.


The connection between Delphi and Pascal:

Delphi is based on Pascal. It is for writing programs for Windows, using Pascal with a lot of enhancements from those wonderful people at Borland. I've worked hard for years developing a collection of Delphi tutorials. Delphi gave rise to Kylix, which is "Delphi for Linux". Sadly, Kylix seems to be a failed initiative, but I'm going to explore it someday soon, with an "obsolete" copy of which I managed to obtain.

If you are very new to programming, you might make progress faster if you start with a non-Windows Pascal... such as any of the compilers the tutorials on this page help you with.



In addition to the tutorials for which this page serves as Table of Contents, I have other sites with material you might find useful.....

    Delphi Programming Tutorials

    Using a Windows / DOS PC's parallel port with programs written in Delphi and other languages.

    Some pages for programmers.


And now for some links to some pages which you may find useful, written by other people.

They will be opened in new windows, so use your tabs (Opera, Firefox), or just close their windows (IE) to get back here.

(Please do not ask me to list your page here unless your page already has a link to my page, and your page has been up for at least two years. (And I can confirm that with the WayBack Machine.))


Before you have looked very far on the internet for help with Pascal, you should encounter Timo Salmi. He has, for a long time, been indefatigable in helping everyone. If there's something you need to know which isn't in his Common Turbo Pascal Questions FAQ, I would be surprised! And he has a great page of links.
Borland Once user unfriendly, but not last time I looked. Certainly worth a visit. The registration information they ask for is less presumptuous than many sites. Free copies of not primitive versions of the excellent Turbo Pascal are sometimes (legitimately) available.
Delphi Land- Delphi tutorial, tips, source code. English or Dutch (Nederlands)
Frank's Delphi Lessons (LS, 1/04, 10/04, (new URL 6/06), 5/07)
Marco Cantu's Essential Pascal tutorial... read online, or download text.
Babilon Tutorial written for beginners, but with some intermediate level tricks, too.
Delphi Super Page.... an archive of material, some with sourcecode.
Swiss Delphi Center In English, German, and French. Programming tips, Downloads, Links, Etc
www.matlus.com Site with straightforward tutorials dealing mostly with building using Delphi 6 Enterprise.
Excellent, straightforward tutorials dealing mostly with building SOAP/Webservices using Delphi 6 Enterprise.

Alternatively, use newsgroups,

via Google's Groups to obtain answers to your questions! (New to newsgroups? See my introduction.)


To search THIS site.... (Go to the sites above, and use their search buttons if you want to search them.)...or, use...
Click this to search this site without using forms.

powered by FreeFind
Site search Web search
The search engine merely looks for the words you type, so....
*    Spell them properly.
*    Don't bother with "How do I get rich?" That will merely return pages with "how", "do", "I"....

Please also note that I have two other sites, and that this search will not include them. They have their own search buttons.
My site at Arunet.
My Sheepdog Guides pages , another of this page's editor's sites.
Ad from page's editor: Yes.. I do enjoy compiling these things for you... hope they are helpful. However.. this doesn't pay my bills!!! If you find this stuff useful, (and you run an MS-DOS or Windows PC) please visit my freeware and shareware page, download something, and circulate it for me? Links on your page to this page would also be appreciated!
Click here to visit editor's freeware, shareware page.



Link to editor's (Arunet) homepage

How to email or write this page's editor, Tom Boyd