User manual
mikroPascal PRO for PIC32
MikroElektronika
473
// If Port Expander Library uses SPI2 module
// Initialize SPI module used with PortExpander
SPI2_Init_Advanced(_SPI_MASTER,_SPI_8_BIT, 4, _SPI_SS_DISABLE,_SPI_DATA_SAMPLE_
MIDDLE,_SPI_CLK_IDLE_LOW,_SPI_ACTIVE_2_IDLE);
SPI_Lcd8_Cong(0); // Initialize Lcd over SPI interface
SPI_Lcd8_Cmd(_LCD_CLEAR); // Clear display
SPI_Lcd8_Cmd(_LCD_CURSOR_OFF); // Turn cursor off
SPI_Lcd8_Out(1,6, ‘mikroE’); // Print text to Lcd, 1st row, 6th column
SPI_Lcd8_Chr_CP(‘!’); // Append ‘!’
SPI_Lcd8_Out(2,1, text); // Print text to Lcd, 2nd row, 1st column
Delay_ms(2000);
// Moving text
for counter := 0 to 3 do // Move text to the right 4 times
begin
Spi_Lcd8_Cmd(_LCD_SHIFT_RIGHT);
Move_Delay();
end;
while TRUE do // Endless loop
begin
for counter := 0 to 6 do // Move text to the left 7 times
begin
Spi_Lcd8_Cmd(_LCD_SHIFT_LEFT);
Move_Delay();
end;
for counter := 0 to 6 do // Move text to the right 7 times
begin
Spi_Lcd8_Cmd(_LCD_SHIFT_RIGHT);
Move_Delay();
end;
end;
end.