Presentation is loading. Please wait.

Presentation is loading. Please wait.

CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop.

Similar presentations


Presentation on theme: "CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop."— Presentation transcript:

1 CIS 798 Sensor Network Implementation

2 Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop expertise to engage in more realistic sensor applications

3 Platforms Crossbow Motes TinyOS

4 Student groups (2 students each) Lab groups Project groups

5 Topics TinyOS programming Component based programming model System setup

6

7

8

9 Tutorials Help sessions Hardware

10 commands events Components provides uses Interface: Bidirectional

11 Interfaces provides uses Component: Provide or use multiple interfaces of the same type or different types

12 Components Simple components Configuration

13 Blink This application simply causes the red LED on the mote to turn on and off at 1Hz

14 Blink Blink.nc configuration Blink { } implementation { components Main, BlinkM, SingleTimer, LedsC; Main.StdControl -> BlinkM.StdControl; Main.StdControl -> SingleTimer.StdControl; BlinkM.Timer -> SingleTimer.Timer; BlinkM.Leds -> LedsC; }

15 Interface stdcontrol StdControl.nc interface StdControl { command result_t init(); command result_t start(); command result_t stop(); }

16 Interface Stdcontrol Main.StdControl -> BlinkM.StdControl; When StdControl.init in Main is called, StdControl.init in BlinkM is automatically invoked

17 BlinkM.nc module BlinkM { provides { interface StdControl; } uses { interface Timer; interface Leds; } } interface Timer { command result_t start(char type, uint32_t interval); command result_t stop(); event result_t fired(); } start(): to specify the type of the timer and the interval at which the timer will expire; the fired() event is signaled when the specified interval has passed

18 BlinkM.nc interface Timer { command result_t start(char type, uint32_t interval); command result_t stop(); event result_t fired(); } interface Leds { async command result_t init(); async command result_t redOn(); async command result_t redOff(); async command result_t redToggle(); async command result_t greenOn(); async command result_t greenOff(); async command result_t greenToggle(); async command result_t yellowOn(); : }

19 BlinkM.nc module BlinkM { provides { interface StdControl; } uses { interface Timer; interface Leds; } } implementation { command result_t StdControl.init() { call Leds.init(); return SUCCESS; } command result_t StdControl.start() { return call Timer.start(TIMER_REPEAT, 1000) ; } command result_t StdControl.stop() { return call Timer.stop(); } event result_t Timer.fired() { call Leds.redToggle(); return SUCCESS; } }

20 Week 1 Read lesson 1 Install Tiny OS (or use machines in N22) Compile Blink Program mote to run Blink Modify Blink so that Led blinks for 10 secs and then stops for 5 secs (and this is repeated).


Download ppt "CIS 798 Sensor Network Implementation. Goals Learning sensor network programming with Crossbow motes Implement reasonable sized sensor applications Develop."

Similar presentations


Ads by Google