osd-contiki/examples/osd/arduino-dooralert/sketch.pde
2014-11-19 13:58:56 +01:00

35 lines
800 B
Plaintext

/*
* Sample arduino sketch using contiki features.
* We turn the LED off
* We allow read the water sensor
* Unfortunately sleeping for long times in loop() isn't currently
* possible, something turns off the CPU (including PWM outputs) if a
* Proto-Thread is taking too long. We need to find out how to sleep in
* a Contiki-compatible way.
* Note that for a normal arduino sketch you won't have to include any
* of the contiki-specific files here, the sketch should just work.
*/
extern "C" {
#include <stdio.h>
#include "resource_door.h"
#define LED_PIN 4
uint8_t door_pin = A5;
uint16_t door_value = 0;
}
void setup (void)
{
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, HIGH);
rest_init_engine ();
rest_activate_resource (&resource_door);
}
void loop (void)
{
}