Download presentation
Presentation is loading. Please wait.
Published byKian Spencer Modified over 9 years ago
1
MUC Coursework ● Deadline: 16 April ● Add all files to a folder, and send a compressed version of the folder (.zip or.tar) to niki@dcs.bbk.ac.uk by 26 March niki@dcs.bbk.ac.uk ● The compressed version should be named as follows: Name_Surname.zip or Name_Surname.tar ● Add any comments about your coursework (brief description of files, problems encountered, etc.) into a file called intro.txt
2
Coursework (1/2) ● Problem 2n+1 nodes, one gateway (with an ID of 0), n nodes with odd IDs, n nodes with even IDs Nodes with odd IDs collect light readings, those with even IDs collect temperature readings At every period ● the gateway asks the readings of the 2n nodes ● the nodes collect the readings and send them back to the gateway ● the gateway computes the average light and temperature
3
Coursework (2/2) ● The gateway Computes the average light and temperature at the beginning of each period (of five seconds) Sends the average light and temperature in a single packet to the UART ● The other nodes Send their readings after a random interval, so that the messages from different nodes are not sent at the same time
4
Design ● The gateway has a PeriodTimer sends BroadcastMsg receives LightMsg and TempMsg sends UartMsg ● The other nodes have a Light or Temp sensor receive BroadcastMsg have a DelayTimer send LightMsg or TempMsg
5
Architecture CourseworkCCourseworkM StdControl TimerLeds SendMsg ADCReceiveMsgRandom LedsC TimerC Random LFSR DemoSensorCTempGenericComm Main Makefile
6
Hints (1/2) ● if (TOS_LOCAL_ADDRESS%2==0) { /* even node */ } else { /* odd node */ } ● You cannot pass parameters to tasks, you need to use global variables ● Write a specific task for each message to send ● You can send to the serial port using TOS_UART_ADDRESS (and you can see those messages using export DBG=uart )
7
Hints (2/2) ● The gateway needs four variables to compute the averages sumLight numberLight sumTemp numberTemp ● The nodes need only one variable lightValue or tempValue
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.