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

can i control pin 24(or any other) on nrf51 dk(nrf51422) using iot sdk?

I have set up raspberry pi 3 as a border router and programmed the the nrf51422 using the iot_ipv6_coap_server_pca10028 and could successfully switch on and off led3 and led4 using copper coap,can i control pin24 on nrf51dk if yes what are the changes i need to do in the main.c ?

Parents
  • Hi,

    Yes, you can control any other pins using the same example. LEDs are also just controlled by setting the output of the pin it is connected to.

    You have to add the new pin as a CoAP endpoint, using the coap_endpoints_init() function. Your new endpoint need a callback handler, like led3_callback() and led4_callback(), where you need to handle the CoAP messages in a similar way as done in handle_led_request(). The GPIO is controlled using the GPIO abstraction functions.

    Best regards,

    Jørgen

  • If you want to read analog values, you need to use the ADC. It does not look like the ADC driver is included in the IoT SDK v0.8.0, but it should be possible to port it from the nRF51 SDK (IoT SDK v0.8.0 is based on nRF51 SDK v8.1.0).

Reply
  • If you want to read analog values, you need to use the ADC. It does not look like the ADC driver is included in the IoT SDK v0.8.0, but it should be possible to port it from the nRF51 SDK (IoT SDK v0.8.0 is based on nRF51 SDK v8.1.0).

Children
No Data