The Location Puck gives your smartphone context about its location. Built on the Puck IOT platform.

Dependencies:   Puck mbed

The location puck will give your smartphone context about the phone’s location. You can later set up rules for what should happen at different locations in the smartphone companion application (Puck Central).

A tutorial for the Location Puck is available on GitHub.

Tutorials and in-depth documentation for the Puck platform is available at the project's GitHub page

Committer:
cristea
Date:
Thu Jun 19 10:47:28 2014 +0200
Revision:
2:67d603617000
Parent:
1:345039810771
Child:
3:4cb285fb29e7
Update blinker to be more aestethically pleasing

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cristea 0:f4fbeaabdff5 1 #include <mbed.h>
cristea 0:f4fbeaabdff5 2
cristea 0:f4fbeaabdff5 3 DigitalOut led1(LED1);
cristea 0:f4fbeaabdff5 4 DigitalOut led2(LED2);
cristea 0:f4fbeaabdff5 5
cristea 0:f4fbeaabdff5 6 void clear() {
cristea 0:f4fbeaabdff5 7 led1 = 0;
cristea 0:f4fbeaabdff5 8 led2 = 0;
cristea 0:f4fbeaabdff5 9 }
cristea 0:f4fbeaabdff5 10
cristea 0:f4fbeaabdff5 11 void cycle(float delta) {
cristea 0:f4fbeaabdff5 12 clear();
cristea 0:f4fbeaabdff5 13 led1 = 1;
cristea 0:f4fbeaabdff5 14 wait(delta);
cristea 2:67d603617000 15
cristea 2:67d603617000 16 clear();
cristea 2:67d603617000 17 led1 = 1;
cristea 2:67d603617000 18 wait(delta);
cristea 0:f4fbeaabdff5 19
cristea 0:f4fbeaabdff5 20 clear();
cristea 0:f4fbeaabdff5 21 led2 = 1;
cristea 0:f4fbeaabdff5 22 wait(delta);
cristea 2:67d603617000 23
cristea 2:67d603617000 24 clear();
cristea 2:67d603617000 25 led2 = 1;
cristea 2:67d603617000 26 wait(delta);
cristea 0:f4fbeaabdff5 27 }
cristea 0:f4fbeaabdff5 28
cristea 0:f4fbeaabdff5 29 void drums(float delta) {
cristea 0:f4fbeaabdff5 30 clear();
cristea 0:f4fbeaabdff5 31 led1 = 1;
cristea 0:f4fbeaabdff5 32 wait(delta);
cristea 2:67d603617000 33
cristea 2:67d603617000 34 clear();
cristea 2:67d603617000 35 led2 = 1;
cristea 2:67d603617000 36 wait(delta);
cristea 2:67d603617000 37
cristea 2:67d603617000 38 clear();
cristea 2:67d603617000 39 led2 = 1;
cristea 2:67d603617000 40 wait(delta);
cristea 0:f4fbeaabdff5 41 }
cristea 0:f4fbeaabdff5 42
cristea 0:f4fbeaabdff5 43 int main() {
cristea 0:f4fbeaabdff5 44 while(1) {
cristea 0:f4fbeaabdff5 45 drums(0.3);
cristea 2:67d603617000 46 cycle(0.3);
cristea 0:f4fbeaabdff5 47 }
cristea 1:345039810771 48 }