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

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

代寫SCC.369、C++語言編程代做
代寫SCC.369、C++語言編程代做

時間:2024-10-21  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



SCC.369 Coursework 1: Working with GPIO
Moodle submission 16:00 Friday week 4; weighting 33% of module.
Aim
Having familiarized yourself with the C development environment and the basic process of writing to registers to control the GPIO pins, in this coursework you will explore some of the other functionality that’s possible with GPIO pins. Along the way you will get more comfortable working with registers to control the MCU and a better idea of the capabilities of the nRF52 series of MCUs. You will also start working with breadboards and electronic components.
Instructions for all subtasks
The coursework is split into a number of subtasks, listed below. Implement each one of them from first principles using pure C. This means that you are NOT permitted to use any library functions that you have not written yourself (apart from for debugging over serial) – only #include "MicroBit.h". In addition to C keywords and C operators, you can use typedefs, structs and literals from the nRF SDK.
We will be looking at and testing your code with the help of some automated scripts, so it’s super important that you follow the following guidelines. If you do not, you will lose marks:
1. Write and submit your CW in a file called CW1.cpp.
2. Start with the template CW1.cpp file on Moodle because it has all the functions correctly
listed, you just need to write the code for each one!
3. Within CW1.cpp, write your code for each subtask within the indicated section of the file.
4. Do not change the specified function prototypes (i.e. function name, parameters and return
type) for each subtask, use the ones given in the CW1.cpp template.
5. Do not include a main() function or main.cpp file in your submission, although you will of
course need to use one for your own testing. You might like to use the main() in MainSubtaskRunner.cpp because that’s what we will use when we test your code.
For each subtask, 20-30% of the marks will depend on code quality. The kinds of things we will be looking for include:
• Visually well-formatted and readable code
• Good, elegant code structure and style, e.g.:
o Appropriate use of loops, helper functions, literals etc.
o Initialise MCU peripherals only once where possible, e.g. don’t keep setting the
direction register of a GPIO port if the directions don’t keep changing.
o Only change the bits of a register that you need to, e.g. AND or OR in the bits you
need to change.
• Ample and thoughtful comments including:
o Before function definitions explaining function purpose, parameters etc. o What variables are used for
o The choice of bit patterns and/or literals being written to registers
o The purpose of writing to registers
o The purpose of loops etc.
• No commented-out code with no explanation!
Remember to have fun . Use the labs to ask about anything you don’t understand!
1

Subtask 1, 20%: Display a binary number that counts up at 5Hz
This subtask requires you to write two functions as follows:
Function prototype: void displayBinary(uint8_t value);
Set the bit pattern of a row of LEDs on the micro:bit to match the least significant 5 bits of the unsigned 8-bit value provided as a parameter. The least significant bit should be on the right when looking at the micro:bit with the USB cable pointing up. A ‘1’ in a bit position should turn the corresponding LED on, a ‘0’ should turn the LED off. You can use any row of LEDs on the micro:bit to show this 5 bit number, but only use one row – the LEDs on the other rows should not light up.
The first time displayBinary() is called it will need to initialise GPIOs. It’s good practice not to repeatedly re-initialise registers with the same value, so you could use a local static variable to record the first time displayBinary() is called so that subsequent calls don’t repeatedly initialise.
Function prototype: void countUpBinary(uint8_t initialValue);
Write a function that causes the number on the row you chose above to count up in binary, one count at a time, starting at the value passed in. You should call your displayBinary() function from above. After reaching a displayed count of 0b11111 the counter should ‘keep going’, i.e. wrap around to 0b00000. The frequency of counting should be 5Hz, i.e. 5 counts per second or 200ms per count. Think about how you can test the frequency of counting; the stretch goal is to see if you can adjust it to be within 5% of the target.
Subtask 2, 20%: Display a binary number that counts down/up with buttons A/B
For this subtask you will need to use two GPIO pins as inputs; use the ones connected to buttons A and B on the micro:bit. Check the micro:bit schematic to see which GPIOs they use. There is only one function to write:
Function prototype: void countWithButtonsBinary(uint8_t initialValue);
This function displays the initial count value passed in, using the displayBinary() function from Subtask 1, and updates the display with a new value when a micro:bit button is pressed. Button A should decrement the value by one count, and button B should increment it by one. To make this work well you will need to debounce the button inputs. The count should wrap around to 0b11111 when decremented below zero, and vice-versa. The count should only change on a button press, not on a button release, and it should not keep incrementing while a button is held down. Remember to use the relevant PIN_CNF[x] register to access all the settings you need.
Subtask 3, 25%: Measure and display an analogue voltage
NB the week 3 lecture will explain aspects of this Subtask.
For this subtask you will configure the GPIO connected to micro:bit pin P0 as an analogue input and read the voltage present on that pin. To test this you will need to apply a variable analogue voltage to that pin. You’ll need a breadboard, a micro:bit breakout adapter, a variable resistor and some jumper wires.
Wire up the ends of the variable resistor to power and ground, and connect the slider to P0.
For this subtask, in addition to your code please submit a photo of your working micro:bit/breadboard setup in .jpg format for some easy marks! Please name it ST3.jpg.
Function prototype: uint8_t sampleVoltage(void);
  2

Write a function to measure the magnitude of the analogue voltage on the large P0 pin of the micro:bit edge connector. There are many ways to configure the analogue-to-digital converter (ADC) on the nRF, but the important thing is that this function returns an 8-bit unsigned value where 0 represents an input of 0V and 255 represents an input of 3V (that the MCU is being powered from). Wire the variable resistor so that fully anticlockwise produces 0V on the wiper and fully clockwise 3V.
Function prototype: void displayVoltageBinary(void);
Write a function to repeatedly display in binary the magnitude of the analogue voltage measured on the large P0 pin. Use your displayBinary() function from Subtask 1 and make sure to display the five most significant bits of the sampled voltage so that the display reaches 0b00000 when the variable resistor is turned fully anticlockwise and 0b11111 when it’s turned fully clockwise.
Subtask 4, 25%: Drive an RGB LED
NB the week 3 lecture will explain aspects of this Subtask.
For this subtask you will connect an RGB LED to P1 (red), P8 (blue) and P9 (green) on the micro:bit edge connector, each via a current-limiting resistor. Use a 220R resistor for red and 100R for blue and green. The LED we are using is a common anode type.
Function prototype: void driveRGB(void);
You can drive the P1, P8 and P9 pins as regular GPIO outputs if you want to see how the LED works with one or more elements lit up. But for the coursework, control each pin with a PWM signal at roughly 1kHz. Driving all three colours at a fixed ratio of 50% on, 50% off gets you over half the marks. Making the LED ‘breathe’ by repeatedly fading from completely off to fully on and back over the course of 2-4 seconds for a full cycle gets more marks, and the stretch is to have the variable resistor from Subtask 3 control the colour at the same time the LED is breathing – a full turn of the resistor knob should run through a wide range of colours such that there are no obvious switches from one colour to another – a nice, gentle fade through a wide colour palette!
For this subtask, in addition to your code please submit a photo of your working micro:bit/breadboard setup in .jpg format for some easy marks! Please name it ST4.jpg.
Subtask 5, 10%: Display a binary number that counts up/resets on touch input
NB the week 3 lecture will explain aspects of this Subtask.
The final subtask has a lower weighting but is here to stretch you!
It’s like Subtask 2 but the display should count up by one count when you touch the golden micro:bit “face” logo above the LEDs. No need to worry about counting down for this subtask though.
Function prototype: void countWithTouchesBinary(uint8_t initialValue);
This function displays the initial count value passed in, using the displayBinary() function from Subtask 1, and increments the displayed number by one when the golden micro:bit face logo is touched. A “long-touch” to reset the count to the initialValue will get you extra marks ***2;.
Mark Scheme
For each subtask, 70-80% of the marks will be awarded for meeting the functional requirements given. 20-30% of the marks will depend on code quality as described on the first page above. If you
   3

do not use the filename, function prototypes and hardware configuration specified (all repeated in red below) you will lose marks. Your work will be assessed by a combination of automatic processing and manual inspection. Your final grade will be based on a weighted mean of your subtask marks.
        Subtask
Hardware config
Weight
To be submitted
(submit code in CW1.cpp)
        1: Display a binary number that counts up at 5Hz
One row of micro:bit display
20%
displayBinary() countUpBinary()
         2: Display a binary number
that counts down/up with buttons A/B
Same row of micro:bit display; the micro:bit buttons
20%
countWithButtonsBinary()
        3: Measure and display an analogue voltage
Same row of micro:bit display; variable resistor wired to edge connector pin P0
25%
sampleVoltage() displayVoltageBinary() ST3.jpg photo of hardware
        4: Drive an RGB LED
RGB LED wired to edge
connector pins P1, P8 and P9
25%
driveRGB() ST4.jpg photo of hardware
        5: Display a binary number that counts up/resets on touch input
Same row of micro:bit display; the touch-sensitive micro:bit ‘face’ logo
10%
countWithTouchesBinary()
    4

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp





 

掃一掃在手機打開當前頁
  • 上一篇:代做TUCH.UB25、代寫python語言程序
  • 下一篇:代寫CS 551、代做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在线免费观看
    91久久久久久久| 久久久日本电影| 久久久com| 亚洲视频在线观看日本a| 韩国一区二区av| 精品国产一区二区三区久久狼黑人 | 国产亚洲福利社区| 国产精品老女人视频| 欧美日韩视频免费| www.国产精品一二区| 日韩欧美精品一区二区 | 国产成人黄色片| 天堂va久久久噜噜噜久久va| av不卡在线免费观看| 伊人精品久久久久7777| 草b视频在线观看| 在线精品日韩| av色综合网| 天堂а√在线中文在线| 久久免费视频在线观看| 欧美一级免费在线观看| 久久精品国产sm调教网站演员| 日韩av电影中文字幕| 久久国产成人精品国产成人亚洲 | 日韩欧美视频免费在线观看| 国产国语刺激对白av不卡| 亚洲日本无吗高清不卡| av日韩一区二区三区| 亚洲高清资源综合久久精品| 久久理论片午夜琪琪电影网| 午夜欧美不卡精品aaaaa| 久久久欧美精品| 日韩欧美第二区在线观看| xxav国产精品美女主播| 国产综合av在线| 一本久道久久综合狠狠爱亚洲精品| 97精品免费视频| 日本午夜精品一区二区三区| 精品久久久91| 每日在线更新av| 亚洲一区二区三区视频播放| 国产成人精品日本亚洲| 激情五月婷婷六月| 欧美激情精品久久久久久久变态| 91精品久久久久久久久青青 | 国产中文字幕日韩| 亚洲一二三区在线| 北条麻妃在线一区二区| 国产男女免费视频| 一区二区视频在线观看| 久久免费福利视频| 激情图片qvod| 亚洲精品偷拍视频| 久久精品人人做人人爽| 国产精品亚洲美女av网站| 少妇免费毛片久久久久久久久| 深夜成人在线观看| 国产美女扒开尿口久久久| 少妇熟女一区二区| 久久综合九色九九| 久久国产一区| 国产免费内射又粗又爽密桃视频| 色中色综合成人| 国产精品久久久av| 国产成人在线一区| 国模精品娜娜一二三区| 日本中文字幕不卡免费| 欧美成人亚洲成人日韩成人| 国产a一区二区| 国产美女永久无遮挡| 日本免费高清一区| 久久国产精品久久精品| 国产厕所精品在线观看| 国产日韩欧美亚洲一区| 日本一区二区三区四区五区六区 | 亚洲自拍的二区三区| 久久精品国产亚洲一区二区 | 国产欧美在线观看| 欧美中文字幕在线观看视频| 一本色道久久综合亚洲二区三区| 久久视频在线观看免费| 91免费黄视频| 国产美女主播一区| 欧美精品一区二区三区在线看午夜| 最新国产精品久久| 国产精品免费视频久久久| 国产黑人绿帽在线第一区| 国产精品一色哟哟| 蜜桃视频日韩| 日韩国产欧美精品| 亚洲欧美日韩精品在线 | 国产v综合v亚洲欧美久久| av动漫在线免费观看| 国产一区喷水| 激情六月丁香婷婷| 欧美自拍大量在线观看| 午夜久久久久久久久久久| 精品国产乱码久久久久久久软件 | 蜜桃传媒一区二区| 欧日韩不卡在线视频| 岛国一区二区三区高清视频| 欧美日本国产在线| 国产精品久久久久久av下载红粉| 久久久久久久久久久久久国产精品| 91精品国产91久久久久麻豆 主演| 国产一区二区在线播放| 黄色网在线视频| 日韩精品一区在线视频| 日本一区高清不卡| 日本高清视频精品| 日本午夜精品一区二区三区| 色综合影院在线观看| 亚洲欧美日韩不卡一区二区三区 | 国产日本欧美一区二区三区在线| 黄页网站大全在线观看| 欧美婷婷久久| 欧美中文字幕在线| 欧美中文字幕在线播放| 欧美中文字幕视频| 欧美日韩第二页| 欧美成人综合一区| 欧美激情视频一区二区三区| 欧美国产综合视频| 黄页网站大全在线观看| 极品校花啪啪激情久久| 精品无码av无码免费专区| 欧美 日韩 国产 激情| 欧美激情www| 精品一区日韩成人| 国产一区二区中文字幕免费看| 狠狠色伊人亚洲综合网站色| 激情欧美一区二区三区中文字幕| 欧美一区二区在线| 欧美精品一区在线| 国产一区二区三区四区五区加勒比| 免费久久久一本精品久久区| 国产在线视频一区| 国产日韩av在线| 波多野结衣久草一区| 久久久人成影片一区二区三区观看| 久久精品视频91| 九九九热999| 国产精品入口免费视频一| 国产精品美女呻吟| 色综合天天狠天天透天天伊人| 亚洲综合一区二区不卡| 日本一区不卡| 狠狠色噜噜狠狠色综合久 | 国产精品二区在线观看| 久久99久国产精品黄毛片入口| 亚洲高潮无码久久| 青草青草久热精品视频在线观看| 国内精品久久久久久久果冻传媒 | 久久综合给合久久狠狠色| 久久久久久久久久久久久国产| 国产精品久久二区| 亚洲电影一二三区| 激情小说网站亚洲综合网| 成人国产精品一区二区| 日韩在线欧美在线国产在线| 久久综合五月天| 亚洲精品免费网站| 欧美一级黑人aaaaaaa做受| 国产男女在线观看| 国产成人极品视频| 国产精品精品久久久| 亚洲视频导航| 欧美成人精品免费| 国产日韩在线一区| 久久99热只有频精品91密拍| 国产精品免费看一区二区三区| 一区二区免费在线观看| 欧美一区少妇| www.欧美日本| 国产精品视频中文字幕91| 中文字幕一区综合| 欧美综合第一页| 91久久精品久久国产性色也91| 啊v视频在线一区二区三区| 九九久久国产精品| 日韩久久一级片| 福利精品视频| 国产精品日韩一区二区免费视频| 欧美激情视频给我| 青青草视频在线视频| 成人av在线播放观看| 俺去了亚洲欧美日韩| 亚洲成人午夜在线| 国产综合精品一区二区三区| 久久人人九九| 色综合91久久精品中文字幕 | 欧美极品第一页| 青青青免费在线| 99精彩视频在线观看免费| 久久久久久久999精品视频| 中文字幕日韩精品一区二区| 青青草原av在线播放| 8050国产精品久久久久久| 精品国产乱码一区二区三区四区| 欧美精品自拍视频|