 So, first of all, I'd like to start with, who is this talk for? So, I just now, Leon did a poll, like many of you are beginners, right? So, actually this talk is for you. And some people may have used Arduino before also. So, yeah, this talk is also for you. Okay, so, start with the basics. What is the rest verify? So, I just copied the definition from Wikipedia. The rest verify is a series of credit card size computers developed in the UK. So, to teach people the basics of programming and computer size. So, there are actually many types of rest verify here. So, don't be alarmed by so many of this. Just, if you want to buy a rest verify today, you get this one. The one at the top right, it's called the Model 3. It's a Pi 3 Model B, which is actually released at the start of this year. There are actually many of these versions because rest verify actually started 4 years ago. So, they released about 1 every year. So, do not purchase of the day once. Obvious lah. Ya, because obviously once they are older, slower, less features. Okay, then also I like to special mention these 3. So, these 3 actually they are for special use cases. Here, the Model A Plus and the Zero, they are actually a smaller version of the rest verify. So, this is for space constraint applications. Then the complete module here, this is actually for industrial applications. Just for extra information. So, anyway, if you want to buy, just get this. The new one. So, this slide is for those who have a sub-experience in Arduino. Do not have to reach through all the specs. Basically, what this shows is that the rest verify is generally more powerful than that of the Arduino. So, the difference between these 2 is that Arduino is classified as a microcontroller. The rest verify is classified as a microprocessor. The difference between these 2 is that microprocessors are usually more powerful than microcontrollers and they require an operating system to run. So, the operating system is usually Linux. But for rest verify 3, it can run Windows 10 also. For the microcontroller, when you code a piece of program right and you send to a microcontroller, that is the only thing that runs in your microcontroller, in your Arduino. But for rest verify and other types of microprocessors, your code is not the only thing that runs. It still has Linux and other programs running at the same time. So, that is the difference. Power consumption wise, you can see the difference. The Arduino is much less, uses much less power. So, if let's say you have a certain battery constraints, like if let's say you have to run a device for many days, then maybe rest verify is not for you. But if you need something very powerful, then you may need to use rest verify instead of the Arduino. So, what's the minimum start to get started? Let's say you want to buy rest verify 3. That's not the only thing you have to buy. Actually, you have to buy a HDMI monitor or you can use both DVR. If your DVR has HDMI input, then you can use that because the rest verify outputs the video through a HDMI port. Then you need a USB keyboard to interface with it. The power adapter, you need a 2.5Ah power adapter. So, most handphone chargers actually do not output 2.5Ah. So, you need to look carefully which power adapter actually can output this amount of current. So, the one thing I tested that works well is actually this iPad. So, this seems to work best. Even if you get those like 1M charger, your rest verify may not work properly. Micro USB cable, this is to supply power adapter to the iPad. Micro SD card, you can think of it as your small hard disk. This is where you store your Linux OS operating system on it. Then, you often need a computer to load the initial software onto the SD card. So, the step 1 is you need to download the SD card image. Where do we download it from? So, download from this website is the Resbian website here. So, you see, the rest verify as many available operating systems for this year. But for a beginner, I would recommend that you just choose the Resbian. Resbian, there are actually 2 types the Jesse and Jesse Lite. So, the difference between them just pick the Resbian without the Lite, which means this one too. Just download it, then it comes with a zip file and just unzip the file. So, you get this file here. So, how do you copy this image over to the SD card? So, there's another program, this one here. So, this is for Windows. For Mac and Linux, it's another tool altogether. But for this purpose, I assume it's a higher market share, right? I'm on the Mac computer also, so I'm using it both here. Anyway, just download these 2 here. Then, when you launch the 2, let me show you. Okay, very small. You never mind. Yeah. If you plug the SD card to your computer first. So, you see, it shows up here as a G drive. Actually, just be careful. Make sure you choose the correct drive. So, you can say 2 or 3 times drive and you're not sure which one. So, you just go to your computer and verify first. Okay, that's the G drive. That refers to my SD card. So, let me just... So, this is how you load the image in. Okay. So, I'm not going to press write because it takes about 5-10 minit to run the image in. So, I've actually already written the image in before this talk. So, now, I put the SD card in. Then, I'll switch the presentation now to the Raspberry Pi already. So, I plug up. So, a rule of thumb is that you plug in everything you need first before you plug in the power table. Okay. Okay. So, the first time the Raspberry Pi starts, it will take some time. So, this is normal. Just let it load to completion. No button there. So, just plug in the power and start automatically. Just plug it in. Okay. So, as usual, as we have any computer, it should actually eject and drive properly. So, eject button is here. So, now, I continue my presentation. Yeah. The top, right. So, you notice that I'm using live office now for Linux. So, live office is a rough open source of Microsoft Office. So, there's actually some initial configuration that you have to... Wah, I think I have to stand this way. Okay. So, there's actually some steps. So, the first thing you have to do is to set the Raspberry Pi initial configuration under here. References. Raspberry Pi configuration. So, go to localisation. Set the location here. So, we are not living in Britain. So, set to Singapore. But I'm time-lown also. No internet yet. Okay, the keyboard. So, by default, the keyboard has been set to the UK layout, which we do not want because the UK layout is slightly different. So, we set it to the US layout. When you press okay, they ask to reboot. So, I... Okay, just reboot. Also, you notice that the performance of Raspberry Pi is not that good as the normal computer, desktop computer. Because if you can see the size, it's so much smaller. So, a rough equivalent is that of a Pentium 3 and Pentium 4. Those who have viewed and lived through that time. So, that's about 10 years ago, the competitive performance. But that's very good, really. Imagine 10 years ago, Pentium 3, Pentium 4 is how big the desktop. Now, you get it in... What's the smaller size? Yeah, correct. Let's reboot. Let me go back to my validation. Yes, the label office is one of the default software inside. I've actually set up a 3G router over here. So, okay, let me connect to it. Do a system update. So, this system update, this is actually very similar to your Windows update. So, this is something that you should do for a new Raspberry Pi installation because sometimes there's some security issues. So, you want to make sure that your Raspberry Pi is secure. So, you download the latest update. But to do this, it's not as simple as point and click. So, you do something through a terminal here. So, a terminal here, if some of you may find it similar to a DOS Chrome, but actually this is very powerful for Linux. So, it's time to learn a bit. So, the command to do the update, actually there are two of them. Yeah. 21? 21. Okay, good. So, actually there are two commands here called the sudo app get update and sudo app get upgrade. Okay, the difference, sorry. Run away. So, the difference between these two is that here update means to look for new updates. Upgrade is to actually install the updates. So, sudo here means is to run the command app get with administrator permissions. Okay, so now let me run this. So, this will probably take some time. I just let it run first. Any questions in the meantime? Okay, very good question. What's the sudo password, right? Okay, the default username and password for Raspberry Pi is Pi. The password is Raspberry Pi. Yeah. But you can change it. Okay, it seems quite slow here. Okay, one more minute. Okay, I think never mind. So, after this command, it run finish, then it run this command basically. So, sudo app get upgrade. Okay, then the next one. Available applications. So, the applications is not the same as what you are used to. For example, web browser, maybe using Internet Explorer, Chrome or Firefox. For Raspberry Pi, the one they use is quite efficient here. So, just go into that here and click the web browser. Then, hand. Google. Yeah, it looks. So, this is the browser. Then, the Office applications just now I mentioned using LIGO Office. So, it's an open source office of web. So, the calculator is like Excel. Then, for PowerPoint, it's actually impressed that graph equivalent. Therefore, the middle player default. It does not have a middle player but you can install VLC. VLC is not by default. So, the command to use actually is sudo app get. Oh, sorry. So, you just add this command. Then, this will install VLC for you. But, I will not run it now. Okay, so, yeah, the default generally is high-res variant. Okay, so now it's time to introduce you to use the Power System Layout. So, in Windows, you probably see like C drive, B drive and so on. But, Linux doesn't use that. So, I will just show you here. So, you can see here, everything starts from slash. So, this is called root directory in Linux. Then, for your home directory, it's called slash home slash five or this to the symbol. These two mean the same thing. So, this is where you actually install media slash five. So, I'll apply my time drive again. Okay, I cancel. Here, media. Hi, and my time drive is here. Okay, so now, we turn the drive again. It's superior. Then, okay. Of course, you're not going to use a Raspberry Pi like a normal computer. You want it to interact with outside world. So, there are actually several pins in about 26 digital pins here. Over there. So, these pins allow Raspberry Pi to interact with external staff like LEDs, buttons and so on. And, something to take note that this is using 3.3V logic levels. So, for those familiar with Arduino, the logic level refers to a binary zero or one. When Raspberry Pi want to output a binary one, you output a voltage of 3.3V. And zero volts represents a binary logic of zero. So, you cannot actually connect these two together. If you connect these two together, when Arduino outputs 5V, it will damage Raspberry Pi. So, this is something to take note of. Sorry? Ya, some Arduino outputs 3.3V. Ya. But for the Arduino Uno, which is actually the most common one, it uses 5V as a logic level. Ok, so, for this example, I'll be using the Python programming language to teach you how to use the GPIO pins. So, the example I'll be demoing is that of the LED and the button. Ok, so, I've connected a button and the LED here to the GPIO pins. Do you have to install on special libraries or anything before you interact with the GPIO pins? Actually, the libraries are installed already in the default image. Ok? So, ok, I'll demo the code to just now the desktop. So, just now I copied this folder here, getting started with Raspberry Pi. So, the CT command here refers to change directory to go inside here. Ok? The LS means to show what's inside the directory here. So, I put it in the code. Ok. So, I'll just show the example first. So, it's like Python followed by the program that I want to run. Ok, see, the LED over there is blinking. So, adjust yourself. You cannot sit down. So, it blinks at interval of 1s. So, what is this code? So, I'll show you the code now. Size No. That's all ok. 30, ah. I think it's very good already. Ya, very good already. So, this is the code that I use to make the LED blink ah. So, I will not go through everything in the interval of time but I just show the important parts. Ok? So, here the GPR setup means that I initialize the pin that I want to use to blink the LED. So, I set it to the output mode. Ya. Then here, the while through essentially means to loop this again and again, non-stop. Ya. So, here I put a time slip means to pause the program. Then when the program slips for 1s it will change the LED status and write the new status in. So, here write, I put not is to write to toggle the status from true to false and false to true. So, this will do it again and again. Ya, understand? Ya. Ok. So, that is just for the LED. Well, of course, we don't want the Raspberry Pi to keep on outputting stuff. We want to send stuff to the Raspberry Pi. So, the next example will be I will be using a button so that I can send instructions to the Raspberry Pi. So, the next one is the LED button. Run it. So, you want anything? Ok. So, I just show you the code first before I run it. So, you can see here, right? Again, I do the same thing, a loop. And then, I read the input of the button. Then, after that, if let's say the button is pressed as if when I press here, this statement says if it's true, if the button is pressed then I'll toggle the LED. Supposed to work, right? So, now, I show you the demo here. You see? It doesn't work so well. Ok? So, this is actually a very common mistake. So, I show you the reason why. See, the reason is because here when it loops, right? It loops so quickly. So, it goes through here and then when you press the button, it detects as ok. Time to toggle, I'll toggle. But the human reaction, when you hold down, you probably hold down for half a second. But the micro processor actually times a second. So, that is why this code actually does not work. I'll show you the correct code. So, the correct code is here actually. This actually is called debouncing. So, I'll show you the demo first. See? When I press, press, press, press. So, now, it's working well. So, it toggles when I press the button. The difference now is this line here. So, what this line here is, I've written the command here, change status only and now it's greater than 0.2 seconds threshold. What does it mean is that this code here will only run let's say you press one time it will ignore subsequent input for the next 0.2 seconds. This is to account for the human when you press down, right? You are not like a computer, you don't press instantly. You press and hold down for a few milliseconds. So, this is to account for that fact. You can adjust this threshold. Let's say you press down much longer, you can increase to one second. But there is another problem. So, the code is still running there. I'll show you the task manager here. Task manager? You notice the CPU usage is about 30-35% The Raspberry Pi 3 is a quad-core processor. So, when it stays here 25% CPU usage, it actually means that one of the core is running at full 100%. This is actually very bad because you generate a lot of heat. So, why is this the result here? So, you will come back to this code here, right? You see that, same thing, it looks through this very quickly. So, the next thing, that's actually the solution which is the number 3. Open it. So, the only difference between this number 3 third version of the code and the previous one is this line here. So, every time the code looks through, it will sleep for 0.01 seconds. So, now, I'll show you the task manager again. You see the CPU usage is like valuable and the response time is still about the same. Say, I press a button about the same, no different from the previous one. So, you save a lot of your power and your microprocessor resources. So, this is something that you should take note of. It doesn't mean something work right. It doesn't mean you should actually use it. Just be careful of this. Okay, sorry? Okay, what you're talking about is interrupt. This function exists actually outside the scope of this talk. I just want to introduce something simple. For those people using Arduino, you may not have actually add this sleep there. Because the Arduino is so low power, it's fine to actually just let it run continuously. But for microprocessor, because it's a higher power device, it's advisable not to just let it run continuously. Better to add the delay there. Okay, so, this coming to the end. So, I just showed one of my projects developed with the Raspberry Pi. So, this is actually an internet radio streamer. So, for your FM radio stations like, for example, 91.395, so on, they actually have some internet radio streams. So, I created this project to full the streams. So, I just get full here. Okay, so here, 91.3, you can see here. Ya, there's a sound here. Then, I have a radio station changer here. Like, here's 92. Ya. And I change, and so on. Now it's in 32.4. I don't know what's in 32.3. Okay, so now it's yes, 93.3. Huh? Okay. So, actually the code that I used to do this also written in Python. Ya, it's actually very similar to the code we saw just now. Just of course, much more complicated lah. Okay. So, this is just to show you what is possible with Python code lah. Oh, Python kan't by default, inside. So, those are like binary. So, it's also analog input. Sorry, analog inputs? There's one you have to buy extra something called a shield lah. It's an attachment. It doesn't come by default. Okay, ya, some more next. So, Raspberry Pi does not keep time of power. So, for your computer, normal desktop computers are laptops, you take it for granted that when you shut down your computer, you turn it back on, the time is cap, right? But Raspberry Pi, right, there's no battery on it. You see, for most computers, it actually has a battery there to keep the time. But Raspberry Pi does not have. So, let's say you plug the power off, right? You turn on the power, you plug it back in, like 6 hours later, right? Your time will be off. So, the way to correct this is actually just connect into a network. The Raspberry Pi will automatically download the correct time from the internet. Then, do not connect your current HMB USB devices to it. I know if you see port there, you may be tempted to plug your phone there to charge, right? I do not recommend that, because there's actually a maximum current to it. So, here, you actually has a fuse, 2.5M fuse. So, if you actually blow this fuse, then ya, it's not good. So ya, just don't plug anything heavy to it. If you need to, then you use a USB, powered USB. Ya, that's awesome. Any questions? So, how do you compile the error? Sorry, how do I compile the error? Ya? Oh, what programming language you're talking about? I mean, for example, if you see compiler, if you're using GCC, right? Then, when you compile, then they'll tell you the errors at which line. Also, GCC, they have. I think, at least I think so. You run? I mean, I can just run GCC here. Ya, you have GCC here. So, let's do our version of this. 4x2. Ya. Any more questions? We run different OS on one hand. Is there any way to save? I think so. Ya, you can save to your SD card. When you say different OS, do you mean multi-board? Different like, we are going to respite or do like window stand. Just switch to SD card. Just switch to SD card. Ya. We can get one SD card for one of them. Ya, it's recommended that way. But will the settings be lost? What kind of settings are you talking about? No, it won't be lost. As long as you save into the root directory, the root directory actually is part of the SD card already. Ya, so any part of the SD card that you boot from, everything is on the SD card. Ya, it has no other storage. Unless you plug a thumb drive, that's different storage. Ya, question. Are there any other types of labels? Are there pressbaries? There is. There's no actual list. Actually, there's also actually notes. You won't do or not actually? It's a pie, right? Ya. There are other labels. Actually, okay. And you're wondering why is there a pie in the name there, right? Actually, it refers to Python. Because the rest of the pie was first ambition, they wanted to use Python as the main programming language. So that's why pie is in the name. I'm sure that exists ya. I mean, I can't say for sure, but it should exist. Given the large community. Ya. Minimum, I'll say 8 gigabytes. There's no... Maxome, I'm not sure. There could be a hard coded Maxome inside. I've not actually tried. I think just Google for it. So what's your foundation 16? I've tried 16, 32, 64. They work, but more than that, I'm not sure. Just depends on how they program. Oh. But I've actually tried that. Any more questions? Okay, the rest of the pie is not designed for such applications. But there's... I think some people they did... For example, the rest of the pie 1, was released 4 years ago, because I'm still using it today. So I figured it would be quite good. But I would not suggest use for industrial applications. In that case, you'll use the harder versions or the complete model. The complete model, I think, is designed for this kind of application rather than the full work. Oh, because while it's on, I stop it. There's no signal to tell it to stop. Turn off. It will only change state when I write something to the pin. Hang on. It's... Instead of full work, media centre work. So, when you install it, you hook it up to a TV. It becomes a full-blown media centre. So you can actually connect to a network. You can stream, Netflix. You can do some illegal stuff. Okay, so... That's what you might use It's very easy. It's very nice because it actually goes to the normal television remote. So a normal television remote will have an up-down network and an up-down network on your TV will be able to control the TV. So you can go to the file, select which movie or what it will actually do. I think you might want to do something who just want to get started and do something that is not too technical that might be something you might not want to try. Do you know which version for us to reply to this award? I've used the one that you think is actually a TV plus which is two versions and it will paste 1080p video to your phone. So you can go to TheRatRatPie.com And which one do you want? TheRatRatPie.com Can you go to where you see the... Where you see Grand piano one of it will say X, P and G. I think now it's played by another another name. Kodi, ya. Ya. So TheRatPie.com, you just do what they mean to you that means that you do this in your high-end and good-up. You don't need a keyboard or mouse to do this. Everything can be from your TV report. So... Hati-hati. And you just do an X, B and G ya? Ya. Ya. No additional hardware in there. If you want to buy a brand of a Raspberry Pi, you can install my camera so you can make it central. Yes, you can. There are a lot of things. Say if I want to configure a Raspberry Pi say as a CCTV now set up. There's actually a camera connector. It's called a CSI connector inside. So you can just buy the official module. I think it cost more $35. Then of course you need to write some code to access the camera video stream. So you can just write what you say. And Google Raspberry Pi CCTV there's somebody who will play the game and you want to try copy what he did. And you can let the Python code and everything be there for you. Just copy what you want to do. You can just change to you can just change to what you want to do. What you want to do. Okay, nothing else? Ya. So just a word of question. You remember to shut down properly. So a Raspberry Pi is an hour computer. I know for Arduino people you can just put the power. But Raspberry Pi cannot. So just shut down.