1
00:00:00,720 --> 00:00:05,940
Hi and welcome to a new section in this course, this section is dedicated to this place.

2
00:00:05,970 --> 00:00:14,130
I'm going to show you how to use a series of displays such as this to buy 16 LCD display.

3
00:00:14,370 --> 00:00:15,150
Very common.

4
00:00:15,490 --> 00:00:17,850
I've got a graphics display like these, actually.

5
00:00:17,860 --> 00:00:26,670
I've got a variety of graphics displays to show you, plus displays such as this eight by eight Matrix

6
00:00:26,670 --> 00:00:27,300
and so on.

7
00:00:27,780 --> 00:00:34,020
So in this first lecture and the one that follows, I'm going to show you how to use the very common

8
00:00:34,320 --> 00:00:44,580
two by 16 LCD display, which contains a backpack like this one, which allows us to use it in cereal

9
00:00:44,580 --> 00:00:50,940
ICQ, which see mode instead of its native parallel mode via those pins here.

10
00:00:51,600 --> 00:00:59,010
So in my case, I have sold the backpack onto the display itself, and that makes it easier to use in

11
00:00:59,010 --> 00:01:02,160
one piece as if there is one single module.

12
00:01:02,700 --> 00:01:11,100
Now this module here just said contains the F eight five seven four integrated circuit, which makes

13
00:01:11,100 --> 00:01:20,010
it possible to convert the displays native parallel interface into in a square C interface.

14
00:01:20,520 --> 00:01:29,000
So I've got the wiring here set up and in this lecture I'm going to show you how to use the USB 32 hardware

15
00:01:29,010 --> 00:01:36,060
I see in the face and in the next lecture will do the same thing, but will use a software interface

16
00:01:36,060 --> 00:01:46,170
which allows us to use squishier with any compatible chips on the 32 instead of being confined to the

17
00:01:46,170 --> 00:01:46,870
hardware.

18
00:01:47,040 --> 00:01:48,030
I could see.

19
00:01:50,370 --> 00:01:56,670
So the wiring in this first example is very simple for ground.

20
00:01:58,160 --> 00:02:05,330
And this is see, I'm using the ground pens on the ground rail on my breadboard, and I'm using the

21
00:02:05,330 --> 00:02:15,020
five volt pin on the speaker to say I'm just using this long red wire to take five votes into the FCC

22
00:02:15,050 --> 00:02:22,210
on the backpack for state and SEAL because I'm using the E.S.P 32 hardware.

23
00:02:22,250 --> 00:02:25,910
I could see this, too, had I switched to interfaces.

24
00:02:25,910 --> 00:02:28,360
I'm using the one with ID zero.

25
00:02:28,370 --> 00:02:30,800
I'm going to talk a little bit more about this in a moment.

26
00:02:31,160 --> 00:02:39,530
I'm using pins 19 for a.D.A and 18 for a ACL.

27
00:02:41,860 --> 00:02:52,270
All right, now let's have a look at the software side, so the software side depends on two libraries

28
00:02:52,270 --> 00:02:53,110
that you need to download.

29
00:02:53,110 --> 00:03:02,500
The first one is this one here, LCD on this call API P y, which contains some of the basics of the

30
00:03:02,500 --> 00:03:04,620
functionality for the LCD display.

31
00:03:05,230 --> 00:03:14,200
And then on top of that, we use the SBA to six six call I squared see on this LCD, which basically

32
00:03:14,200 --> 00:03:20,980
builds top of the OCD and this score API with functionality that is specifically compatible with the

33
00:03:20,980 --> 00:03:22,600
SBA eight to six six.

34
00:03:22,600 --> 00:03:26,040
And it's an extension with our E.S.P 32.

35
00:03:26,770 --> 00:03:29,920
So you need to get those libraries.

36
00:03:29,920 --> 00:03:35,360
And I have the locations from where you can download them from here.

37
00:03:36,250 --> 00:03:42,040
So these are the required modules that you need to download and install.

38
00:03:43,620 --> 00:03:48,290
Apart from that, I'm using a few other bits and pieces here, for example, you need to import the

39
00:03:48,330 --> 00:03:57,090
pins module and sleep, put a bit of delay their motor using the string formatter or the string formatting

40
00:03:57,090 --> 00:04:02,820
operator, the percentage string, as you can see, percentage the string here to allow me to display

41
00:04:03,300 --> 00:04:04,110
this number.

42
00:04:04,120 --> 00:04:06,150
And it's increasing every second.

43
00:04:06,510 --> 00:04:10,010
So I use the string formatter for that.

44
00:04:10,020 --> 00:04:16,080
If you're not familiar with how to use it and have a look at this reference documentation.

45
00:04:17,130 --> 00:04:22,200
Let's talk a little bit about Isaac we see on the especially to using micro python.

46
00:04:22,560 --> 00:04:28,770
We've got a link for that here, specifically for the hardware interface that we are using.

47
00:04:29,400 --> 00:04:32,490
This example, it would take you to this page here.

48
00:04:32,790 --> 00:04:39,240
We are now looking at a quick reference for the E.S.P 32 in the macro Python website, and that is the

49
00:04:39,240 --> 00:04:41,100
hardware squid seabass.

50
00:04:41,700 --> 00:04:47,460
And you can see that the is 32 gives us two lots of atheel.

51
00:04:47,510 --> 00:04:51,240
Is the HP use that implement the hardware I could see.

52
00:04:51,600 --> 00:05:00,740
And in this example we are using I d zero, which means that the seal is on Jhpiego 18 and is the Orangeville

53
00:05:00,750 --> 00:05:01,440
98.

54
00:05:01,920 --> 00:05:09,870
And to create an ice quazi object on the hardware, I would say interface or you've got to do is to

55
00:05:09,870 --> 00:05:14,180
tell Macra Python which ID it is that you want to use.

56
00:05:14,180 --> 00:05:15,240
So that's all there is to it.

57
00:05:15,750 --> 00:05:23,970
There's a single no single Idei as a parameter to the ice quartzite constructor will give us the ice

58
00:05:23,970 --> 00:05:26,850
quazi object and that's what we do.

59
00:05:29,160 --> 00:05:29,810
Right here.

60
00:05:31,560 --> 00:05:37,860
After that, we take that Asgard, it's to see object becomes the first parameter in the constructor

61
00:05:37,860 --> 00:05:41,720
for the LCD object in case it LCD.

62
00:05:42,690 --> 00:05:49,290
The name that I've given to the module, you can see I'm importing the ISP a 266.

63
00:05:49,290 --> 00:05:57,000
And this call I to see an LCD and I'm renaming it to this, which is a little shorter and easier to

64
00:05:57,000 --> 00:05:58,470
use on words.

65
00:05:58,470 --> 00:06:01,530
I'm using that as the name of the module.

66
00:06:01,890 --> 00:06:09,690
I'm calling the constructor for the LCD, passing the object for the ice quazi that we created in line

67
00:06:09,690 --> 00:06:13,410
for the two and also grabbing the default.

68
00:06:13,560 --> 00:06:15,180
I could see a address.

69
00:06:15,540 --> 00:06:22,500
I could have created a local variable with her address and just use this in here.

70
00:06:23,900 --> 00:06:26,660
But I was taking a look at the.

71
00:06:28,760 --> 00:06:35,150
Librarian, you can see that that address is already included in the in the library module.

72
00:06:35,600 --> 00:06:43,370
So I was just able to get this constant and edit into my constructor like that.

73
00:06:44,750 --> 00:06:48,470
And that meant that I didn't really need to have an additional line of code here.

74
00:06:49,760 --> 00:06:51,120
I'll keep it here just for reference.

75
00:06:51,130 --> 00:06:56,900
So after that, we've got the number of rose in the third parameter.

76
00:06:56,900 --> 00:06:59,960
In the fourth parameter is the number of columns.

77
00:07:00,290 --> 00:07:08,990
So if you have a different sized LCD display, then you can just change those numbers to match the size

78
00:07:08,990 --> 00:07:10,210
of your particular box.

79
00:07:10,220 --> 00:07:13,100
Could see this could have, for example, three rows.

80
00:07:14,450 --> 00:07:19,780
Once we're done with that, we've got the object to go and clear everything in the display.

81
00:07:19,790 --> 00:07:27,180
So prepare the display to write something on it, clearing the and creating the counter variable here

82
00:07:27,180 --> 00:07:31,060
and giving it an initial value zero and will go into an infinite loop.

83
00:07:31,880 --> 00:07:35,790
I can set the cursor on the Ill-suited to a particular location.

84
00:07:35,810 --> 00:07:40,220
So this is a move to function, which you can see here.

85
00:07:43,340 --> 00:07:48,440
OK, so starting this won't you, to API look through it in here.

86
00:07:49,610 --> 00:07:50,110
All right.

87
00:07:50,110 --> 00:07:51,170
So here it is.

88
00:07:51,770 --> 00:07:58,430
So you can see that first goes the X coordinate and then the Y coordinate in the move to function.

89
00:07:59,720 --> 00:08:01,720
So you've got X Y zero zero.

90
00:08:01,730 --> 00:08:05,240
So it will go up to the very first block.

91
00:08:05,480 --> 00:08:07,070
Can barely see it, but there's a block.

92
00:08:07,070 --> 00:08:07,310
Right.

93
00:08:07,340 --> 00:08:17,590
And then number two and will use they've put is the function to print out this text, this string of

94
00:08:17,600 --> 00:08:20,660
text then will move to the next line down.

95
00:08:20,660 --> 00:08:31,430
So X is zero and then Y one shot will go down here and print out this string of counter followed by

96
00:08:31,850 --> 00:08:40,310
Percentage De, which is the string modifier for a digit, they say percentage sign here.

97
00:08:40,310 --> 00:08:46,760
And then in parentheses I'm printing out the variable value counter, which I have just updated by one

98
00:08:46,760 --> 00:08:53,390
each time we're going through the loop and we'll wait for one second if you sleep one, which I then

99
00:08:53,390 --> 00:08:55,760
put it up here, it takes Sinisa.

100
00:08:55,760 --> 00:09:00,080
Now, given the number of seconds that I want, you wait here and it goes back and repeats the loop

101
00:09:01,370 --> 00:09:02,780
and that's about it that you can see.

102
00:09:02,780 --> 00:09:11,540
It's fairly easy to use your LCD display using the square to see hardware interface to print changing

103
00:09:11,540 --> 00:09:13,130
text or static text.

104
00:09:13,790 --> 00:09:21,080
Let's jump into the next lecture where I'll show you how to use the software I took with C capability

105
00:09:21,080 --> 00:09:27,520
that comes with macro python, which is useful if you just don't have access to the hardware which could

106
00:09:27,530 --> 00:09:28,710
see interface for some.
