initial upload
This commit is contained in:
parent
dfaa8c0f32
commit
0c7328b59d
9 changed files with 329 additions and 0 deletions
34
examples/osd/arduino-roomalert/sketch.pde
Normal file
34
examples/osd/arduino-roomalert/sketch.pde
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* 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_pir.h"
|
||||
|
||||
#define LED_PIN 4
|
||||
|
||||
uint8_t pir_pin = A5;
|
||||
uint16_t pir_value = 0;
|
||||
}
|
||||
|
||||
void setup (void)
|
||||
{
|
||||
pinMode(LED_PIN, OUTPUT);
|
||||
digitalWrite(LED_PIN, HIGH);
|
||||
rest_init_engine ();
|
||||
rest_activate_resource (&resource_pir);
|
||||
}
|
||||
|
||||
void loop (void)
|
||||
{
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue