Lazarus

Free Pascal => Beginners => Topic started by: jb007 on March 10, 2016, 09:31:01 am

Title: Arduino
Post by: jb007 on March 10, 2016, 09:31:01 am
Hi, 

just a very easy question, no details needed:

Can I use FreePascal to programm and upload to an Arduino?
( as embedded software without an OS )

If not, annyone got a good suggestion? I googled around but I don't get it...

I only know TurboPascal and it's too much for me to learn a C language.
See her some projects ( done in Turbo Pascal ),cnc and  robot-arm:

https://www.youtube.com/channel/UCGdece-f-TRRRMBFn51fk-g

Tnx in advance!








Title: Re: Arduino
Post by: jb007 on March 10, 2016, 09:37:59 am
Question should be:

Can I use Lazarus/FreePascal?
Title: Re: Arduino
Post by: mig-31 on March 10, 2016, 10:04:06 am
Hi,

I think there is FreePascal for AVR in trunk.
Title: Re: Arduino
Post by: jb007 on March 10, 2016, 10:27:18 am
Tnx. I will check that this evening.

Got some diagram.

Current SetUp and "NEW Setup" with Arduino:
Title: Re: Arduino
Post by: avra on March 10, 2016, 12:17:55 pm
Can I use FreePascal to programm and upload to an Arduino?
Have you tried to search forum?

http://forum.lazarus.freepascal.org/index.php/topic,31513.msg202960.html#msg202960
http://forum.lazarus.freepascal.org/index.php/topic,30960.0.html
http://forum.lazarus.freepascal.org/index.php/topic,29128.msg183767.html#msg183767
http://forum.lazarus.freepascal.org/index.php/topic,12219.msg90805.html#msg90805
Title: Re: Arduino
Post by: mig-31 on March 10, 2016, 02:48:27 pm
Insteand of Aurdino, you can use ARM board with Linux RT kernel.
Title: Re: Arduino
Post by: jb007 on March 10, 2016, 06:37:00 pm
Hi, tnx!

Yes, did search the forum but I didn't get a clear overview for myself. So much information.

@mig-31
If I have to step to ARM-board with Linux RT kernel, it would be easier for me to step over to R- PI.

Gonna try the Mikropascal limited free version.
The programm in the Arduino has to do the following.

- 10 times a second: Arduino ADC's reading analog joysticks and send it to pc.
- 10 times a second: pc send commands to Arduino for eacht steppermotor.
   
PC does the complete robot kinematics etc. The Arduino only has to send the DirectionSignal and Step-Pulses to the StepperMotorDrivers.

I ques my programm HEX-file for Arduino will not reach the 4kb free version MikroPascal









Title: Re: Arduino
Post by: avra on March 13, 2016, 10:26:38 pm
PC does the complete robot kinematics etc. The Arduino only has to send the DirectionSignal and Step-Pulses to the StepperMotorDrivers.
I ques my programm HEX-file for Arduino will not reach the 4kb free version MikroPascal
Maybe. If you do not need acceleration/decceleration ramps.
Title: Re: Arduino
Post by: jb007 on March 16, 2016, 06:51:52 pm
Hi,

you got it right Avra!

Got a begin in programming mikroPascal-AVR.
Can read the analog joysticks and "display" them on some LED bar-graphs.
( for test and learn this is very nice )

Also startded using Lazarus. have some experience in Delphi, but Lazarus looks ok.

Most important step now is to create a serial conenction between PC(Lazarus) and Arduino(mikroPascal-AVR).
Title: Re: Arduino
Post by: jb007 on March 17, 2016, 10:57:47 am
Got problem:

Only get following when compiling etc, even after "clean up and rebuild":





Googled and searched this forum bu I don't get a clue...

Anybody can help me?
Tnx.
Title: Re: Arduino
Post by: jb007 on March 20, 2016, 01:53:20 pm
Please, can anyone help me?

Thanks in advance!
Title: Re: Arduino
Post by: jmpessoa on March 20, 2016, 05:46:14 pm
Quote
Most important step now is to create a serial conenction between PC(Lazarus) and Arduino(mikroPascal-AVR)....

Well, here:

https://github.com/jmpessoa/lazarduinomodulewizard

there are: LamwinoDemo3 and LamwinoDemo4 and a pure free pascal unit "lamwinoavrserial.pas"  in "....\templates" 

may be useful for you....





Title: Re: Arduino
Post by: jb007 on March 20, 2016, 09:13:56 pm
Hi, tnx, jmpessoa.

Firts thing I got to solve is to get a programma run/complied/build at all in Lazarus.
With or without serial comm or whatever.

Just resently installed and started with Lazarus but I don't get a programm run.

Only get following when compiling etc, even after "clean up and rebuild":





Googled and searched this forum bu I don't get a clue...
Title: Re: Arduino
Post by: jb007 on March 21, 2016, 11:11:26 am
Tonight 'm gonna try to install complete Lazarus over again and check all the instal settings and see if anything will run.
Title: Re: Arduino
Post by: jb007 on March 24, 2016, 09:33:09 am
Installed again, it works.
Title: Re: Arduino
Post by: herux on March 24, 2016, 10:26:30 am
read this http://forum.lazarus.freepascal.org/index.php/topic,30960.msg206256/topicseen.html
Title: Re: Arduino
Post by: jb007 on August 08, 2016, 10:07:27 pm
After a break, got some significant progress!

Value of 3 ScrollBars is sended by RS232 to my Arduino.
At 3 LedBars, the values are displayed as (0-255) values.
( gonna be in 0 to 8 led's later as is it showing an audio-level-indicater )

In Lazarus the refresh rate is 10/sec. Only the value of the last changed Scrollbar is sended to Arduino. At my Lazarus INIT al of the 3 wil be sended!
Title: Re: Arduino
Post by: jb007 on August 08, 2016, 10:07:57 pm
I'm using

1 byte as LedbarNumber and

3 bytes as LedBarValue.

The string 'el' (end-line) is added as delimiter.

I'm very happy I got this far programming RS232.

Next step is to controll my robotArm by PC-RS232-Arduino!


Fortunately I got the major part for controlling my robotArm allready
coded in TurbuPascal7.0 and the control is done by ISA/ 82c55a.

The whole ForWard/BackWard-Kinematics, stepperControl and overal mathematics for Interpolation/Integral/Differential for creating a path in 3d.

http://europakade.nl/motion-control-an-robots/robot-arm

https://www.youtube.com/playlist?list=PL7iWs5bvJdxs91kCZUV9P6KuG4mvriLgJ
Title: Re: Arduino
Post by: jb007 on August 25, 2017, 07:14:42 pm
Hi,

allready some time ago but I wanted this tho share with you:


For programming my Arduino's, I'm using mikroPascal for AVR.

On my pc: got Lazarus running very smooth!

On my raspberry PI's: got Lazarus running and did some first tests.

Kind regards.



TinyPortal © 2005-2018