App to realize graphical data from a microcontroller(PSOC) and storing the data

So I was interfacing between hc05 and psoc(microcontroller). data cannot be read in this particular app installed.

graphdata.aia (10.8 KB)

Please see the Delimiter article in FAQ

Be sure to use println() at the end of each message to send from the sending device, to signal end of message. Do not rely on timing for this, which is unreliable.

In the AI2 Designer, set the Delimiter attribute of the BlueTooth Client component to 10 to recognize the End of Line character.
Also, return data is not immediately available after sending a request,
you have to start a Clock Timer repeating and watch for its arrival in the Clock Timer event. The repeat rate of the Clock Timer should be faster than the transmission rate in the sending device, to not flood the AI2 buffers.

In your Clock Timer, you should check

  Is the BlueTooth Client still Connected?
  Is Bytes Available > 0?
     IF Bytes Available > 0 THEN
       set message var  to BT.ReceiveText(-1) 

This takes advantage of a special case in the ReceiveText block:

Receive text from the connected Bluetooth device. If numberOfBytes is less than 0, read until a delimiter byte value is received.

If you are sending multiple data values per message separated by | or comma, have your message split into a local or global variable for inspection before trying to select list items from it. Test if (length of list(split list result) >= expected list length) before doing any select list item operations, to avoid taking a long walk on a short pier. This bulletproofing is necessary in case your sending device sneaks in some commentary messages with the data values.

If no data is arriving, the problem might be in your .ino file, which you did not provide.

Regarding your blocks,

your connect button is asking for an unusual address CC:CC:CC:CC...

Also, be aware that AI2 now has very friendly graph components.
There is no need to build your own.

Please check the below aia.file and can you point out my Error. I don't really think i made an error.
This app was working with Arduino, doesn't work in psoc microcontroller.
graphdata.aia (10.8 KB)

Please stay public and in your original thread.

Show your psoc code.

code.txt (739 Bytes)

I don't see any Line Feeds in your output stream.
I don't even see any data.

/* ========================================
 * All Rights Reserved
 * WHICH IS THE PROPERTY OF your company.
 * ========================================
#include <project.h>
char value;
int main()
    CyGlobalIntEnable; /* Enable global interrupts. */
    /* Place your initialization/startup code here (e.g. MyInst_Start()) */

        /* Place your application code here. */

/* [] END OF FILwhileE */

It's a simple code just to produce a straight-line graph.

code.txt (746 Bytes)
code for a square graph.

You are sending bytes, but your app is trying to receive text delimited by Line Feeds.

Make up your mind, and be consistent.

1 Like