User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
511
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_Cong(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
// SPI_Lcd8_Out(3,1,”mikroE”); // For Lcd with more than two rows
// SPI_Lcd8_Out(4,15,”mikroE”); // For Lcd with more than two rows
Delay_ms(2000);
// Moving text
for(i=0; i<4; i++) { // Move text to the right 4 times
SPI_Lcd8_Cmd(_LCD_SHIFT_RIGHT);
Move_Delay();
}
while(1) { // Endless loop
for(i=0; i<8; i++) { // Move text to the left 7 times
SPI_Lcd8_Cmd(_LCD_SHIFT_LEFT);
Move_Delay();
}
for(i=0; i<8; i++) { // Move text to the right 7 times
SPI_Lcd8_Cmd(_LCD_SHIFT_RIGHT);
Move_Delay();
}
}