7 Replies Latest reply on Aug 1, 2014 5:02 PM by jota_1939431

    [GPIO] How to set pin to High, digital & analog

      Hey guys, I'm delving into programming this chip, I am very new and I'm referencing the pwm_tones example, but im using the wiced device configurator. I 've connected my LED as per my illustration. here

       

      GPIO_HEADERS_JAREDDLC.jpg

      with the following code:

      // TurquoiseBicuspid Constants
      #define TURQUOISEBICUSPID_LED1_GPIO            (26)
      

       

      // TurquoiseBicuspid Function Prototypes
      static void turquoisebicuspid_blink_led1(void);
      

       

       

      here is my function:

       

      void turquoisebicuspid_interrupt_handler(UINT8 value)
      {
          // On press.
          if(value & 1)
          {
              ble_trace0("turquoisebicuspid_interrupt_handler()");
              turquoisebicuspid_blink_led1();
          }
      }
      
      void turquoisebicuspid_blink_led1(void)
      {
          ble_trace0("turquoisebicuspid_blink_led1()");
          gpio_configurePin((TURQUOISEBICUSPID_LED1_GPIO) / 16, (TURQUOISEBICUSPID_LED1_GPIO) % 16, GPIO_OUTPUT_ENABLE, 0);
          gpio_setPinOutput((TURQUOISEBICUSPID_LED1_GPIO) / 16, (TURQUOISEBICUSPID_LED1_GPIO) % 16, 1);
      }
      

       

       

       

       

      I see the trace:

      23:29:12 - turquoisebicuspid_interrupt_handler()
      23:29:12 - turquoisebicuspid_blink_led1()
      

       

       

       

      However I wasn't sure If I am using the setPinOutput correctly as my LED does not turn on. I would like to set this pin to HIGH, similar to arduino's

      
      
      digitalWrite(TURQUOISEBICUSPID_LED1_GPIO, HIGH)
      analogWrite(TURQUOISEBICUSPID_LED1_GPIO, 255);
      

       

       

       


      Thanks in advanced. I'm calling it a night for today. I'll check tomorrow.