sivateja10

Led.c

Nov 19th, 2020
351
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "contiki.h"
  2. #include<stdio.h>
  3. #include "dev/leds.h"
  4.  
  5. #include "dev/button-sensor.h"
  6.  
  7. PROCESS(led_process, "LED process");
  8.  
  9. AUTOSTART PROCESS(&led_process);
  10.  
  11. PROCESS_THREAD(led_process,ev,data)
  12. {
  13. PROCESS_BEDIN();
  14. SENSOR_ACTIVATE(button-sensor);
  15.  
  16. while(1)
  17. {
  18.   printf("Press button Sensor\n");
  19.   PROCESS_WAIT_EVENT_UNTIL(ev=sensors_event && data = button_sensor);
  20.   leds_toggle(LEDS_GREEN);
  21. printf("Sensor value is %u",leds_get());
  22.  
  23. PROCESS_END();
  24. }
  25.  
  26.  
  27.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×