首页 > 其他分享 >CE243 using C language and ARM

CE243 using C language and ARM

时间:2024-10-30 20:00:21浏览次数:7  
标签:guess your number should game CE243 user using ARM

School of Computer Science and Electronic Engineering1

CE243 (NWU) Assignment 2

(2020-2021)

  1. ObjectivesThe objective of this assignment is to demonstrate your understanding of the embeddedsystem that can be effectively controlled using C language and ARM mbed you have learnt inthis module.
  1. The task

To design and write a C program to implement a guessing game on the ARM mbeddevelopment kit provided in the lab. Your design should include the following main features.- The main body of the guessing game logic should be implemented on the ARM mbeddevelopment kit.- Develop a PC host program in C that can communicate with the game on the ARMmbed via UART interface. The messages of the game should be displayed on the hostprogram.- Use the peripherals on the mbed extension board to give better user experience, e.g.LCD, keypad, etc.- Your game should be error free and have error checking function to avoid any crashcausedby invalid user input or similar bugs.Game: The finished game will provide a user experience that looks something like this:

What is your guess? 5

You are way off.

What is your guess? 8

You are way off.

What is your guess? 3

You are less than 3 away!

What is your guess? 4

You are less than 3 away!

What is your guess? 2

You guessed correctly!

The guessing number should be set by the user when the mbed is initialised. Please considersuitable user experience here to make that happen smoothly. The number should be setbetween 0-30.User input

The game will need to get guesses from the user on the PC host. Your programme

always ask the user “What is your guess?”, and you should use an infinite loop to

ask the user for a guess. After it is entered, print out each guess. A session mightlook like this:What is your guess? 22Note: there is a fixed number of guesses, determined by the user. In the real game,the loop will finish once the number has been guessed correctly.

Check proximity School of Computer Science and Electronic EngineeringThe game will give the user a hint when a guess is close to the correct answer. Inother words, with each guess the game has to determine the proximity of the guess tothe randomly generated correct number. Write a function within(value, goal, n) thateturn 1 if value is within n distance of goal. For example, within(2, 5, 2) wouldreturn 0 but within(4, 5, 2) would return 0.

Scoring One can think of a “score” in this game as the number of guesses made beforegetting the number right; a lower score is better. Once the user has guessed thenumber, print a line saying how many guesses were made (something like “Yourscore is 4”).LCD: The first row of the LCD should always show the secret number you set, and thesecond row of the LCD should show 代写CE243  using C language and ARM  the current user guess. Once the user has theguessed number, the second row of LCD should show a message indicating thecompletion of the game and the final score of the user.Keypad: The keypad should be used to set the secret number.

  1. Deadline and submission requirementsThe deadline for the electric submission of your Assignment 2 report and associated Cprograms is 11:59:59 on Friday 1 Nov. 2019. Please email your assignment as ONEattachment to [email protected] prior to the above submission deadline. Pleasemerge everything listed below into one .doc or .pdf file and submit. The filename shall take

the following format: Surname_Firstname_RegistrationNumber_A2, all in English. Your

email subject shall use exactly the same format. No email content is necessary. In themeanwhile please ALSO upload the same file to FASER.

 Your assignment shall be written in such a way that it is clear, concise and easy to read.

 Write your name (both English and Chinese), registration number and module code(CE243-NWU) clearly on the cover page, including a ToC (Table of Contents) (1 page).

 You shall use a flow chart to outline your software design and use text to explain how itworks (2 or 3 pages).

 You should run your code for testing different scenarios. The results of testing should bepresented in the report and explain how you fix it if any bugs have been found. (2 or 3pages).

 Your C program should be printed at the end of the report (3 or 4 pages).No extensions of the deadlines will be given. If, for any reason, you do not submit your code,there will be no record of the submission time and you will automaticallyget a zero mark.You shall submit your work through the proper channel (electronic submission) and on time,even if it is incomplete - something is better than nothing.This assignment is to be completed individually, i.e. whatever you hand in must be your ownindividual work.Any software or any other materials that you use in this assignment, whetherpreviously published or not, must be referred and properly acknowledged.

  1. AssessmentYou will be assessed on the source code you submit and the performance of your code.

(i) Marks will be awarded for programming style and the number of features implemented.2School of Computer Science and Electronic Engineering

(ii) You are expected to show the performance of the programs during demonstration in the10th lab (Week 11). The demonstration session is mandatory to this assignment, and it isworth 50% of the overall mark of this assignment.

(iii)You are expected to answer some questions about the main aspects of your work duringyour demonstration.

(iv)More specifically, your Assignment 2 will be assessed as follows:

Excellent (70 - 100%)All features have been implemented. The program is well-structured and commented.Your game is well functioned and playable during your demonstration. All questionsare answered correctly. The report is well written and structured, and only containsminor mistakes and all requirements for the report are met.Good (55 - 69%)The program implements all of the required features, but has not well structured andcommented. Your game is functional and reasonable playable your demonstration.Not all questions are answered correctly. The report is written reasonable well, but itcontains some mistakes and/or few requirements are not met. The report was goodstructured, and it has many mistakes, but the overall requirement are mostly met.Poor (40 - 54%)The program implements less than 50% of the required features, but has poorstructure and comments. Your game is not functioned well and barely playableduringyour demonstration. Most of the questions are not answered correctly. The report waspoorly structured, and it has many mistakes, but the overall requirement are mostlymet.Awful (0 – 39%)The program does not work. It has poor structure and comments. Your game is notfunctioning at all during your demonstration. No question is answered correctly. Thereport was poorly structured, and it contains many fundamental mistakes, theoverallrequirements are not met.3

标签:guess,your,number,should,game,CE243,user,using,ARM
From: https://www.cnblogs.com/CSSE2310/p/18516485

相关文章

  • HarmonyOS:自由流转介绍
    ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤博客园地址:为敢技术(https://www.cnblogs.com/strengthen/ )➤GitHub地址:https://github.com/strengthen➤原文地址:https://www.cnblogs.com/strengthen/p/18515669➤如果链接不是为敢技术的博客园地址,则可能是......
  • HarmonyOS:应用性能优化实践
    ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤博客园地址:为敢技术(https://www.cnblogs.com/strengthen/ )➤GitHub地址:https://github.com/strengthen➤原文地址:https://www.cnblogs.com/strengthen/p/18515687➤如果链接不是为敢技术的博客园地址,则可能是......
  • ARM和X86架构
    原文链接:https://zhuanlan.zhihu.com/p/21266987CPU的这两大架构:ARM和X86。要了解X86和ARM,就得先了解复杂指令集(CISC)和精简指令集(RISC)从CPU发明到现在,有非常多种架构,从我们熟悉的X86,ARM,到不太熟悉的MIPS,IA64,它们之间的差距都非常大。但是如果从最基本的逻辑角度来分类的话,它们......
  • 2024最新PyCharm安装教程(超详细)
    一、Pycharm下载安装在安装pycharm之前,确保你的电脑配置好了pythonpycharm windows版本下载地址:点击这里注意:由于下载速度较慢,我贴心的将下载好的安装包安排好了,可以直接进行安装获取方法:点击这里​​下载完安装包后,打开安装包​​点击下一步​​在电脑磁盘里提前......
  • [错误代码] SQLSTATE[HY000] [1045] Access denied for user 'cs2021'@'localhost' (u
    错误分析错误代码:SQLSTATE[HY000][1045]Accessdeniedforuser'cs2021'@'localhost'(usingpassword:YES)错误类型:数据库连接错误错误原因:用户名或密码错误。数据库用户没有权限从 localhost 连接。MySQL服务未启动或配置问题。解决方案检查用户名和密码......
  • HarmonyOS:自定义组件冻结功能
    一、简介自定义组件冻结功能专为优化复杂UI页面的性能而设计,尤其适用于包含多个页面栈、长列表或宫格布局的场景。在这些情况下,当状态变量绑定了多个UI组件,其变化可能触发大量UI组件的刷新,进而导致界面卡顿和响应延迟。为了提升这类负载UI界面的刷新性能,开发者可以选择尝......
  • HarmonyOS NEXT 组件市场在DevEco Studio,安装出现Fail to load plugin descriptor fro
     HarmonyOSNEXT开源组件市场  https://gitee.com/harmonyos-cases/cases  根据gitee的下载连接,下载了cases-master.zip。如果在devstudio-settings-plugins-设置按钮-installfromdisk,会报错,说明这个不是真正的插件包。解压这个zip,在plugin文件夹下有个case_plug......
  • Pycharm如何拉取gitlab代码及提交代码
    一、区分gitlab和github1.首先要区分gitlab和github是不一样的,不共用一个账号二、拉取gitlab代码1.Git克隆gitlab上的代码到Pycharm2.注意:此时拉取的代码是master上面的代码,即拉取远程master的代码到本地master分支3.在本地master分支更新下,拉取最新的代码4.打开自己的......
  • HarmonyOS:一次开发,多端部署(4)
    ★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤博客园地址:为敢技术(https://www.cnblogs.com/strengthen/ )➤GitHub地址:https://github.com/strengthen➤原文地址:https://www.cnblogs.com/strengthen/p/18513894➤如果链接不是为敢技术的博客园地址,则可能是......
  • ARM ACE 和 ACE-LITE 的含义
    ARM的ACE(AXICoherencyExtensions)和ACE-Lite是ARM的AXI(AdvancedeXtensibleInterface)总线协议的扩展版本,用于实现多核处理器系统中的缓存一致性。ARM提供了ACP和ACE-lite接口,这两个接口都有devicecoherency的功能。ACP是DSU模块的slave接口,它的接口协议规范是ACE-lite协议的......