User manual

mikroPascal PRO for PIC32
MikroElektronika
425
// then remote host port number
WordToStr(remotePort, tmp);
dyna[16] := tmp[0];
dyna[17] := tmp[1];
dyna[18] := tmp[2];
dyna[19] := tmp[3];
dyna[20] := tmp[4];
dyna[21] := ‘[‘;
WordToStr(destPort, tmp);
dyna[22] := tmp[0];
dyna[23] := tmp[1];
dyna[24] := tmp[2];
dyna[25] := tmp[3];
dyna[26] := tmp[4];
dyna[27] := ‘]’;
dyna[28] := 0;
// the total length of the request is the length of the dynamic string plus the text
of the request
result := 28 + reqLength;
// puts the dynamic string into the transmit buffer
SPI_Ethernet_putBytes(@dyna, 28);
// then puts the request string converted into upper char into the transmit buffer
while(reqLength <> 0) do
begin
SPI_Ethernet_putByte(SPI_Ethernet_getByte());
reqLength := reqLength - 1;
end;
// back to the library with the length of the UDP reply
end;
begin
CHECON := 0x32;
AD1PCFG := 0xFFFC; // all digital but RB1(AN1) and RB0 (AN0)
PORTB := 0;
TRISB := 0xFFFF; // set PORTB as input for buttons and adc
PORTD := 0;
TRISD := 0; // set PORTD as output,
ADC1_Init();
httpCounter := 0;
// set mac address
myMacAddr[0] := 0x00;
myMacAddr[1] := 0x14;
myMacAddr[2] := 0xA5;
myMacAddr[3] := 0x76;
myMacAddr[4] := 0x19;
myMacAddr[5] := 0x3F;