国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

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

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++編程
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 豆包網頁版入口 破天一劍 目錄網 排行網

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

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

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    日本www在线播放| 热99这里只有精品| 精品乱子伦一区二区三区 | 久久久久久免费精品| 久久久久久久免费| 正在播放国产精品| 黄色一级片网址| 国产精成人品localhost| 国产精品福利久久久| 日韩在线第一区| 国产在线精品二区| 久久久久久中文| 亚洲色图自拍| 国产在线999| 国产精品日韩av| 欧美在线免费观看| 久久乐国产精品| 九九综合九九综合| 欧日韩免费视频| 久久久久国产精品视频| 欧美精品久久一区二区| 女女同性女同一区二区三区91| 国产成a人亚洲精v品在线观看| 色综合色综合网色综合 | 国产日产欧美精品| 久久九九免费视频| 人人妻人人澡人人爽精品欧美一区| 成人精品久久av网站| 精品久久久久久久免费人妻| 激情五月综合色婷婷一区二区| 国产成人精品a视频一区www| 亚洲综合色激情五月| 蜜桃成人在线| 久久riav二区三区| 日韩在线三区| 久久精品一二三区| 日韩av大片在线| 国产二级片在线观看| 欧美一区二区三区综合| 国产精品一久久香蕉国产线看观看 | 青青草视频国产| 成人免费aaa| 伊人久久婷婷色综合98网| 国产欧美精品一区二区三区 | 成人一级生活片| 国产精品高潮呻吟视频| 激情五月五月婷婷| 久久这里只有精品视频首页| 国产在线精品自拍| 久久91亚洲精品中文字幕奶水| 国产无限制自拍| 精品国产一区二区三区日日嗨| 国产一区二区三区高清| 国产精品高潮呻吟久久av野狼| 国产最新精品视频| 欧美激情视频网| 97国产suv精品一区二区62| 欧美成在线观看| 国产精品一区二区三区免费| 亚洲在线色站| 久久五月天婷婷| 欧美人与动牲交xxxxbbbb| 国产精品美女黄网| 精品视频一区二区| 一区二区三区视频在线播放| 97成人在线视频| 日本精品福利视频| 久久视频中文字幕| 欧洲熟妇精品视频| 国产精品国产三级欧美二区| 国产精品中文久久久久久久| 欧美一区二区三区在线播放| www.精品av.com| 国产视频一区二区三区在线播放| 亚洲五月六月| 久久久久免费精品国产| 国精产品一区一区三区有限在线| 中文网丁香综合网| 久久久亚洲精品视频| 日本欧美色综合网站免费| 精品国产拍在线观看| 国产视频一区二区三区在线播放| 亚洲国产精品久久久久爰色欲| 国产精品av网站| 黄色国产小视频| 亚洲天堂电影网| 久草热视频在线观看| 国内精品久久久久久影视8| 亚洲欧洲一二三| 久久久久久久久四区三区| 国产一区 在线播放| 日韩中文字幕一区| 国产精品久久久久久久久久东京 | 日韩免费在线免费观看| 欧美日韩高清在线观看| 国产精品欧美激情在线观看| 91精品久久久久久蜜桃| 国产视频999| 欧美成人精品免费| 秋霞无码一区二区| 懂色av粉嫩av蜜臀av| 久久久久久国产精品美女| 国产精品日韩欧美综合| 色av吧综合网| 久久久亚洲欧洲日产国码aⅴ| 国产乱码精品一区二区三区日韩精品| 欧美不卡在线播放| 欧美亚州一区二区三区| 欧美一级欧美一级| 亚洲激情电影在线| 尤物国产精品| 欧美激情精品久久久久| 国产精品久久精品| 国产精品视频一区二区三区四区五区| 色偷偷噜噜噜亚洲男人| 久久久久久中文字幕| 国产www精品| 国产v综合ⅴ日韩v欧美大片| 久久久视频免费观看| 91精品视频一区| 97国产精品久久| …久久精品99久久香蕉国产| 国产精品亚洲激情| 国产精品一区二区三区在线| 国产精品午夜av在线| www.男人天堂网| 91免费福利视频| 久久久这里只有精品视频| 国产精品 欧美在线| 久久久亚洲精品视频| 久久亚洲一区二区| 国产成人精品999| 久久久久久噜噜噜久久久精品| 久久久久久一区| 国产精品网红直播| 国产精品电影网| 国产99在线播放| 亚洲欧美在线网| 亚洲不卡中文字幕无码| 无码人妻精品一区二区蜜桃百度 | 中文字幕日韩精品一区二区| 欧美激情亚洲综合一区| 中文字幕免费在线不卡| 亚洲视频在线二区| 亚洲高潮无码久久| 日产精品高清视频免费| 欧美在线www| 免费av在线一区二区| 国产欧美一区二区在线播放| 99精品国产高清一区二区| 久久久女女女女999久久| 久99久视频| 久久综合伊人77777尤物| 国产精品久久久对白| 在线一区日本视频| 亚洲欧美丝袜| 日韩欧美一区二区三区四区| 欧美在线视频二区| 国产一区二区高清视频| 91精品久久久久久久久久另类| 久久精品美女| 久久五月天综合| 一区二区传媒有限公司| 日韩av123| 黄色一级在线视频| www国产无套内射com| 久久久噜噜噜久久久| 国产精品啪视频| 亚洲影院污污.| 全黄性性激高免费视频| 精品无人乱码一区二区三区的优势 | 亚洲一区二区不卡视频| 日韩 欧美 自拍| 国产一区二区三区奇米久涩| 久久久最新网址| 国产精品无码av无码| 综合久久国产| 欧美精品一区二区三区在线四季| 国产精品亚洲网站| 久久久999成人| 亚洲精品在线免费| 狠狠干 狠狠操| 久久久亚洲影院| 精品国产三级a∨在线| 日本亚洲欧洲色α| 国产美女被下药99| 日韩一二三在线视频播| 亚洲综合国产精品| 黄色片一级视频| 久久精品日产第一区二区三区精品版| 国产精品欧美在线| 欧美一区二区三区免费视| 国产淫片av片久久久久久| 久久久久亚洲精品成人网小说| 欧美精品video| 黄色激情在线视频| 久久久久日韩精品久久久男男| 亚洲综合中文字幕在线| 国内揄拍国内精品| 久久国产精品一区二区三区 |