You are on page 1of 5

program Manipulator_solar;

var text1, text2: array[16] of char;


//var x,y,z : word; txt1,txt2,txt3 : string[3];
//var i,j : byte;
label sus,dreapta,jos,stanga,ods,odj,osj,oss,start;
begin
TRISB := 0;
TRISC := 0;
TRISD := $FF;
PORTB := 0;
PORTC := 0;
PORTD := $FF;
TRISB := 0;
// PORTB is output
Lcd_Init(PORTB);
// Initialize LCD on PORTB
Lcd_Cmd(LCD_CURSOR_OFF);
// Turn off cursor
start:
text1 := ' Light scanner ';
text2 := ' Activated
';
Lcd_Out(1, 1, text1);
// Print text at LCD
Lcd_Out(2, 1, text2);
if PORTD = 4 then goto sus;
if PORTD = 8 then goto dreapta;
if PORTD = 16 then goto jos;
if PORTD = 32 then goto stanga;
if PORTD = 12 then goto ods;
//oblic dreapta sus
if PORTD = 24 then goto odj;
if PORTD = 48 then goto osj;
if PORTD = 36 then goto oss;
PORTC := 51;
goto start;
//_________________________________________
sus:
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 49;
Delay_ms(20);
PORTC := 51;
Delay_ms(20);
PORTC := 50;
Delay_ms(20);
PORTC := 54;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 52;
Delay_ms(20);
PORTC := 60;
Delay_ms(20);
PORTC := 56;
Delay_ms(20);
PORTC := 57;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
goto sus;
//_________________________________________
dreapta:

if PORTD = 124 then goto start;


if PORTD = 64 then goto start;
PORTC := 19;
Delay_ms(20);
PORTC := 51;
Delay_ms(20);
PORTC := 35;
Delay_ms(20);
PORTC := 99;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 67;
Delay_ms(20);
PORTC := 195;
Delay_ms(20);
PORTC := 131;
Delay_ms(20);
PORTC := 147;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
goto dreapta;
//_________________________________________
stanga:
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 147;
Delay_ms(20);
PORTC := 131;
Delay_ms(20);
PORTC := 195;
Delay_ms(20);
PORTC := 67;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 99;
Delay_ms(20);
PORTC := 35;
Delay_ms(20);
PORTC := 51;
Delay_ms(20);
PORTC := 19;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
goto stanga;
//_________________________________________
jos:
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 57;
Delay_ms(20);
PORTC := 56;
Delay_ms(20);
PORTC := 60;
Delay_ms(20);

PORTC := 52;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 54;
Delay_ms(20);
PORTC := 50;
Delay_ms(20);
PORTC := 51;
Delay_ms(20);
PORTC := 49;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
goto jos;
//_________________________________________
ods:
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 17;
Delay_ms(20);
PORTC := 51;
Delay_ms(20);
PORTC := 34;
Delay_ms(20);
PORTC := 102;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 68;
Delay_ms(20);
PORTC := 204;
Delay_ms(20);
PORTC := 136;
Delay_ms(20);
PORTC := 153;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
goto ods;
//_________________________________________
odj:
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 25;
Delay_ms(20);
PORTC := 56;
Delay_ms(20);
PORTC := 44;
Delay_ms(20);
PORTC := 100;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 70;
Delay_ms(20);
PORTC := 194;
Delay_ms(20);

PORTC := 131;
Delay_ms(20);
PORTC := 145;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
goto odj;
//_________________________________________
osj:
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 153;
Delay_ms(20);
PORTC := 136;
Delay_ms(20);
PORTC := 204;
Delay_ms(20);
PORTC := 68;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 102;
Delay_ms(20);
PORTC := 34;
Delay_ms(20);
PORTC := 51;
Delay_ms(20);
PORTC := 17;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
goto osj;
//_________________________________________
oss:
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 145;
Delay_ms(20);
PORTC := 131;
Delay_ms(20);
PORTC := 194;
Delay_ms(20);
PORTC := 70;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
PORTC := 100;
Delay_ms(20);
PORTC := 44;
Delay_ms(20);
PORTC := 56;
Delay_ms(20);
PORTC := 25;
Delay_ms(20);
if PORTD = 124 then goto start;
if PORTD = 64 then goto start;
goto oss;

end.

You might also like