We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
posted on 2013/05/14 09:57:56 AM CEST
hi
im trying to display different messages when push button is depressed. the program buids in mikro c but when connected
the message to be displayed when switch is depressed comes up even if the swith is off can any one helpsource code is below
//HEADER*******************************************************************************
// LCD module connections
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
// End LCD module connections
// Define Messages
char text1[] = "test 1";
char text2[] = "lcd on";
char text3[] = "test 2";
char text4[] = "good";
char text5[] = "test 3 ";
char text6[] = "fine";
char text7[] = "test5";
char text8[] = "good";
char text9[] = "test 7";
char text10[] = "good";
char text11[] = "test 8";
char text12[] = "good";
char text13[] = "test9";
void main() {
CMCON |= 7; // Disable Comparators
TRISB = 0;
PORTB = 0;
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
PORTA = 255;
TRISA = 255;
Lcd_Init(); // Initialize LCD
do {
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,1,text1); // Write message1 in 1st row
Lcd_Out(2,1,text2); // Write message1 in 2nd row
Delay_ms(1000); // delay 3s
Lcd_Cmd(_LCD_CLEAR); // Clear display
Delay_ms(1000); // delay 1s
Lcd_Out(1,1,text1); // Write message3 in 1st row
Lcd_Out(2,1,text4);
Delay_ms(8000); // delay 15S
} while(0);
if(Button(&PORTA,3,1,1))
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,1,text5); // Write message1 in 1st row
Lcd_Out(2,1,text6); // Write message1 in 2nd row
Delay_ms(3000); // WAIT 3 SEC
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,1,text1); // Write message1 in 1st row
Lcd_Out(2,1,text7); // Write message1 in 2nd row
Delay_ms(15000);
while(1);
}
posted on 2013/05/13 07:50:34 AM CEST
Hi,
Anybody have the mikroC program for Brushless DC ( BLDC ) sensored or sensorless motor control using pic16F or 18F .
posted on 2013/05/13 03:10:54 AM CEST
Hi,
i`m trying connect the rotary encoder ED1112S-20 to development board with PIC18F45K22,
and needed code or/and library to rotary encoder for mikroC Pro.
Please Help me.
posted on 2013/05/11 09:40:12 PM CEST
posted on 2013/05/11 04:22:34 PM CEST
hi everybody ı am programming pic 16f877a for my thesis and ı need to your help. I will use rgb sensor from texas ins. Tsc 3200
and ı need to source code and ı dont have any experience how do you programming or how should ı start in program. please explain me and step by step or just help me to begin my program. Thanks and regards. mikro c 2*16 lcd 16f877a tcs3200 rgb sensor