Yoctopuce Yocto-MaxiDisplay Mode D'emploi page 153

Module électronique
Table des Matières

Publicité

program
helloworld;
{$APPTYPE CONSOLE}
uses
SysUtils,
Windows,
yocto_api,
yocto_display;
Procedure
Usage();
var
exe : string;
begin
exe:= ExtractFileName(paramstr(0));
WriteLn(exe+'
WriteLn(exe+'
WriteLn(exe+'
sleep(2500);
halt;
End;
var
disp
: TYDisplay;
l0,l1
: TYDisplayLayer;
errmsg
: string;
w,h
: integer;
x,y,vx,vy :integer;
begin
if (paramcount<1) then
// Setup the API to use local USB devices
if
yRegisterHub('usb', errmsg)<>YAPI_SUCCESS
begin
Write('RegisterHub error:
exit;
end;
// first one of the two RBG leds
if
paramstr(1)='any'
begin
disp := yFirstDisplay();
if disp=nil then
begin
writeln('No module connected (check USB
halt;
end
end
else
disp:= YFindDisplay(paramstr(1)+'.display');
// make sure it is online
if not(disp.isOnline()) then
begin
writeln('No module connected (check USB
halt;
end;
// display clean up
disp.resetAll();
// retreive the display size
w:=disp.get_displayWidth();
h:=disp.get_displayHeight();
// reteive the first layer
L0:=Disp.get_displaylayer(0);
// display a text in the middle of the screen
L0.drawText(w
div
// visualize eah corner
L0.moveto(0,5);L0.lineto(0,0);L0.lineto(5,0);
L0.moveto(0,h-6);L0.lineto(0,H-1);L0.lineto(5,H-1);
L0.moveto(w-1,h-6);L0.lineto(w-1,H-1);L0.lineto(w-6,H-1);
L0.moveto(w-1,5);L0.lineto(w-1,0);L0.lineto(w-6,0);
// draw a circle in the top left corner of layer 1
www.yoctopuce.com
<serial_number>');
<logical_name>');
any');
usage();
'+errmsg);
then
2, h
div
2, Y_ALIGN_CENTER,
19. Utilisation du Yocto-MaxiDisplay en Delphi
then
cable)');
cable)');
'Hello world!'
);
147

Publicité

Table des Matières
loading

Ce manuel est également adapté pour:

Yocto-displayYocto-color-v2

Table des Matières