How to connect and test your Arduino board

Jun 5, 2020 09:51 · 1678 words · 8 minute read tell create menu section dialog

Hello and welcome to this tutorial on no-code programming for biology This video will guide you through how to connect your Arduino Rich UNO R3 board or indeed any other Arduino board to your computer It will then run through how to test the board is working by turning on an LED From your Biomaker starter kit you will need your Arduino board as well as the USB connection cable Plug the USB type B connector cable into the silver plug on the top left of your board and then plug the standard USB A connection end into your computer When you plug in the board you should notice a little green LED - right here It should light up - letting you know that the board is ready to go So once we have the board plugged in we’re going to look at how to use XOD to control it If we open up the XOD software on our computer (you can download this from www.XOD.io if you haven’t already) It can sometimes take a little while to load, but once it does this welcome screen should appear If we take a look up here on the top left we can see under ‘My Project’ is all the patches that we have in this project At the moment it’s just this one called ‘main’ and below that we have all of our libraries I have quite a few already installed but if it’s the first time you’re using this program you probably just have these XOD ones down here So the first thing that we want to do is create a new patch We’ll go up here and click on this little page icon on the top left next to where it says ‘Project Browser’ and that will open up this dialog box where we can enter a name for the new patch So let’s call this one something like ‘led-test’ We can type that in and then press either confirm or the Enter key and that will open up a new patch like the one we can see here The next thing we want to do is insert an LED node into the patch So there are three different ways to insert a new node into a patch If you know the name of the node that you want to insert the first way is to double click anywhere on the patch and it will bring up a search bar like this Then we can start typing the name of the node that we want to insert - so in this case ‘LED’ So we will start typing ‘LED’, and that will bring up a whole list of options as you can see here depending on what libraries you have installed The node that we want to install is from the xod/common-hardware library so we’ll go down to that option, click on it and that will insert the node into our patch The second way to insert a node into our patch is very similar So starting on a bank patch, if we click once and press ‘i’ on the keyboard that will bring up the same search bar as before We can start typing ‘LED’, select the correct node, and again this will insert into our patch The final way is to insert a node directly from a library So for this, we will go over here into the Project Browser scroll down until we find the xod/common-hardware library - here Click on it, and it will bring down a menu where we can find the right node: LED Click, drag it into the patch where we want to put it, and let go So all three of these methods produce the same result in the end and you will now have an LED node in your patch if we take a closer look at this node now we can see that it has three input pins here on the top as well as a single output pin on the bottom So if we make sure that we have clicked on the node then we can see that some extra information is now available in the sidebars So over here on the right, in the ‘Quick Help’ section we can see a little bit of information about each node as well as some information about each of its pins If you don’t see this sidebar by the way, you can always toggle it on and off by clicking this little question mark button at the top - here Over here on the left you also have the ‘Inspector Pane’ this is where you can change all of the properties of the node. You can also rename it if you like so for example, let’s call this one ‘LED1’ If we press enter we can see that the name of node changes and then we can also change the properties of each of the input pins here as well If we want to get this node to work we will need to change some of these properties of the pins Starting up here with the port pin, we want to change that to ‘D13’ That’s because on the Arduino UNO board this is the digital pin that the LED is connected to The next pin is luminosity This tells us how bright we want the LED to be This is a scale from 0 to 1, with 0 being ‘OFF’ and 1 being the brightest the LED can go So let’s go ahead and reset this to ‘1’ so that we have a nice bright LED We can only edit input pins not output pins so the last pin that we can change properties of is this input pin called act This is a boolean pin so it can only take values ‘True’ or ‘False’ The LED won’t change unless this is set to ‘True’, so let’s go ahead and set that to ‘True’ We can click on our patch and we are now ready to go So what we’ve done here is essentially create a really simple program that we can upload to our board and it will tell the LED to turn on So we’re going to go ahead and upload this by coming down here to this little lightning bolt button and clicking on it That will open up this pop-up window here We need to make sure that we have selected the correct board model So if we come up and have a look at this drop down menu - here we can see we have a lot of different options for different boards The one we want is Arduino Uno so let’s select that By the way if you don’t see Arduino UNO it may be under Arduino/Genion UNO It doesn’t matter, both of them are the same so whichever one appears on your computer you can use that The other thing that we need to make sure we’ve got correct is the device So if we click on the second drop-down menu, you’ll see we have a few options here as well and we want to select USB And we can now click upload So you’ll see that you get a little progress bar in the bottom here and when the program is successfully uploaded you’ll get this little ‘Uploaded Successfully’ notification If this is the first time that you’ve used the XOD program you may need to install dependencies first So you’ll get a little notification and there will be a blue bar appear at the bottom You should be able to click ‘Install’ or ‘OK’ or whatever button it says on there and that will install the dependencies for you You may then need to go back and upload the program again but this time it should work for you So now that we’ve done that let’s go over and take a little look at what is happening on our board At the top left of the board next to the silver USB port you should already be able to see the power light that is on Right below that is a second LED which is the one we want to control - right here I’ve just pressed the upload button on my computer in XOD so let’s have a look at what happens As you can see, the light might flash on and off a little bit while the program is uploading but then the light should turn off So that’s it, we have now tested our board by turning the LED light on and we know how to control our board using XOD So I’m just quickly going to show you, as well, how to turn this led off by clearing all programs from the board So back in XOD now. We’re going to open up a new patch by clicking on that little new page icon Now we’re going to give it a name in this case I’ve used ‘clear’ Press ‘Confirm’ or enter and that will open up a nice clean patch for us and we’re simply going to upload this empty patch by clicking on that little lightning upload button clicking upload, and that’s it And we’ll now take a look at what’s happening on our board Again we’re looking at this little LED on the top left hand corner up here and we can see that as the program uploads it flickers on and off for a bit and it is now turned off So that’s everything for this tutorial session In the next session we’re going to be showing you how to connect external components to the board either directly or by using expansion shield We’ll also learn more about how to control the other inbuilt components on the Rich UNO R3 board later in the course If you have any questions or if your board’s not working and you need help troubleshooting Let us know in the comments and we’ll do our best to help you Thanks for watching .