Your SlideShare is downloading. ×
0
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
TinyOS Course 01: Basic Programming
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

TinyOS Course 01: Basic Programming

878

Published on

Lesson 01 slides for one day introductory course on wireless sensor networks and TinyOS, that took place at the University of Alcalá de Henares in Madrid Spain the 18th of September 2013. This course …

Lesson 01 slides for one day introductory course on wireless sensor networks and TinyOS, that took place at the University of Alcalá de Henares in Madrid Spain the 18th of September 2013. This course was jointly designed by the Electronics Department of the university and Advanticsys. Find source code for the lessons here: http://www.advanticsys.com/wiki/index.php?title=TinyOS%C2%AE_Course_at_UAH_18th_September_2013

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
878
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
77
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  1. WSN Programming Course TinyOS Lab: Basic Programming Manuel Fernández UAH, 18th September 2013
  2. • Introduction to nesC • Components • FileTypes • Basic program: NullC • How to compile • NesC variables • Eclipse IDE • Exercises 2 Contents
  3. • A nesC application consists of one or more components assembled, or wired, to form an application executable. • Components define two scopes: • one for their specification which contains the names of their interfaces, and • a second scope for their implementation. COMPONENT A SPECIFICATION IMPLEMENTATION 3 NesC (I)
  4. •A component provides and uses interfaces. •The provided interfaces are intended to represent the functionality that the component provides to its user in its specification. •The used interfaces represent the functionality the component needs to perform its job in its implementation. 4 NesC (II)
  5. • Interfaces are bidirectional: they specify a set of commands, which are functions to be implemented by the interface's provider, and a set of events, which are functions to be implemented by the interface's user. For a component to call the commands in an interface, it must implement the events of that interface. •The set of interfaces which a component provides together with the set of interfaces that a component uses is considered that component's signature. 5 NesC (III)
  6. •There are 2 types of components in nesC: - Modules: provide the implementations of one or more interfaces. - Configurations: used to assemble other components together, connecting interfaces used by components to interfaces provided by others. 6 Components
  7. • Naming conventions are as follows: CONFIGURATIO N MODULE COMPONENTS INTERFACE Makefile Only in main app 7 File Types CONFIGURATION MODULE
  8. TinyOS Lab: Lesson 01 – Basic Programming © 2012 Manuel Fernández Makefile NullAppC.nc NullC.nc Configuration Module Makefile: COMPONENT=NullAppC include $(MAKERULES) Name of configuration file 8 Basic program: NullC
  9. NullApp.nc : SPECIFICATION IMPLEMENTATION 9 Basic program: NullC SPECIFICATION IMPLEMENTATION NullC.nc :
  10. • Open terminal in the folder •Type: make telosb • Insert mote in USB port and type: make telosb reinstall.1 bsl,/dev/ttyUSB0 Platform MoteID USB port (type motelist to find which one it is 10 How to compile
  11. • Open terminal in the folder • Type: make telosb docs • Check the created folders Platform 11 Fun Stuff
  12. • Commonly used units: • int is NOT used • bool is also used 12 NesC variables
  13. • An alternative to console programming is using a TinyOS plug-in for the Eclipse IDE. • In this IDE it is possible to compile and install programs in motes •We will use this IDE to speed up the lessons. 13 Eclipse IDE
  14. 1. Interface Leds has commands to control the 3 leds on the mote. (led0, led1, led2).Try each of them and install them on the mote 2. Add a Timer to blink the Leds periodically, showing a binary timer using the 3 leds. 3. Configure the User Button to do a complete routine with the Leds 4. Pack the previous subroutine in a new component with your own interface. 14 Exercises
  15. Contact Info: Manuel Fernández manuel.fernandez@advanticsys.com 15

×