Skip to content
Snippets Groups Projects
Commit 53cf0799 authored by Runyu Ma's avatar Runyu Ma
Browse files

Update week09

parent cdcf1825
Branches
No related tags found
No related merge requests found
Pipeline #476806 passed
File added
......@@ -407,9 +407,65 @@
<p1>After all the soldering was completed, I used the multimeter again to recheck whether all the components were conducting normally and whether there were any short circuits or circuit breakers. </p1>
<img src="../../images/Week08/test1.jpg" alt="Description of image" width="800" />
<img src="../../images/Week08/test2.jpg" alt="Description of image" width="800" />
<h4> Step 9 It works well with LEDs!</h4>
<img src="../../images/Week08/blink.jpg" alt="Description of image" width="800" />
<h4> Step 9 Arduino Programming to blink the LED</h4>
<h4>Step1. Prepare nRF82540 sense board for Arduino Programming</h4>
<p1> 1. Intall the nRF82540 sense libary</p1>
<p1> For Mac, navigate to Arduino IDE > Settings, and fill "Additional Boards Manager URLs" with the url below: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json</p1>
<img src="../../images/Week09/lib1.png" alt="Description of image" width="800" />
<img src="../../images/Week09/lib2.png" alt="Description of image" width="800" />
<p1> 2. Intall the nRF82540 sense board manager</p1>
<p1> Navigate to Tools > Board > Boards Manager..., type the keyword "nrf52" in the search box, select the latest version of the board you want, and install it. You can install both.</p1>
<img src="../../images/Week09/boardManager.png" alt="Description of image" width="800" />
<img src="../../images/Week09/bm.png" alt="Description of image" width="800" />
<p1> 3. Select your board and port</p1>
<p1>After installing the board package, navigate to Tools > Board and choose the board you want, continue to select "Seeed XIAO nRF52840 Sense". Now we have finished setting up the Seeed Studio XIAO nRF52840 (Sense) for Arduino IDE.</p1>
<img src="../../images/Week09/boardManager.png" alt="Description of image" width="800" />
<img src="../../images/Week09/sb.png" alt="Description of image" width="800" />
<img src="../../images/Week09/port.png" alt="Description of image" width="800" />
<h4>Step2. Arduino Programming</h4>
<p1> Based on my PCB design, the LED on the board was connected to D1 of the nRF82540, so I changed the port number in blink code to D1</p1>
<img src="../../images/Week08/led.png" alt="Description of image" width="800" />
<p1> The blink code is as below:</p1>
<div class="code-display">
<pre><code id="code-to-copy">
#define LED_BUILTIN D1
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
</code>
</pre>
<button class="copy-btn" onclick="copyCode()">Copy</button>
</div>
<script>
function copyCode() {
var code = document.getElementById('code-to-copy');
var range = document.createRange();
range.selectNode(code);
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
document.execCommand('copy');
window.getSelection().removeAllRanges();
alert('Code copied to clipboard!');
}
</script>
<p1> Upload the code to the nRF82540 and it blinks!</p1>
<img src="../../images/Week08/blink.jpg" alt="Description of image" width="800" />
<h2>Source Files</h2>
<a href="../../Resources/Week08.zip" download>Download All Source Files</a>
......
public/images/Week08/blink.jpg

161 KiB | W: | H:

public/images/Week08/blink.jpg

194 KiB | W: | H:

public/images/Week08/blink.jpg
public/images/Week08/blink.jpg
public/images/Week08/blink.jpg
public/images/Week08/blink.jpg
  • 2-up
  • Swipe
  • Onion skin
public/images/Week08/led.png

275 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment