1 00:00:01,050 --> 00:00:07,670 Hello and we'll come to this in your lesson today we will talk about respited bike configuration. 2 00:00:07,670 --> 00:00:13,510 Let's start by turn and go in the right spirit by and ORBIN by the new window if you will. 3 00:00:13,710 --> 00:00:20,750 Yet talk about trust barabar you can check out course or respited by step by step guide to learn how 4 00:00:20,750 --> 00:00:26,220 to turn it on how to use it and how to write your own code inside it. 5 00:00:26,240 --> 00:00:30,920 You won't need to write the following code in the new window and save it saving it to your desktop is 6 00:00:30,920 --> 00:00:33,220 a good place so you don't lose it. 7 00:00:33,230 --> 00:00:35,290 This is the code. 8 00:00:35,380 --> 00:00:42,700 Let's start by explaining this very simple rasberry by code so that you will know what you are writing. 9 00:00:42,760 --> 00:00:47,670 First we are importing serial communication and time libraries. 10 00:00:47,680 --> 00:00:57,400 We are also importing Arbi Berberis input output library which is for us buried by Ben's input and output 11 00:00:58,120 --> 00:00:59,500 Berberis input output. 12 00:00:59,500 --> 00:01:02,510 This is what this stands for. 13 00:01:02,520 --> 00:01:04,700 These are for importing. 14 00:01:04,890 --> 00:01:11,830 Next we are defining the serial communication so it equals cereal. 15 00:01:11,830 --> 00:01:13,140 Cereal. 16 00:01:13,150 --> 00:01:19,200 This is the location for the serial communication device which is in this case the Arduino. 17 00:01:19,200 --> 00:01:25,930 We will change this in the few coming lessons but for now you need to understand this line and this 18 00:01:25,930 --> 00:01:29,090 is the baud rate 9600. 19 00:01:29,380 --> 00:01:37,130 Changing is the number which is here as found from us Dev D t y AC. 20 00:01:37,240 --> 00:01:44,170 If we ran this command we will see a list of the serial communication device after connecting the dots 21 00:01:44,250 --> 00:01:44,920 Barry. 22 00:01:45,200 --> 00:01:51,130 We all find something like this with an iron bar after it. 23 00:01:51,160 --> 00:01:55,900 We will need to change that number with the new one on bar after connected valgrind. 24 00:01:55,940 --> 00:01:59,700 We will talk about this again in the few coming lessons. 25 00:01:59,790 --> 00:02:02,540 See the quadrate is 9600. 26 00:02:02,560 --> 00:02:08,710 This is for sitting at about the rate of the serial communication between the Arduino and rasberry by 27 00:02:09,520 --> 00:02:14,630 next we have the diff Blinkx been. 28 00:02:14,660 --> 00:02:23,270 This is for blinking LED Now John Berberis and would opt out booked for Ben which is he is is just a 29 00:02:23,270 --> 00:02:32,450 bit and would output high so it will send 5 volts or 1 logic to this been so that it can blink it then 30 00:02:32,510 --> 00:02:34,650 it will wait for one second. 31 00:02:35,060 --> 00:02:37,350 Then it will send a low which is zero. 32 00:02:37,400 --> 00:02:39,380 Then it will wait for one second. 33 00:02:39,650 --> 00:02:42,510 After that it will tell again to hear. 34 00:02:42,570 --> 00:02:47,570 If so this is like a veteran beat repeats itself. 35 00:02:47,840 --> 00:02:51,850 That means returning to the point of the cord. 36 00:02:52,220 --> 00:03:01,010 When this function was called after that we have general purpose and output mode for connecting the 37 00:03:01,010 --> 00:03:12,030 board and it was an output setup for number 11 to which we connected the LED we defined this been as 38 00:03:12,040 --> 00:03:12,330 out. 39 00:03:12,340 --> 00:03:19,010 But John Berberis the book out so that it can be considered as output. 40 00:03:19,100 --> 00:03:30,580 Now while true while true we needed to read the serial line we'd see which is Sierre the tree line. 41 00:03:30,590 --> 00:03:32,480 It will read the incoming data. 42 00:03:32,520 --> 00:03:39,720 Was in the area of communication between outman hospital buy and store these values or this data to 43 00:03:39,730 --> 00:03:45,210 the value of valuable read separate this research will be Brinton's. 44 00:03:45,230 --> 00:03:54,020 But in the lead set in the window inside rasberry by now if the value inside read search equals Hello 45 00:03:54,020 --> 00:03:59,680 from Arduino and this mark it will blink. 46 00:03:59,780 --> 00:04:06,160 Number 11 the number 11 and blank will go here to execute this. 47 00:04:06,170 --> 00:04:07,320 Then returning it. 48 00:04:08,150 --> 00:04:13,410 So as you can see blank is a function inside bifold language. 49 00:04:13,430 --> 00:04:18,000 This was quick explanation of the rasberry bytecode. 50 00:04:18,100 --> 00:04:25,190 Let's it these for importing the library's serial time and end up with libraries. 51 00:04:25,190 --> 00:04:31,150 These are for these two lines for defining set and communication protocol and defining which you us 52 00:04:31,160 --> 00:04:41,640 be serial communication been is the one that Albinus connected to this link to the that. 53 00:04:41,690 --> 00:04:50,060 These lines are a function called blink when we define that ban it will use it to blink that Ben these 54 00:04:50,060 --> 00:04:57,230 two lines for defining the number 11 as output for defining the board. 55 00:04:57,230 --> 00:05:00,890 Now this one will keep repeating itself while through. 56 00:05:01,250 --> 00:05:08,030 It will read the secret communication data that we send to the rasberry it will print it. 57 00:05:08,090 --> 00:05:12,380 Then it will ask if it equals this line it will blink. 58 00:05:12,410 --> 00:05:19,970 Number 11 Blinkx means call the function call the blank and execute its command on bin number 11 so 59 00:05:19,970 --> 00:05:21,050 it will go here. 60 00:05:21,380 --> 00:05:29,220 It will start as high then low which means that then it will turn on and off then it will have to wait 61 00:05:29,240 --> 00:05:31,610 for fear of instruction. 62 00:05:31,670 --> 00:05:36,410 That's it for the last bit of bytecode that spared my configuration. 63 00:05:36,440 --> 00:05:44,660 I know that I explained the code very fast but since it's really simple and we don't want to waste time 64 00:05:44,720 --> 00:05:46,150 on this code. 65 00:05:46,610 --> 00:05:49,490 I did that for this lesson. 66 00:05:49,550 --> 00:05:53,400 If you have any question please ask in the queue on their board. 67 00:05:53,810 --> 00:05:56,690 If anything is unclear please ask. 68 00:05:56,690 --> 00:06:01,290 We are here to help you have learning this is educational engineering.