My project with an LCD doesn´t work anymore

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
jaro_4538801
Level 1
Level 1

I'm trying to make a luxometer using PSOC 5LP CY8C5888LTI-LP097 with this code

#include <project.h>
#include <stdio.h>
#include <math.h>

int main()
{
    uint8 i;
    int Lux;
    LCD_Start();
    char8 publicar1 [22];
    float32 conversion1,conversion2;
    CyGlobalIntEnable;
    ADC1_Start();
    ADC1_StartConvert();
    ADC1_IsEndConversion(ADC1_WAIT_FOR_RESULT);
   
    for(;;)
    {
        LCD_PrintString("Int.Luminosa");
        LCD_Position(1,8);
        conversion1 = ADC1_GetResult16(0);
        conversion2 = ((5.000000*conversion1)/1024)*0.232;
        Lux = ((2500/conversion2)-500)/5;
       LCD_PrintString("Lux");
        LCD_PrintNumber(Lux);
       LCD_Position(0,2);
       
        CyDelay(200);
       
        if(Lux>=51 && Lux <=200)
        {
            for(i=0;i<30;i+=2)
            {
                LCD_DrawHorizontalBG(1,0,2,i);
                CyDelay(150);
            }
            LCD_ClearDisplay();
        }
        if(Lux>=202 && Lux <=350)
        {
            for(i=0;i<30;i+=2)
            {LCD_DrawHorizontalBG(1,0,3,i);
            CyDelay(150);
            }
            LCD_ClearDisplay();
        }
        if(Lux>=360 && Lux <=600)
        {
            for(i=0;i<30;i+=2)
            {LCD_DrawHorizontalBG(1,0,4,i);
            CyDelay(150);
            }
            LCD_ClearDisplay();
        }
        if(Lux>=620)
        {
            for(i=0;i<30;i+=2)
            {LCD_DrawHorizontalBG(1,0,5,i);
            CyDelay(150);
            }
            LCD_ClearDisplay();
        }
    }
}

and this is the diagram for the protoboard

77268700_566917874134039_344368038251855872_n.jpg

and the ports P2[6:0] and P0[6]

please help

0 Likes
0 Replies