99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

EEEN20011代做、代寫C++編程語言

時間:2023-12-01  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



EEEN20011 Microcontroller Engineering II
Dr L A Marsh and Dr P N Green
Lab Task 4 (40 Marks)
In this lab task you are expected to use the joystick, LCD screen, speaker, both potentiometers and
the RGB LED on the Application shield. These are shown in the diagram below:
This task is designed to integrate many of the peripherals and programming techniques that you
have learned about so far on the course. It also requires you to implement a state machine in C++,
for which there are two example programs available that you may wish to study.
In this task you are required to make use of the LED, and Potentiometer Classes provided in
“Example Program 5: Creating a finite state machine and using TimeOut APIs”. You should not
modify the Potentiometer class. EITHER: The LED class should be used unchanged, OR you may use
your RGBLED class from task 3.
You should create a class called SamplingPotentiometer which inherits from the class Potentiometer.
This class should make use of a Ticker object to regularly execute the member function sample() in
the class Potentiometer. The constructor for this class should accept the pin name, the VDD for the
analogue input and the sampling frequency as parameters, as shown in Listing 1. The constructor
should configure and attach the Ticker callback to trigger the sampling process at the specified
frequency.
class SamplingPotentiometer : public Potentiometer {
private:
 float samplingFrequency, samplingPeriod;
 Ticker sampler;
public:
 SamplingPotentiometer(PinName p, float v, float fs);
};
Listing 1: SamplingPotentiometer Class declaration for Task 4
You are required to implement a simple state machine using an enum as a means of defining a
program state. There are examples of this type of operation in “Example Program 4: Example of a
Finite State Machine to control program states”, and “Example Program 5: Creating a finite state
machine and using TimeOut APIs”. For this task you should implement the state machine within the
main() function, as shown in Example Program 4. The format should be similar to that shown below
in Listing 2.
typedef enum {state1, state2, state3, … staten} ProgramState;
//Definition of the enum that refers to the states of the program
ProgramState state;
int main()
{
 while(1) {
 switch (state) {
 case (state1) :
//Code for this state
 break;
 case(state2) :
//Code for this state
 break;
 default :
 //Default if not matching other state
 }
 }
}
Listing 2: Architecture of a simple state machine using an enum
In this type of operation your program can do different tasks according to the current state of the
program. You can, and should, use more memorable names for each of your states. Some
suggestions that you might wish to use for your program are:
initialisation, set_time, current_time, world_time, stopwatch, countdown_timer,
You are likely to need more states than this, but the above list should give you some idea as to how
you can implement a state machine to fulfil the requirements of the task. Bear in mind that you will
want to loop in some states, but may want others to only do something once, change state and
move on in the next iteration of the loop.
You should implement a Clock class that represents the functionality that your clock requires. A
suggested format is shown below, though you may wish to expand on this to include the world clock
functionality should you find this easier.
class Clock
{
private:
int time_hour, time_min, time_secs
public:
Clock(){}
void reset()
void tick()
void setClock()
int getHours()
int getMins()
int getSecs()
};
Listing 3: Example Clock class structure.
Your Speaker class from Task 1 should be updated to include member functions for toggling the
output, and returning the status of the output, if this has not already been implemented. The
Speaker class should have the same format of that shown in Listing 4 below.
class Speaker {
private:
DigitalOut outputSignal;
bool state; // Can be set to either 1 or 0 to record output value
public:
Speaker(PinName pin);
void on(void);
void off(void);
void toggle(void);
bool getStatus(void);
};
Listing 4: Speaker class format including toggle()
The toggle member function should be called from a Ticker API, where the time period should be
provided as part of the attach function. You should consult lecture notes and Mbed examples for
attaching member functions as a callback (ISR). You are free to choose an appropriate audible
output frequency.
You will need to implement some of the functionality from previous tasks, such as interrupts to
enable you use any required buttons on the joystick. Your ISRs should all be simple functions that
refrain from calls to computationally intensive operations, or blocking functions such as wait(). Your
ISRs should be used to switch the program on to the next state, or to update simple variables.
Some variables or objects may need to be declared outside the main function as global variables.
This should be avoided unless strictly necessary, and the use of all global variables should be
carefully justified.
You should use the LCD screen to display different data depending on which state the program is in.
You should avoid calling lcd.cls() in a loop – which can cause flickering, I’d recommend implementing
a filled rectangle of no colour to overwrite any data on the screen, or overwriting existing text as this
will be flicker-free. There will no doubt be other ways to implement this functionality, and as long as
your screen is updating smoothly then this won’t be a problem.
You should also use the RGB LED as a means of indicating the state some aspects of the program. It
should show the following:
Off: No timers running
Flashing Green: Countdown timer running
Blue: Stopwatch running
Please note that as per the video, both LEDs can be on simultaneously, with corresponding colours
visible.
You should be able to use the potentiometers to set the time during the relevant states; minimum
and maximum values should be contained to be within permitted ranges dictated in the video. The
potentiometers should also be used to navigate time zones with the minimum and maximum values
representing the cities furthest to the west and east respectively. A list of time zones will be
provided on Blackboard for you to choose from, and more details are available in ‘Marking
Requirements’ overleaf.
Where you are required to use the buttons on the joystick you should use the InterruptIn API and
attach appropriate callbacks. You are likely to need to attach different callbacks depending on the
required functionality of the button, which will change depending on the program state;
alternatively, you may have a single callback which checks the existing state of the program in order
to determine what the next state should be. Each approach is equally valid.
Your final program should display the same functionality as that shown in the example video on
Blackboard. Marks will be awarded for smooth operation of the program. So please ensure that
updates to the LCD screen are free from flickering, LEDs illuminate correctly, and button actions
perform the correct actions in each state.
Marking Requirements
The program required for this task demonstrates a significant amount of functionality, including user
input and a variety of outputs including LEDs and the LCD screen. As such the marking requirements
dictate that in order for full marks the final program should show all of the functionality described in
the video, as well as the essential criteria documented below:
The program should contain:
• The Class SamplingPotentiometer which should inherit from the Potentiometer class. This
class should automatically sample the analog inputs at periodic intervals and store sampled
values as data members of the class. The latest samples should be accessed by member
functions, as described above. You should take care to select an appropriate sampling
frequency.
• An object of type Ticker in the SamplingPotentiometer class.
• A class Clock which represents the functionality of a 24-hour clock in the format HH:MM:SS.
• A world clock which implements at least 20 time zones from -11 to +12 hours relative to
GMT. The ‘home’ city must be in the GMT time zone and can be a city of your choosing –
either ‘Manchester’ or ‘London’ are suggested but you are free to select another city in this
time zone. At least one city must have a non-integer offset e.g. +5h30 mins. You may choose
your cities from the list available on Blackboard.
• Objects of type InterruptIn for buttons of the joystick
• An object of type C128**. This will need to be imported – please see the guide on
Blackboard for using the LCD screen.
• Objects of type LED to allow for the illumination of LEDs that matches those described in this
document. You may also use your RGBLED class from task 3 if you wish.
• A number of ISRs/Callbacks which are called when your interrupt events occur (e.g. button
presses or timer events). These ISRs should be as efficient as possible and should be used to
change program state, or update global variables.
• You will need to declare some of the above objects outside of the main() function so that
they are in scope for your ISRs. You will need to carefully think about which of these will be
needed, and to appropriately justify all global variables that are used in your program.
• Implementation of a state machine that is able to represent the various states that your
program is in e.g. Initialisation, ClockSet, WorldTime etc.
Your main function, int main(), should contain code capable of:
• Declaring all necessary objects and variables which are only needed in the main function
• Implementing a state machine which can be used to control the flow of the program
• Setting the program in a suitable initial state
• Recovering from undefined states that might occur through the implementation of a
‘default’ case e.g. returning to the default state
Important notes (continued on the next page):
You will be expected to fully explain how your program works in order for marks to be awarded.
There will be marks available for your ability to answer questions relating to your program’s
implementation.
Your program must compile to be assessed. If you cannot implement the entire functionality without
compilation errors then consider if you can implement some of it in a stable version of the program
so that you can gain some marks.
Important Notes (continued):
The implementation of this program is expected to differ significantly between students. As such all
students must upload their source code via Turnitin for plagiarism checking. Lab marks will be
provisional pending this plagiarism check, and any suspected cases of academic malpractice will be
referred to the Department for investigation. There is a guide available on Blackboard which details
this process; please ensure that you are familiar with it before the lab session, and check with staff in
the assessment labs if there are any problems.
This is an in-lab assessment, and no late submission will be permitted. If you do not submit your
work for assessment in your scheduled lab, AND correctly upload your code for plagiarism
checking before the end of the session you will receive a mark of zero for this task.
A suggested workflow is provided below which you may wish to follow to ensure that this program is
implemented in logical stages. Though you may wish to undertake this task in a different way that
makes best sense to you:
1. Implement the class for a SamplingPotentiometer and verify that this works in its own
program.
2. Implement a basic clock that starts from 00:00:00 and counts sequentially.
3. Add code for setting this to arbitrary values and test the clock counts correctly from there.
4. Implement either the countdown timer or stopwatch timer in a program on its own.
5. Experiment with a simple state machine e.g. that uses a button to transit between
different states with a clear output. For example, illuminating a different LED for each
state or displaying a different message on the screen.
6. At this point you should write a brief plan of what your program needs to do. Usually for
state machines a flowchart is appropriate, but any alternative method would be suitable.
This plan will make it much easier to implement the program in stages and test more
gradually.
7. Bring together the clock, and timing functionalities into distinct states.
8. Add the more advanced features.
9. This is a complicated program, and you are strongly recommended to build it up in stages
and debug each stage separately. You are likely to find this task very hard to accomplish if
you develop large parts of it at once and don’t test in between, as it will be hard to track
down where errors are occurring.
This task is the most difficult of the four tasks. The main advice is to take things in stages,
and to remember that you can get marks for achieving some of the criteria, without having
to achieve them all. If you can’t do the full program perfectly, then do as much of it as you
can, as well as you can.
Application Shield Schematic
請加QQ:99515681 或郵箱:99515681@qq.com   WX:codehelp

掃一掃在手機打開當前頁
  • 上一篇:代做指標 通達信回踩確認主圖指標代寫
  • 下一篇:COMP4142代做、代寫Python,c/c++編程
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                九一久久久久久| 欧美老人xxxx18| 欧美午夜精品电影| 亚洲无线码一区二区三区| 99久久国产综合精品色伊 | 亚洲欧洲av在线| 国产成人亚洲综合色影视| 亚洲欧美综合网| 国产精品全国免费观看高清 | 99久久精品国产一区二区三区| 激情六月婷婷久久| 精品无人码麻豆乱码1区2区| 天堂久久久久va久久久久| 亚洲永久精品大片| 石原莉奈在线亚洲二区| 免费黄网站欧美| 国内精品第一页| 国产jizzjizz一区二区| 成人午夜av在线| 91片在线免费观看| 欧美三级一区二区| 日韩欧美中文字幕公布| 国产亲近乱来精品视频| 成人欧美一区二区三区白人 | 国产亚洲综合性久久久影院| 欧美激情在线一区二区| 亚洲桃色在线一区| 免费高清视频精品| 粉嫩aⅴ一区二区三区四区 | 国模冰冰炮一区二区| 粉嫩高潮美女一区二区三区| 色综合一区二区| 欧美三级电影在线观看| 久久久久久亚洲综合影院红桃| 国产综合久久久久久久久久久久 | 亚洲一区在线观看视频| 性久久久久久久| 久久99国产精品麻豆| av激情综合网| 日韩欧美在线网站| 亚洲人成7777| 黄色小说综合网站| 欧美日韩在线免费视频| 久久久不卡网国产精品一区| 亚洲欧美日韩国产成人精品影院| 日韩avvvv在线播放| 成人国产视频在线观看| 欧美顶级少妇做爰| 国产精品久久久久久亚洲毛片| 婷婷成人综合网| 成人黄色av电影| 日韩欧美亚洲国产另类| 国产精品免费av| 久久爱另类一区二区小说| 一本色道久久综合狠狠躁的推荐| 日韩一区国产二区欧美三区| 国产精品久久久久久久久免费相片| 日韩不卡手机在线v区| 色爱区综合激月婷婷| 国产欧美一区二区三区网站| 婷婷综合在线观看| 欧美丝袜丝交足nylons| 国产精品不卡一区二区三区| 久国产精品韩国三级视频| 91成人免费电影| 国产日本欧洲亚洲| 精久久久久久久久久久| 91精品国产综合久久精品app| 亚洲色大成网站www久久九九| 激情伊人五月天久久综合| 欧美日韩精品一区二区天天拍小说 | 国产日韩精品久久久| 蜜臀久久99精品久久久画质超高清| 日本高清免费不卡视频| 亚洲欧美色综合| 色哟哟国产精品| 一个色综合av| 欧美在线高清视频| 亚洲激情网站免费观看| 91美女片黄在线观看91美女| 中文字幕中文字幕一区| 不卡电影免费在线播放一区| 国产精品三级视频| 国产精品白丝av| 中文字幕第一区| 99精品国产热久久91蜜凸| 亚洲欧美在线视频| 日本韩国一区二区三区| 一区二区三区精品视频| 欧美午夜寂寞影院| 天天操天天色综合| 日韩三区在线观看| 国产一区二区网址| 中文字幕人成不卡一区| 在线视频你懂得一区| 丝袜脚交一区二区| 久久综合九色综合97婷婷| 成人不卡免费av| 亚洲福中文字幕伊人影院| 日韩午夜在线观看| 国产成人一区二区精品非洲| 亚洲欧美综合另类在线卡通| 欧美日韩视频一区二区| 欧美a级一区二区| 久久精品夜夜夜夜久久| 色婷婷av一区二区三区软件 | 天堂在线亚洲视频| 久久久午夜精品| 91视频在线观看| 三级亚洲高清视频| 欧美国产亚洲另类动漫| 91成人在线观看喷潮| 欧美96一区二区免费视频| 久久精品亚洲精品国产欧美| 一本久久综合亚洲鲁鲁五月天 | 美国毛片一区二区| 国产精品二区一区二区aⅴ污介绍| 91久久奴性调教| 国产一区二区精品久久99| 亚洲视频每日更新| 欧美成人高清电影在线| 91无套直看片红桃| 激情久久五月天| 亚洲午夜免费视频| 国产精品免费免费| 精品剧情v国产在线观看在线| 91网页版在线| 国产精品99久久久久久久vr| 婷婷激情综合网| 亚洲特黄一级片| 久久网站热最新地址| 欧美日韩高清一区二区三区| 成人app网站| 黄一区二区三区| 五月激情六月综合| 夜夜嗨av一区二区三区| 国产精品剧情在线亚洲| www日韩大片| 5月丁香婷婷综合| 欧美性生活一区| 97久久精品人人做人人爽| 国产成人免费视频| 国产在线精品国自产拍免费| 日日夜夜免费精品| 亚洲狠狠爱一区二区三区| 亚洲欧洲在线观看av| 国产婷婷色一区二区三区四区| 91精品国产欧美一区二区18 | 欧美精品九九99久久| 99精品在线免费| 亚洲午夜电影网| 欧美va亚洲va国产综合| a亚洲天堂av| 成人深夜视频在线观看| 国产成人免费高清| 精品在线播放午夜| 国产一区二区精品久久99| 精品一区二区三区视频 | 成人视屏免费看| 国产精品一区2区| 国产成人精品一区二| 国产麻豆9l精品三级站| 久久国产精品无码网站| 久久国产尿小便嘘嘘| 国产在线不卡一区| 国模冰冰炮一区二区| 国产精品一区三区| 成人av电影在线观看| 97久久人人超碰| 欧美日韩一区二区三区视频 | 亚洲美女免费在线| 亚洲美女在线国产| 亚洲国产精品久久不卡毛片| 亚洲成a人片在线观看中文| 三级亚洲高清视频| 免费观看久久久4p| 国产成人精品一区二| www.99精品| 欧美日韩高清一区二区三区| 精品日本一线二线三线不卡| 国产亚洲成aⅴ人片在线观看 | 亚洲色图另类专区| 偷窥少妇高潮呻吟av久久免费| 美女免费视频一区二区| 国产精华液一区二区三区| 91在线观看下载| 欧美嫩在线观看| 久久久久高清精品| 亚洲四区在线观看| 另类调教123区| 99九九99九九九视频精品| 欧美一区二区三区影视| 国产精品久久久久aaaa| 亚洲成av人片在线观看| 国产一区二区三区免费播放| 色94色欧美sute亚洲线路一久| 欧美mv日韩mv亚洲| 亚洲免费三区一区二区| 久久成人综合网| 欧美日韩在线观看一区二区 |