You should define your input pin as "Resistive pull up" with "initial drive state" high (1)
When the switch is pressed you will read with PinName_Read() API a zero (0) value.
I have mentioned the switch as u mentioned
I tried a project where if the button is pressed it should print "BUTTON PRESSED" in uart , red led should glow and 1 should be notified in the cysmart app
If not pressed red led should not glow and 0 should be notified in the cysmart app
Don't know where I have gone wrong
I'm attaching the project
Please go through it
Design01.cydsn.rar 3.1 MB
Can you please post your complete project 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.
Please refer the below modified project, in which when we enable the notify in CySmart App and if the button is pressed then 1 should be notified in the cysmart app, it will print "BUTTON PRESSED" in uart and red led will glow. If not pressed red led should not glow and 0 should be notified in the cysmart app.
If we stop the notify in CySmart App then no operation will happens.
Thank you sir
I have another doubt
The values sent 0 and 1 receive as strings or integers in the cysmart app or any another ble supported app?