This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how do i read integer data on the nrfcloud?Can u give some example code to get me started?

I want to read integer data on the cloud for example int a=1001; This value must be displayed on the cloud service after every 5 seconds.Also i want to increament the value when i press the button connected to pin P1.10 that is when it reads a pulse from port P1.01. Please help.

Parents
  • Hi,

    You can create a custom service that will send a notification on every variable change, or every 5 seconds if you want (controlled by a timer). We have some tutorials on creating custom services/characteristics here on DevZone, but they are a bit outdated. This GitHub page contains an updated tutorial that support SDK 14 and nRF52840.

    For incrementing the variable using buttons, you can use the app_button library. This page describe how this can be done. Note that there is a bug in the SDK that that makes GPIOs on Port 1 on nRF52840 not work with the Button handler library.

    Best regards,

    Jørgen

Reply
  • Hi,

    You can create a custom service that will send a notification on every variable change, or every 5 seconds if you want (controlled by a timer). We have some tutorials on creating custom services/characteristics here on DevZone, but they are a bit outdated. This GitHub page contains an updated tutorial that support SDK 14 and nRF52840.

    For incrementing the variable using buttons, you can use the app_button library. This page describe how this can be done. Note that there is a bug in the SDK that that makes GPIOs on Port 1 on nRF52840 not work with the Button handler library.

    Best regards,

    Jørgen

Children
Related