Lab 3 - Lab 3: Use of Multiple Functions Xiaojuan Xie 1....

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Lab 3: Use of Multiple Functions Xiaojuan Xie 1. The system structure is as following: 2. Sequence ReadTemp, LEDPattern, DisplayWaves by long press. Pseudo code of Screens is as follows: IF ISC is set Screen++; ENDIF SWITCH(Screen) 1: call ReadTemp ; Read Temperature every 2 second 2: call LEDPattern; Display LED as a number in decreasing manner 3: call DisplayWaves; Display square wave with given duty cycle END 3. Function ReadTemp implemented as follows: a) Read temperature every 2 second. b) Increase sequence number after each sampling. c) Display temperature in decimal format. d) Display sequence number in decimal format. Function LoopTime generates a delay of 10ms. Initialize SAMPLECOUNT = 200. Only when SAMPLECOUNT decreases to zero, ReadTemp reads temperature sensor, thus we get a sample interval of 2 second. SEQUENCENUM is initialized to 0. Pseudo code of ReadTemp is as follows: SAMPLECOUNT--; IF SAMPLECOUNT == 0 Read Temperature sensor and store it to Value; Screens Mainline Pbutton LoopTime ReadTemp LEDPattern DisplayWaves TempDisplay SeqDisplay DisplayLEDNum DisplaySquareWave ReadPot
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Calculate Temperature = (Value * 1000) / 2048; SEQUENCENUM++
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Lab 3 - Lab 3: Use of Multiple Functions Xiaojuan Xie 1....

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online