Maxbox Arduino Pascal Magazine
Maxbox Arduino Pascal Magazine
Maxbox Arduino Pascal Magazine
maXbox
Arduino hardware is programmed using a Wiringbased language (syntax and libraries), similar to C++
and Object Pascal with some simplifications and
modifications, and a Processing-based integrated
development environment like Delphi or Lazarus
with Free Pascal.
Current versions can be purchased preassembled;
hardware design information is available for
those who would like to assemble an Arduino by
hand. Additionally, variations of the Italianmade Arduino with varying levels of
compatibility have been released by third
parties; some of them are programmed using the
Arduino software or the sketch firmware.
The Arduino is what is known as a Physical or
Embedded Computing platform, which means
that it is an interactive system that through the
use of hardware, firmware and software can
interact with its environment.
maXbox
maXbox
after
publishing this issue).
It is generally easy to use for basic serial
communications purposes, alternative to the
TurboPower ASYNCPro .
It includes 5 components: TComPort,
TComDataPacket, TComComboBox,
TComRadioGroup and TComLed.
Figure 1:
The GUI of the Win App
maXbox
71
maXbox
with HTTPServer do
begin
If Active then Free;
If not Active then
begin
Bindings.Clear;
bindings.Add;
bindings.items[0].Port:= APORT;
bindings.items[0].IP:= IPADDR;
//'127.0.0.1'; 192.168.1.53'
Active:= true;
onCommandGet:= @HTTPServerGet;
PrintF('Listening HTTP on %s:%d.',
[Bindings[0].IP,Bindings[0].Port]);
end;
Log Result
<<extend>>
Actor HEX in the BOX
Control LED
Matrix
<<include>>
Arduino Board
RGB LED
72
maXbox
maXbox
ON');
cPort.WriteStr('A');
RespInfo.ContentText:=
getHTMLContentString('LED is:
end
OFF Switch')
end
maXbox
73
maXbox
begin
One of a practical way to learn much more
idHTTP:= TIdHTTP.Create(NIL)
about actually writing HTML is to get in
try
maXbox editor and load or open a web-file
memo2.lines.text:= idHTTP.Get2('http://127.0.0.1')
for i:= 1 to 10 do
with the extension html. Or you copy the
memo2.lines.add(IntToStr(i)+' :'+memo2.lines[i])
output and paste it in a new maXbox instance.
finally
Then you click on the context menu and
idHTTP.Free
change to HTML Syntax!
end
In this mode the PC is a master and executes
the control algorithm while the Arduino or Delphi
The Object TIdHTTP is a dynamically
Controller acts as an interface slave and follows
allocated block of memory whose structure
commands coming from the PC or browser
is
determined by its class type. With the
through its RS232 port. Each RGB field in these
method
Get1 you can download files.
records reflects a state of the sensors and
actuators of the LED in those sense only actors as
begin
LED light are in use.
myURL:=
A running Arduino (M485A) monitor server will
'http://www.softwareschule.ch/download/maxbox_examples.zip
accept commands on input through a RS232 port:
zipStream:= TFileStream.Create('myexamples2.zip', fmCreat
idHTTP:= TIdHTTP.Create(NIL)
try
idHTTP.Get1(myURL, zipStream)
if (val=='1'){
digitalWrite(ledPin11,HIGH); }
else if (val=='A'){
digitalWrite(ledPin1,LOW);
}
if (val=='2'){
digitalWrite(ledPin2,HIGH); }
wGet('http://www.softwareschule.ch/download/maxbox_starter17.pdf',
'mytestpdf.pdf');
maXbox
ON');
maXbox
int val = 0;
..}
}
Serial.print("Data entered: ");
maXbox
75
maXbox
6: Breadboard Settings
76
maXbox
maXbox
// TS_ShellExecuteCmd = (seCmdOpen,seCmdPrint,seCmdExplore);
begin
//ShellAPI.ShellExecute(Handle,PChar('open'),'http://127.0.0.1:80/',Nil,Nil,0);
S_ShellExecute('http:'+IPADDR+':'+IntToStr(APORT)+'/','',seCmdOpen)
end;
http://www.softwareschule.ch/download/
webofthings2013.pdf
http://www.softwareschule.ch/
maxbox.htm
http://www.indyproject.org/
Sockets/index.EN.aspx
http://en.wikipedia.org/wiki/Arduino
http://fritzing.org/
http://sourceforge.net/projects/maxbox
http://sourceforge.net/projects/
delphiwebstart
http://www.blaisepascal.eu/index.php?
actie=./subscribers/
UK_Electronics_Department
http://www.blaisepascal.eu/subscribers/
vogelaar_elctronics_info_english.php
APPENDIX DELPHI CONTROLLER
http://www.blaisepascal.eu/index.php
?actie=./subscribers/UK_Electronics_Department
DELPHI SCHEMA
Literature:
maXbox
77