In order to give you a better idea as to how the GPIO's are communicated with through your PC host, we wanted to talk to you about communicating with your board through the ADB, so the Android Debug Bridge. And I know in previous courses, Jacob and Aria actually went over creating a path and getting to your SDK, right? >> Mm-hm. >> Yeah, so this time we're actually gonna do the exact same thing, only we're gonna turn a GPIO on. Now if you can see down here, you actually see this circuit we already have set up. I'm gonna kinda trace what's going on here, and you're gonna notice a circuit that you haven't seen yet. We will be teaching you how to build this circuit later on in the course, in fact not too far later on. I think in the next module. So, if you wouldn't mind I'm gonna kind of point out some stuff here real quick. So, this blue wire is actually coming from the pin 34, which for us is gonna end up being GPIO 935 on the Android Operating System. We're gonna communicate with that using the PCOs. That's gonna send a signal into this little amplifier. Now, later on we're going to explain why we're using this amplifier, so I'm not gonna go too much into it. But this amplifier is gonna take the voltage from our pin and it's gonna to send it out through this purple wire right here. It's gonna communicate with this LED and it's going to tell it to turn on. So I guess let's go into the terminal here and figure out how to do that. >> So as you can see here we're at Robert's terminal, and what we want to do is to look for the Android SDK and so, to go about doing so, we have to change the directory to our library. From there we have an android folder and so we're gonna go to that and in the android folder, we have our SDK located at the directory called SDK. And from there we would go to our platform-tools to access our adb. Add this will allow us to contact with or be able to talk to the dragon board 410C and access the GPIOs. >> Yeah, what we wanna do first is, make sure that the device is actually recognized by the PC host. And adp has a nice little command for that, it's just basically adp devices. So you type that in and you can see that in fact it is being recognized by the host computer. We'll then just go into it now. So we're gonna write the command adb shell, that brings us into the shell of the dragon board 4 10 c. Now, you're gonna have to do this eventually. You're gonna need super user access in order to control the GPIOs, so I like to do it at the beginning. You could just type in su, that gives you super user access and you notice that the dollar sign turn into a hash tag. So yeah, now let's find the GPIO directory. Conventionally you're going to find the directory in the sys class of folders so you're just going to C D into that, cd /sys/class. And if we look inside here, you're gonna see that we have the GPIO folder right there. Now let's kind of get in there now, whoops, that's wrong, cd gpio. Now inside the gpio you're going to see all these gpio chips. The GPIO chips are what contain the GPIOs that we are going to use. And we talked, I think, earlier about how the Linux and the GPIOs for Android are offset by 902. So, we know that our pins based on our diagrams and the documentation that we've been provided and we're providing you, pin 34, which we want to use, is actually GPIO 935. So let's export that one. In order to export it, we're gonna echo 935 > export. And that will give us our gpio935 right up here. So now we want to control that pin, so we're gonns cd into the gpio935 directory. And you can see all the different options we have here. All right. The main ones we're gonna be using is direction and value. So let's check what direction it's already set at right now. I type in cat direction, you can see that it's defaulted as an out, at least for now. And we can cat the value. And we see that the value ise set to 0, which actually makes sense because our GPIO isn't on. >> Yeah. >> Right? >> All right, so let's set the value. >> Yeah, so if we want to change the value from zero to one, what we wanna type is echo. And then we wanna write 1 and then overwrite the value file. So just as Robert is typing. >> As I hit enter we're going to see the GPIO turn on the LED right here so boom, just like that. Now same thing can be said if we want to turn it off. >> You can do the same thing, but instead of a 1 you'd change that value to a 0 and boom it's off. >> You can kind of go back and forth there, nice. All right, cool. So, you learned how to connect to your Dragon Board 410C with the Android operating system using the SDK that comes with your Android Studio. They taught you how to do all that already, but now we just kind of linked it to the hardware part of this. And hopefully you can get this working on your own.