Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - peeter123

1
USB serial LCD backpack / Re: LCD BACKPACK on the DP USB stack, test hex file V1 here.
The problem is in this piece of code(HD44780.c):
Code: [Select]
//backlight control
//the LED draws a lot of power when it comes on
void LCD_Backlight(unsigned char c){
        unsigned char i;

        if(c){
                //turn on slowly with PWM
                for(i=0; i<255; i++){
                        LCD_BL=1; //backlight ON       
                        delayUS(i);//on for increasing us
                        LCD_BL=0; //backlight OFF
                        delayUS((255-i));//off for decreasing us
                }     
                LCD_BL=1; //exit with light ON 
        }else{
                LCD_BL=0; //backlight off
        }
}

LCDproc sends backlight on command every time it sends something to the display so the backlight is flashing. We should not soft turn-on the screen if it is already on.

I think it should be something  like this:

Code: [Select]
//backlight control
//the LED draws a lot of power when it comes on
void LCD_Backlight(unsigned char c){
        unsigned char i;

        if(c && !LCD_BL){
                //turn on slowly with PWM
                for(i=0; i<255; i++){
                        LCD_BL=1; //backlight ON       
                        delayUS(i);//on for increasing us
                        LCD_BL=0; //backlight OFF
                        delayUS((255-i));//off for decreasing us
                }     
                LCD_BL=1; //exit with light ON 
        }else if(!c){
                LCD_BL=0; //backlight off
        }
}

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01742281976session_write_close ( )...(null):0
20.01802413576ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01802414352Database_MySQL->query( ).../DatabaseHandler.php:119
40.06902553096Database_MySQL->error( ).../Db-mysql.class.php:273