4 Replies Latest reply on Aug 23, 2019 4:03 PM by CaDu_3933941

    PSOC HC-05 communication

    CaDu_3933941

      Hi all,

       

      I am currently working on an RC car for which my wireless communication module is an H-05. The kit I am using is the CY8CKIT-059. I have never used them before but so far I have managed to pair them. I am currently trying to try something simple to test like driving an LED on the other board. So far I have been unsuccessful. I do not know how to attach a project so I will attach the code and some pictures which should be enough.

       

      Transmitter:

       

      /* ========================================

      *

      * Copyright YOUR COMPANY, THE YEAR

      * All Rights Reserved

      * UNPUBLISHED, LICENSED SOFTWARE.

      *

      * CONFIDENTIAL AND PROPRIETARY INFORMATION

      * WHICH IS THE PROPERTY OF your company.

      *

      * ========================================

      */

      #include "project.h"

       

       

      int Rx;

      char str;

       

       

      int main(void)

      {

          CyGlobalIntEnable; /* Enable global interrupts. */

       

       

          UART_1_Start();

       

       

          for(;;)

          {

              if(BTN_Read()==0){

                  UART_1_PutChar(100);

                  Pin_1_Write(1);

              }

             

              else{

                  UART_1_PutChar(100);

                  Pin_1_Write(0);

              }

             

             

             

             

          }

      }

       

       

      /* [] END OF FILE */

       

      Receiver:

      /* ========================================

      *

      * Copyright YOUR COMPANY, THE YEAR

      * All Rights Reserved

      * UNPUBLISHED, LICENSED SOFTWARE.

      *

      * CONFIDENTIAL AND PROPRIETARY INFORMATION

      * WHICH IS THE PROPERTY OF your company.

      *

      * ========================================

      */

      #include "project.h"

       

       

      uint8_t Rx;

      char str [120];

       

       

      int main(void)

      {

          CyGlobalIntEnable; /* Enable global interrupts. */

       

       

          UART_1_Start();

       

          for(;;)

          {

             

              Rx = UART_1_GetChar();

              UART_1_PutChar(Rx);

             

          }

      }

       

       

      /* [] END OF FILE */

       

      Any help is appreciated.

       

      Thanks