8 Replies Latest reply on Nov 19, 2016 8:48 AM by avethoplays_2007616

    PSoC 5LP Reading Pins

    avethoplays_2007616

      I am very new to PSoC, and have very limited experience with C++, and none with C. I am trying to read the signal on a pin and toggle a boolean value to change the blinking speed of an external LED. Here's the code:

         

      int main()
      {
          bool button1;
          LCD_Char_Start();
          LCD_Char_PrintString("Hola Mundo!");

         


          for(;;)
          {
              if(CyPins_ReadPin(Pin_1_0) !=0) {
                  button1 = !button1;
                  CyDelay(100);
              }
              if(button1) {
                  CyDelay(1000u);
              } else {
                  CyDelay(250u);
              }
              P0_0_Write(!P0_0_Read());
          }
      }

         

      The CyPins thing I got from another thread and the LCD stuff is from the Hello World example project. The LCD doesn't work though. I also kept include project.h and added stdbool.h for booleans. Any idea what I might be doing wrong?

         

      Edit: I should probably mention I have the CY8CKIT-059 and if it matters to mention too, the chip is the CY8C5888LTI-LP097.