new proyect with nRF52840, how to start.

hello, im using nRF52840, pca10056, I was using the example ble uart from examples\peripheral\uart im planning on  replacing the use of "putty" PC application with a program specifically developed to capture and store the information of the messages that are sent from the mobile terminal (by BT) in a file (txt, csv), im planing on using python. I must open a serial port on the PC (the COM that opens when connecting Nordic via USB to the PC) and  it must read the messages that are received, saving them to a file. The case will be the following. From the mobile application, a series of lines with texts will be obtained that will have to be replicated in a file (txt extension) on the PC. for the mian code of uart im using segger embedded studio. any help is welcome. 

Parents Reply
  • Hi.

    anaglez97 said:
    i want to send/recieve data from pc to mobile phone by bluetooth

    See this example.

    anaglez97 said:
    store the data in a file (txt) using python.

    This code snippet shows how to retrieve data from a COM part in Python:

    import serial
    
    s = serial.Serial('COM9', 115200, timeout=None,parity =serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, bytesize=serial.EIGHTBITS)
    res = s.read()
    print("Started")
    
    
    while 1:
      res = s.read()
      print(res)
    

    To store the data in a text file see this documentation and this example.

    regards

    Jared 

Children
No Data
Related