SOFTWARE GUIDE FOR BEGINNERS
Well, if you're reading this I guess you've already practiced the hardware guide for beginners. In this second part what we are going to carry out step by step is the basic program to connect and disconnect the LED STATUS of the MIOIO card.
The first thing that we will need is a computer with an internet connection and a Google email account, those that end at @ gmail.com. If you do not have it, and you do not know how to get it you can ask someone to help you create a new one for you, or to lend yours.
The second thing we need to do is check that our Android device has an App to read bar codes, if you can not find it in GOOGLE PLAY STORE by putting "QR Code Reader”.
And third, and not least, is to prepare our device to accept applications that are not in the Play Store, as is the case that we are going to create.
To do this, in the Android device, we go into Settings-> Security and activate the box where you put Unknown Origins.
Great, if you already have the email account and the code reader, we can start.
- We open a web browser, other than Internet Explorer, and we put in the address bar http://mioio-appinventor.appspot.com this is the moment in which we will ask for the email and GMAIL key. This is done so that no one but us can access the applications we make.
- Once we have accepted, we will enter the application MIOIO App Inventor 2.
- Now we will click on the button "Start a new project ..." and we put the name that we want to our first project. Press OK. We see that we are opening a window with a little window in the middle of a mobile and a lot of buttons and controls on the left, do not panic, you can take some time seeing that it is all pressing on them. Simply indicate that there are components that will necessarily appear on the screen of our Android device, such as a button, and others that will not be seen, such as GPS, or the blocks of the MIOIO card. Once you have become familiar A little with the things you have seen in the menu on the left, note as above to the left there are two buttons, which puts "Designer" and "Blocks". These buttons indicate the two parts of the application that we need to make the Android application. Let's try it with our example.
- In the Designer window we will select the category on the left that says "User Interface" and drag with the mouse a "Button" to the screen of the mobile that we have seen in the middle.
Then we will click on the category MIOIO-AppInventor-DigitalOut, and the control below, "Led_", we will also drag it to the screen of the mobile. We already have the necessary controls to be able to turn on and turn off the led STATUS of the MIOIO card .
- Okay, now what we are going to do is to determine the behavior of what we want to happen when we click on the button or we release it, in our case, what we want it to do is for the LED of the MIOIO card to turn on or off .
To do this we now move to the second part of the program, the part of the "Blocks".
It's time to click on the "Blocks" button in the upper left part of the screen of our computer. In this new window, we will work on a bigger canvas than the previous one. We see that on the left there are some blocks in the category "integrated", and others that are under the category "Screen1", the latter are those that we added. Now take some time getting to know them, as you did with the Components of the "Designer" part.
- Great, now you're ready.
Click on the block Button1. In the window that opens select "when Button1.Press" and drag it to the canvas. Do the same with the block "when Button1.Sold".
- Now click on Led_1 and drag the block "call MioioLed1.ledoff" into the block "when Button1.Press" that we used before. Like a puzzle.
Do the same with the block "call MioioLed2.ledon" but this time drag it into the other block of Button1, the one that says "when Button1.Soltar" we used before.
That is all, we already have the program done, now it only remains to "compile" it.
- In the top menu of the whole, where you put Generate, click with the mouse, and where you put App (generate QR code for the .apk file) press again.
- We will generate a QR code that we will scan with the program that we downloaded from the Play Store.
You can rip the example compiled from here: LED.apk