Presentation is loading. Please wait.

Presentation is loading. Please wait.

HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 HelloWorld By using LED & Timer components, we will display “helloworld” in a manner of Morse code.

Similar presentations


Presentation on theme: "HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 HelloWorld By using LED & Timer components, we will display “helloworld” in a manner of Morse code."— Presentation transcript:

1 HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 HelloWorld By using LED & Timer components, we will display “helloworld” in a manner of Morse code.

2 HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 2016-02-25 2 Morse Code & LED

3 HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 Morse code –Using Dot and dash, 3 dots distance for distinguish character and symbol –Following table shows morse code for alphabet 2016-02-25 3 Morse Code A. ‐ B ‐... C ‐. ‐. D ‐.. E. F.. ‐. G ‐‐. H.... I.. J. ‐‐‐ K ‐. ‐ L. ‐.. M ‐‐ N ‐. O ‐‐‐ P. ‐‐. Q ‐‐. ‐ R. ‐. S... T ‐ U.. ‐ V... ‐ W. ‐‐ X ‐.. ‐ Y ‐. ‐‐ Z ‐‐.. 0 ‐‐‐‐‐ 1. ‐‐‐‐ 2.. ‐‐‐ 3... ‐‐ 4.... ‐ 5..... 6 ‐.... 7 ‐‐... 8 ‐‐‐.. 9 ‐‐‐‐. Fullstop. ‐. ‐. ‐ Comma ‐‐.. ‐‐ Query.. ‐‐..

4 HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 2016-02-25 4 HelloWorld Example

5 HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 2016-02-25 5 HelloWorld Example HelloWorld source location –c:\Programfiles\UCB\cygwin\opt\tinyos ‐ 1.x\contrib\zigbex\ helloworld –HelloWorld.nc & HelloWorldM.nc

6 HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 2016-02-25 6 HelloWorld.nc –Configuration file configuration HelloWorld { } implementation { components Main, HelloWorldM, TimerC, LedsC; Main.StdControl ‐ > HelloWorldM; Main.StdControl ‐ > TimerC; HelloWorldM.Timer ‐ > TimerC.Timer[unique("Timer") ]; HelloWorldM.Leds ‐ > LedsC; }

7 HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 2016-02-25 7 HelloWorldM.nc HelloWorldM.nc (1) module HelloWorldM { provides { interface StdControl; } uses { interface Timer; interface Leds; } } implementation { command result_t StdControl.init() { call Leds.init(); call Leds.redOff(); call Leds.yellowOff(); call Leds.greenOff(); return SUCCESS; } command result_t StdControl.start() { return call Timer.start( … ); }

8 HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 2016-02-25 8 HelloWorldM.nc HelloWorldM.nc (2) command result_t StdControl.stop() { return call Timer.stop(); } event result_t Timer.fired() { static char *morse = "...... ‐... ‐.. ‐‐‐ ‐‐.. ‐‐ " ". ‐‐ ‐‐‐. ‐.. ‐.. ‐.. "; static char *current; if( !current ) current = morse; switch( *current ) { case ' ': /* pause: off for two units */ call Timer.start (TIMER_ONE_SHOT, 2 * MORSE_UNIT); current++; break; case '.': /* dot: on for one unit, off for one unit */ … if( !*current ) current = morse; return SUCCESS; }

9 HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 2016-02-25 9 HelloWorld Lab

10 HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 2016-02-25 10 HelloWorld lab. 1 Cygwin starts and move directory as follows: make zigbex cd /opt/tinyos ‐ 1.x/contrib/zigbex cd helloworld

11 HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 2016-02-25 11 HelloWorld lab. 2 ZigbeX Download –Run AVR studio at Windows –Tolol->auto connect-> browse main.hex located at –c:\Programfiles\UCB\cygwin\opt\tinyos ‐ 1.x\contrib\zigbex\HelloWorld\ build\zigbex

12 HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 2016-02-25 12 HelloWorld result result –Check the LED


Download ppt "HANBACK ELECTRONICS CO., LTD. 저자권 보호됨 HelloWorld By using LED & Timer components, we will display “helloworld” in a manner of Morse code."

Similar presentations


Ads by Google