* * *

Author Topic: Ways to get people (future engineers) started with Free Pascal  (Read 13680 times)

Paul Breneman

  • Full Member
  • ***
  • Posts: 242
    • Control Pascal
(Of course Lazarus comes into the picture at some point, but should it be at the beginning?)

I've used the Parallax Basic Stamp http://learn.parallax.com/ for about 15 years to get people started.  My favorite is this kit that teaches a little bit of electronics: http://learn.parallax.com/whats-microcontroller

For "engineering minded" people that seems a lot better than what a lot of programming tutorials start with (like writing your own skinable MP3 player) because actual hardware (LEDs and switches) are involved.

I've used the simple examples on this page to introduce several people to Free Pascal: http://www.turbocontrol.com/helloworld.htm

There is a basic tutorial on that page for Win32 that I hope to improve and also publish for Linux users.  If you look at how few files are needed to compile the program, that might be a good place to start to learn Free Pascal.

But let's get to using real hardware ASAP!  That is what we do on this page:  http://www.turbocontrol.com/simpleserial.htm

I have hopes & plans to go further!  This small VM approach that I discovered yesterday might fit in very well: http://mikelev.in/ux/

The USB temperature sensor that I found 6.5 years ago is very inexpensive and has worked well for a simple hardware device.  Now I'm hoping to find a simple device that can run a simple Linux OS.  Any suggestions?

Comments and feedback are appreciated!   :)
Regards,
Paul Breneman
www.ControlPascal.com

x2nie

  • Sr. Member
  • ****
  • Posts: 451
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Ways to get people (future engineers) started with Free Pascal
« Reply #1 on: May 26, 2014, 06:52:19 am »
Well, I have no suggestion about better small-VM than you could find.


But about hardware+software and programming in devices using FreePascal:
I prefer to be able to develop Teensy for Android. could we?


My ultimate dream is to convert a sewing-machine to be an embroidery-machine. could we?
The idea is come from the fact Android Devices is going cheap, high disk capacity, big screen-resolution.


Teensy is another Arduino (correct me if I were wrong) that is also cheap.
Together with FreePascal, I think it would be fastest way to experiment with controller (hardware).


What do you think?

When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5532
Re: Ways to get people (future engineers) started with Free Pascal
« Reply #2 on: May 26, 2014, 11:04:11 am »
IMHO: teach numeric math again in Pascal, that is how I learned it :)

JD

  • Hero Member
  • *****
  • Posts: 1573
Re: Ways to get people (future engineers) started with Free Pascal
« Reply #3 on: May 26, 2014, 11:41:53 am »
IMHO: teach numeric math again in Pascal, that is how I learned it :)

Numerical Recipes in Pascal comes to mind http://www.amazon.com/Numerical-Recipes-Pascal-First-Edition/dp/0521375169. A pity that Financial Numerical Recipes don't exist (C++, Python & Java versions available).
Windows (10, 7) - Lazarus 1.6.4/FPC 3.0.2 (also Delphi occasionally)
Linux Mint Cinnamon  - Lazarus 1.4/FPC 2.6.4
Indy 10.6 series; Zeos 7.2.1; SQLite, Firebird, PostgreSQL & MariaDB

Windsurfer

  • Sr. Member
  • ****
  • Posts: 306
    • Windsurfer
Re: Ways to get people (future engineers) started with Free Pascal
« Reply #4 on: May 26, 2014, 12:06:27 pm »
I just bought one of the available used copies of Numerical Recipes in Pascal.

The first time (in the late 80's) I saw a demo of reading inputs from an RS 232 port, I was amazed at how simple it was. Later, in the 90's, when transmitting data via satellite everything came down to bit streams and ring buffers. More recently, I loved playing with the Arduino until I exhausted my curiosity.

I think that understanding the basics is essential if people are not to be frightened away. I have always been perplexed and disappointed when very bright people said 'I'm not technical like you, so I can't do/understand that.' It seems to me that fear is the real problem, and it starts with lack of education.

Anything that gets people peeking and poking data at the simplest level should provide an insight that remains for life.
« Last Edit: May 26, 2014, 12:10:01 pm by Windsurfer »

Paul Breneman

  • Full Member
  • ***
  • Posts: 242
    • Control Pascal
Re: Ways to get people (future engineers) started with Free Pascal
« Reply #5 on: May 26, 2014, 04:49:42 pm »
Thanks for the helpful comments!   :)

I agree with you Windsurfer:  "Anything that gets people peeking and poking data at the simplest level should provide an insight that remains for life."  One of my main priorities seems to be trying to find the most simple ways to communicate with other hardware ( http://ctrlterm.com/ has been one of my favorite projects).

Thanks x2nie for mentioning Teensy: https://www.sparkfun.com/products/12646  I'd sure like to see that working in Free Pascal: http://wiki.freepascal.org/TARGET_Embedded

I'd also like to try using one of the pic32mx chips:
http://wiki.freepascal.org/TARGET_Embedded_Mipsel

Here is the top level wiki page for this stuff:
http://wiki.freepascal.org/Embedded
Regards,
Paul Breneman
www.ControlPascal.com

CaptBill

  • Sr. Member
  • ****
  • Posts: 431
Re: Ways to get people (future engineers) started with Free Pascal
« Reply #6 on: May 27, 2014, 02:40:37 am »
I've been scouting out the best solution for doing CNC control with Lazarus and happened up on a neat "set up". What seems obvious, after some hands on testing, is that for CNC (and anything that needs real-time performance) the microcontroller is the hot ticket. The humble microcontroller runs circles around all the other CNC software packages. It is a total game changer in the "real-time" world.

Well, I ran across some plans to modify my Linksys router into a "mothership" host for packaging this type of development environment. It is easy to add 2 serial ports, jtag programming port, sd card, and even a USB port (usb1.1). Now I can address these ports like any other serial port, over WIFI!

The router is flashed with OpenWRT firmware replacement, which is itself an open source LinuxOS very much like tinycore (probably the same .img Teensy needs?, x2nie). This means we can develop apps to run on the router itself. Think of the possibilities.

Now I can host all my files on the router. The operating system/s boot over PXE. The router hosts it's own "Repository" for the Tinycore OS. I can download the complete 9gb repo for Tinycore and have it local. I can add my own "packages" and maintain everything.

This could be a great beginners "weekend project" that I sure wish I knew long ago. It addresses all the configuration that is critical up front. That is what is so daunting for beginners, like myself. The soldering is very simple. Perfect starter project.

Thanks Paul, for your work. Your "approach" in your work has been inspirational. It is a daunting task to configure a working development environment to start with, much more if you add in microcontroller ide's, networking, etc. When the last few parts arrive (serial cables) I can test this puppy out using your Android app over wifi.

With this set up, you have all the tools to build, for instance, an autopilot:
Using BGRAbitmap and synapse talking to a microcontroller running servos...this can and should be very simple project for a beginner right out of the box.


x2nie

  • Sr. Member
  • ****
  • Posts: 451
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Ways to get people (future engineers) started with Free Pascal
« Reply #7 on: May 27, 2014, 08:19:56 am »
For now, I don't require to create a Teensy's firmware using FreePascal (and I don't know if it was possible),
but since Lazarus support development for Android, I think it would be great deal enough to communicate with Teensy using Android app (an Android built with Lazarus/FreePascal).


This way, would reduce the requirement of TFT/Touchscreen-board for Teensy, because using Android cheap phone will be better by the reason of comfortable for hand of the phone's chasing, great OS, keyboard on screen, etc.
I could image that we only need to attach a cable to Android device, and Teensy will do the rest.

Another possibility is to explore wireless communication between Android-FreePascal & controllers.
such providing sample code to control Teensy/Arduino via Bluetooth / WIFI / camera.
« Last Edit: May 27, 2014, 08:27:12 am by x2nie »
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

CaptBill

  • Sr. Member
  • ****
  • Posts: 431
Re: Ways to get people (future engineers) started with Free Pascal
« Reply #8 on: May 27, 2014, 10:02:57 am »
For now, I don't require to create a Teensy's firmware using FreePascal (and I don't know if it was possible),
but since Lazarus support development for Android, I think it would be great deal enough to communicate with Teensy using Android app (an Android built with Lazarus/FreePascal).


This way, would reduce the requirement of TFT/Touchscreen-board for Teensy, because using Android cheap phone will be better by the reason of comfortable for hand of the phone's chasing, great OS, keyboard on screen, etc.
I could image that we only need to attach a cable to Android device, and Teensy will do the rest.

Another possibility is to explore wireless communication between Android-FreePascal & controllers.
such providing sample code to control Teensy/Arduino via Bluetooth / WIFI / camera.

No need for a cable if you have a wifi router. You can easily communicate via wifi2serial very simply with LazSerial or Synapse.

This is the key...the router. Set it up right and you can even program the Teensy (or whatever) over wifi as if it was a USB connection.

This is a cool modded router perfect for this app:
http://www.ebay.com/itm/SLBoat-The-TL-WR703N-Mod-64Mbyte-RAM-16Mbyte-Flash-And-TTLout-Inside-MicroUSB-/181078954797?pt=COMP_EN_Routers&hash=item2a2925932d

http://youtu.be/UhdjAwxyp5s

CaptBill

  • Sr. Member
  • ****
  • Posts: 431
Re: Ways to get people (future engineers) started with Free Pascal
« Reply #9 on: May 27, 2014, 10:48:57 am »
But let's get to using real hardware ASAP!  That is what we do on this page:  http://www.turbocontrol.com/simpleserial.htm

I have hopes & plans to go further!  This small VM approach that I discovered yesterday might fit in very well: http://mikelev.in/ux/

The USB temperature sensor that I found 6.5 years ago is very inexpensive and has worked well for a simple hardware device.  Now I'm hoping to find a simple device that can run a simple Linux OS.  Any suggestions?

OpenWRT is a Linux OS that runs as firmware on a router. So we can write apps that run without a computer like a temperature logging app that reads directly from the serial port, for instance. Not sure if Lazarus can target it (yet). Again, I believe this Linksys wrt54g router is a excellent jump start project. Millions of them around and easy to mod for a beginner. I can't wait to try out your Android-Linux distro as a debug terminal. OpenWrt has GDB-server in the repo so plan to give it a try too.

http://youtu.be/o_7rMCPfCLk

x2nie

  • Sr. Member
  • ****
  • Posts: 451
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: Ways to get people (future engineers) started with Free Pascal
« Reply #10 on: May 27, 2014, 11:25:35 am »
Very promising demo. In your second video, it seem Android remotes a microcontroller (arduino?) without USB.


That is good starting point to try with Lazarus (LazSerial?).
But for dedicated machine, maybe direct-cable is better. Let say, I may stick my Android into embroidery machine.  :-[  ha ha ha..


Thanks you, it is inspiring me.
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

CaptBill

  • Sr. Member
  • ****
  • Posts: 431
Re: Ways to get people (future engineers) started with Free Pascal
« Reply #11 on: May 27, 2014, 11:47:13 am »
As soon as my parts arrive (and I don't muck something up ;D ) it should take 20 minutes to rig this up directly to X-plane to mimic the actual cockpit controls on multiple Android phones wirelessly using LazSerial or synapse.

This was built using the stock art from X-plane (just for testing, of coarse) and uErotate components ready to be rigged with LazSerial and the X-plane "server".

http://youtu.be/hFmuOaWZ9oQ




Paul Breneman

  • Full Member
  • ***
  • Posts: 242
    • Control Pascal
Re: Ways to get people (future engineers) started with Free Pascal
« Reply #12 on: June 09, 2014, 09:59:00 pm »
I just created a new (small) web page that mentions some of the things folks have replied about (thanks!): http://turbocontrol.com/devoptions.htm
Regards,
Paul Breneman
www.ControlPascal.com

Paul Breneman

  • Full Member
  • ***
  • Posts: 242
    • Control Pascal
Re: Ways to get people (future engineers) started with Free Pascal
« Reply #13 on: July 03, 2014, 12:48:51 pm »
There are simple tools (free and open source) and code for C and Pascal (Python hopefully soon) on this new page: http://ctrlpascal.com/picoscope.htm

If you are an experienced programmer then this probably doesn't apply to you. But if you or someone you know is just starting out, maybe these types of projects can be a valuable resource. These folks have been doing something similar (demonstrating simple tools) since 1998: http://software-carpentry.org/
Regards,
Paul Breneman
www.ControlPascal.com

Paul Breneman

  • Full Member
  • ***
  • Posts: 242
    • Control Pascal
Re: Ways to get people (future engineers) started with Free Pascal
« Reply #14 on: July 10, 2014, 07:57:01 pm »
A simple Python example has been added to the page noted in the previous message.
Regards,
Paul Breneman
www.ControlPascal.com

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus