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

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

SCC.369代做、代寫(xiě)C/C++編程設(shè)計(jì)
SCC.369代做、代寫(xiě)C/C++編程設(shè)計(jì)

時(shí)間:2024-11-09  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



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!
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
4
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()

請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp






 

掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇:代做INT2067、Python編程設(shè)計(jì)代寫(xiě)
  • 下一篇:COMP2211 代做、代寫(xiě)shell interface程序設(shè)計(jì)
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢(qián)_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢(qián)_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場(chǎng)仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲勞振動(dòng)
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個(gè)行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開(kāi)團(tuán)助手,多多出評(píng)軟件徽y1698861
    超全面的拼多多電商運(yùn)營(yíng)技巧,多多開(kāi)團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服務(wù)平臺(tái)
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 寵物飼養(yǎng) 十大衛(wèi)浴品牌排行 suno 豆包網(wǎng)頁(yè)版入口 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    日韩不卡视频一区二区| 成人精品一区二区三区| 国产精品久在线观看| 久久精品99| 久久精品日产第一区二区三区| 国产第一页视频| 久久久噜噜噜久久| 久久久久久免费看| 国产精品丝袜久久久久久高清| 精品国产一区二区三区久久久 | 国产一区二区丝袜| 欧美成ee人免费视频| 黄色av网址在线播放| 国产一区视频在线| 国产欧美日韩综合精品二区| 国产精品尤物福利片在线观看| 福利在线一区二区| 成人精品一区二区三区电影黑人| www国产亚洲精品| 久久频这里精品99香蕉| 久99久在线| 久久亚洲精品网站| 午夜精品久久久久久久久久久久久 | 国产精品日韩欧美一区二区| 久久青青草综合| 久久精品成人一区二区三区| 久久夜精品va视频免费观看| 亚洲在线一区二区| 日韩免费av在线| 国产午夜福利在线播放| 99久热re在线精品996热视频| 久久美女福利视频| 国产精品十八以下禁看| 国产99久久精品一区二区永久免费| 亚洲淫片在线视频| 欧洲精品一区二区三区久久| 国产素人在线观看| 国产v亚洲v天堂无码| 国产精品国产一区二区| 亚洲精品国产精品国自产观看| 青青影院一区二区三区四区| 国产美女直播视频一区| 日韩在线视频一区| 一区二区三区在线观看www| 日本一区网站| 国产一区二区三区乱码| 九一国产精品视频| 欧美日韩成人黄色| 欧美中日韩免费视频| 成人精品一区二区三区电影黑人| 久久久久一本一区二区青青蜜月| 色综合导航网站| 欧美一级大胆视频| 久章草在线视频| 欧美极品第一页| 男女视频一区二区三区| 国产精品99久久久久久久久久久久| 国产精品高精视频免费| 日韩精品一区二区三区四区五区| 97久久国产精品| 精品免费久久久久久久| 欧美在线www| 91黄在线观看| 中文字幕日韩精品无码内射| 激情综合网俺也去| www.日韩视频| 日本亚洲精品在线观看| 99在线观看视频免费| 精品国产一二三四区| 男人天堂新网址| 国产成人精品最新| 日韩国产小视频| 国产高清一区视频| 午夜免费电影一区在线观看| 国产欧美日韩免费| 欧美精品在线免费观看| 国产自产在线视频一区| 久久视频中文字幕| 欧美怡红院视频一区二区三区| 久久精品视频16| 日本精品一区二区三区在线 | 国产精品福利观看| 欧美日韩二三区| 久草热视频在线观看| 日韩av123| 久久精品xxx| 欧美一区二区视频17c| 国产精品自产拍在线观| 伊人久久大香线蕉午夜av| 国产一级不卡毛片| 国产精品成人aaaaa网站| 黄色污污在线观看| 国产精品国产自产拍高清av水多 | 俺也去精品视频在线观看| 日韩精品在线中文字幕| 日韩在线视频观看正片免费网站| 欧美做受777cos| 国产精品欧美日韩| 国产视频精品网| 久久国产精品影视| 成人国产一区二区| 日韩一区不卡| 久久久久久a亚洲欧洲aⅴ| 色综合久久av| 久久久久久香蕉网| 欧美日韩在线高清| 精品国产综合区久久久久久| 成人中文字幕av| 日本欧美色综合网站免费| 国产精品网址在线| 国产视频一区二区三区在线播放| 欧美激情在线一区| 91福利视频导航| 青青久久av北条麻妃黑人| 国产精品视频一区国模私拍| 国产日韩欧美自拍| 五月天色婷婷综合| 国产精品无av码在线观看| 国产精品有限公司| 日本一区二区不卡高清更新| 国产精品免费看一区二区三区 | 国产精品成人一区| 97久久精品在线| 欧美在线一区二区三区四| 国产精品成人av在线| 99在线国产| 欧美日韩一区二区三| 国产精品久久国产三级国电话系列| 国产女主播一区二区| 亚欧洲精品在线视频免费观看| 国产成人免费电影| 99中文字幕| 欧美午夜精品久久久久免费视| 欧美大片欧美激情性色a∨久久| 国产成人av在线| 国产色综合天天综合网| 日韩中文字幕在线不卡| 国产精品裸体瑜伽视频| 91精品久久久久久久久久另类| 欧美久久久久久久久久久久久| 伊人久久av导航| 日韩视频免费大全中文字幕| 国产啪精品视频网站| 青青青国产精品一区二区| 在线国产99| 国产精品美女午夜av| 91精品视频免费| 免费一级特黄特色毛片久久看| 色乱码一区二区三区熟女| 欧美精品aaa| 国产精品久久久久久久久久久久| 久久露脸国产精品| 国产精品一区二区三区在线播放 | 韩国精品久久久999| 性欧美长视频免费观看不卡| 不卡av电影院| 国产精品日韩二区| 久久久久久伊人| 91精品国产91| www国产黄色| 国产欧美日韩视频| 免费日韩中文字幕| 欧美日韩性生活片| 人偷久久久久久久偷女厕| 亚洲精品日韩av| 欧美日韩国产成人在线| 国产精品第3页| 久久精品91久久久久久再现| 久久久亚洲国产| 国产精品亚洲网站| 国产在线久久久| 蜜桃传媒一区二区| 国自在线精品视频| 欧美黄网在线观看| 人人妻人人澡人人爽精品欧美一区| 色香蕉在线观看| 天天干天天操天天干天天操| 亚洲a中文字幕| 亚洲高清在线观看一区| 亚洲精品日韩在线观看| 亚洲欧美国产一区二区| 一本一道久久久a久久久精品91| 欧美乱大交xxxxx| 国产精品成人观看视频国产奇米| 国产精品裸体一区二区三区| 国产精品夫妻激情| 美女精品久久久| 中文字幕av导航| 亚洲在线观看视频| 色噜噜一区二区| 热久久视久久精品18亚洲精品| 热久久免费国产视频| 女同一区二区| 国产天堂视频在线观看| 高清视频欧美一级| 91精品国产99| 日韩有码在线视频| 久久久久久久999| 国产精品网红福利| 欧美成在线观看|