1 Reply Latest reply on Jun 11, 2018 11:42 AM by e.pratt_1639216

    PSoC 4 BLE - Read Barcode Input Using UART

    rwirth_3472246

      Hi,

       

      I am trying to read a value form a barcode scan using UART and the RX pin on the CY8CKIT-042-BLE (PSoC 4 BLE). The following is my code (modified from the HID Keyboard Example, as the goal is to send the value of the scan to a device, emulating a keyboard). I am unable to get any results from the scan to output on a PuTTY terminal. Any ideas on what I am doing wrong?

       

      int main()

      {

         uint32 rxData;

       

          CyGlobalIntEnable;

           #if (DEBUG_UART_ENABLED == ENABLED)

               UART_DEB_Start();

           #endif /* (DEBUG_UART_ENABLED == ENABLED) */

               DBG_PRINTF("BLE HID Keyboard Example Project \r\n");

       

          Disconnect_LED_Write(LED_OFF);

          Advertising_LED_Write(LED_OFF);

          CapsLock_LED_Write(LED_OFF);

       

          /* Start CYBLE component and register generic event handler */

          CyBle_Start(AppCallBack);

          WDT_Start();

       

           #if (BAS_MEASURE_ENABLE != 0)

               ADC_Start();

           #endif /* BAS_MEASURE_ENABLE != 0 */

       

       

          while(1)

          {   

              /* CyBle_ProcessEvents() allows BLE stack to process pending events */

              CyBle_ProcessEvents();

       

              /* To achieve low power in the device */

              LowPowerImplementation();

         

              rxData = UART_DEB_UartGetChar();

               if(rxData)

               {

                   UART_DEB_UartPutChar(rxData);

                }

      .......

         

      Thanks in advance,

      Ryan