Welcome in the forum.
Printing floats needs some settings:
- Set "use newlib nano" to true (Project butld settings -> linker)
- Set "use newlib nano float formatting" to true (Project butld settings -> linker)
- Set "Heap Size" to 0x0200 (System view)
That should do the job
I still can't get the float values on the terminal. What is the API to be used to print float?
Your program seems ok so far. Can you please post your complete project or a shortened version that shows the error so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Here is your program and it is working. I don't have the component you where using for the Flex so I just stuck some default items in the program for resistance and bend angle. The issue was in Project settings it was not working after Resistance in ohms print out. Now it is working you will need to take out the default values.
As you didn't send your program I pasted your information in to a PSoc Ble device CY8C4247LQI-BL483 I picked this as your post was in IOT. If that is not the correct device you can change it to your device.
Thank you Bob for helping me yesterday. I was able to configure my flex sensor.
Can you assist me how I can use the map function in my program
float angle = map(flexR, STRAIGHT_RESISTANCE, BEND_RESISTANCE, 0, 90.0);
/* angle= (flexR-STRAIGHT_RESISTANCE)*(90.0-0.0)/(BEND_RESISTANCE-STRAIGHT_RESISTANCE)+0.0; */