1
00:00:00,600 --> 00:00:01,110
Hello.

2
00:00:01,140 --> 00:00:02,300
Welcome back.

3
00:00:02,310 --> 00:00:05,370
So in this lesson we should begin deploying our more.

4
00:00:06,240 --> 00:00:13,730
So what we're going to do is we going to let a wah wah wah e I give us two predictions.

5
00:00:13,740 --> 00:00:17,280
It's first choice and it's second choice.

6
00:00:17,280 --> 00:00:23,190
And basically what we're going to do is we're going to check the probabilities that the um the A.I.

7
00:00:23,280 --> 00:00:29,430
is going to produce and we're going to select the first two highest probabilities and we're gonna make

8
00:00:29,430 --> 00:00:37,050
that prediction number one and Prediction Number two because sometimes the um the number three and number

9
00:00:37,200 --> 00:00:38,430
eight looks similar.

10
00:00:38,460 --> 00:00:42,190
So we want to see what the E I can when you write 3-D.

11
00:00:42,360 --> 00:00:49,120
I can give you less a choice number one 3 and choice number two US eight because of the similarities

12
00:00:49,170 --> 00:00:51,710
in the I mean the two numbers.

13
00:00:51,780 --> 00:00:59,100
So um one other thing we're going to do for our game is we're going to use a push button to reset the

14
00:00:59,100 --> 00:00:59,510
game.

15
00:00:59,540 --> 00:01:06,390
So whenever you whenever the A.I. does its prediction the push button can be pressed to start over.

16
00:01:06,960 --> 00:01:14,940
So if you have no other that you can initialize the push button from the um from the PSP what is the

17
00:01:14,980 --> 00:01:16,080
result.

18
00:01:16,920 --> 00:01:21,500
There is a function in the PSP broad support package for initialize it.

19
00:01:21,660 --> 00:01:26,760
It simply BSP underscore P4 push button and then it.

20
00:01:27,930 --> 00:01:37,930
And over here you simply have to pass to argument button key and then zero as its initial state.

21
00:01:37,980 --> 00:01:39,920
Okay.

22
00:01:40,280 --> 00:01:40,720
Right.

23
00:01:41,010 --> 00:01:49,800
So that the um after doing that we are going to create a structure to hold the um um the resort form

24
00:01:49,800 --> 00:01:51,810
out a structure screen.

25
00:01:51,820 --> 00:01:52,800
You have two members.

26
00:01:52,800 --> 00:01:59,020
One is going to be the probability and then another one is gonna be the label which is the number which

27
00:01:59,040 --> 00:02:07,540
is produce that the 0 1 2 3 4 5 2 was at a resort essentially.

28
00:02:07,590 --> 00:02:17,100
So I'm gonna come up here and I'm gonna create a structure C struct C struct over here and then I'll

29
00:02:17,100 --> 00:02:20,160
call this prediction underscore

30
00:02:23,390 --> 00:02:24,600
underscore probability

31
00:02:28,720 --> 00:02:36,030
and then open and close over here the first member is going to be of type A float and these data types

32
00:02:36,480 --> 00:02:41,620
are defined um these are defined in Iowa a library.

33
00:02:41,670 --> 00:02:45,880
So this is just a float but a float.

34
00:02:45,880 --> 00:02:50,730
It s been renamed and the second type is gonna be a U int 8.

35
00:02:51,330 --> 00:02:56,340
And we can use the data type of it into a library which we can see.

36
00:02:56,360 --> 00:03:01,490
E I underscore you 8 4 on signed 8 bits integer.

37
00:03:01,590 --> 00:03:05,550
We're gonna call this label right.

38
00:03:05,550 --> 00:03:12,860
Once that is done I'm going to come here and see when I type if this to shorten its name so I'll say

39
00:03:12,970 --> 00:03:21,420
typedef I've copied it paste it over here and then we're gonna call this print prop for prediction probability

40
00:03:21,420 --> 00:03:26,130
type pred prop type that such a name.

41
00:03:26,130 --> 00:03:28,800
Okay so we've got this this structure.

42
00:03:28,860 --> 00:03:35,080
Yeah it's great to have our you know the resort basically.

43
00:03:35,300 --> 00:03:35,730
Right.

44
00:03:36,870 --> 00:03:47,220
And once this is done we can um we can we can create some data types we've got gotta create a buffer

45
00:03:47,250 --> 00:03:54,140
to hold the input as well as another buffer to hold to the output.

46
00:03:54,990 --> 00:03:56,880
So I'm gonna create an input buffer

47
00:03:59,630 --> 00:04:01,360
um let's see.

48
00:04:01,360 --> 00:04:03,490
I'm gonna I'm not gonna make this global.

49
00:04:03,510 --> 00:04:05,570
I'm gonna keep in the main function.

50
00:04:05,830 --> 00:04:18,160
So come over here and then I'm going to see a I underscore float I call this an end for neural network

51
00:04:19,390 --> 00:04:23,700
input data and there's just gonna be a two by two.

52
00:04:23,870 --> 00:04:33,460
It's first gonna take a number of rows which is the N N number of rows is the is the same as the image

53
00:04:33,460 --> 00:04:40,890
height so see n n underscore input image height.

54
00:04:40,930 --> 00:04:47,470
We've created a symbolic name for this sentence already and then number of columns is going to be the

55
00:04:47,470 --> 00:04:52,420
with so n n underscore input image with like this.

56
00:04:54,550 --> 00:04:55,380
Okay.

57
00:04:55,390 --> 00:05:02,330
And um I'm gonna create I'm gonna create an instance of this structure to hold a resort.

58
00:05:03,550 --> 00:05:13,180
I'm gonna copy this right prop type I'm gonna come over here and then I'm gonna have first prediction

59
00:05:13,290 --> 00:05:14,710
1 s t print

60
00:05:20,270 --> 00:05:24,240
and then I'm gonna have second prediction.

61
00:05:24,420 --> 00:05:26,390
Let's go so I can print like this.

62
00:05:27,710 --> 00:05:28,340
Okay.

63
00:05:29,450 --> 00:05:35,840
Perhaps you can rename it to a better look in variable and then I'm going to initialize the probabilities

64
00:05:35,840 --> 00:05:36,640
to 0.

65
00:05:36,740 --> 00:05:38,300
So say first prediction

66
00:05:41,070 --> 00:05:47,690
first on the score parade door to prop 8 cause.

67
00:05:47,730 --> 00:05:48,790
Second prediction

68
00:05:53,330 --> 00:05:57,700
I can parade to probe cause probably some member into.

69
00:05:58,260 --> 00:06:02,790
Because your point is you're okay.

70
00:06:02,930 --> 00:06:03,380
Yes.

71
00:06:03,830 --> 00:06:04,210
Yeah.

72
00:06:04,320 --> 00:06:10,860
Probably some member and the next thing I'm gonna do is I'm going to create a character buffer so that

73
00:06:10,860 --> 00:06:16,590
we can send a predictions to our serial ports as well so that we'll be able to view it.

74
00:06:16,710 --> 00:06:18,180
I'm gonna come over here

75
00:06:20,910 --> 00:06:22,080
and see a car.

76
00:06:22,440 --> 00:06:24,030
Uh uh.

77
00:06:24,660 --> 00:06:25,320
Call this

78
00:06:30,850 --> 00:06:39,800
first period string SDR and we could start with a size of ten and then we'll have second

79
00:06:43,080 --> 00:06:44,290
the size of 10 as well.

80
00:06:46,540 --> 00:06:47,700
Okay.

81
00:06:47,950 --> 00:06:53,920
Once that is done I'm gonna have a buffer for the um for the output.

82
00:06:53,920 --> 00:07:01,090
Remember the output is going to is going gonna be um the size of the output buffer should be equal to

83
00:07:01,090 --> 00:07:05,200
the size of the number of labels or the number of classes we have.

84
00:07:05,200 --> 00:07:08,050
And we have 0 1 2 3 4 5 6 7 8 9.

85
00:07:08,050 --> 00:07:14,830
So those are 10 classes for Eddie created a symbolic name to hold that number of classes exist over

86
00:07:14,830 --> 00:07:15,980
here.

87
00:07:16,760 --> 00:07:28,840
So come over here and say I float on this go float and then I'll create a buffer called an end output

88
00:07:30,220 --> 00:07:42,120
underscored data to mean output buffer and the size of this is going to be number of classes like this.

89
00:07:42,790 --> 00:07:43,390
Right.

90
00:07:45,640 --> 00:07:49,970
So yeah um we've created these next.

91
00:07:50,050 --> 00:07:59,380
Well we have to do is we have to grab what we draw on the on the LCD screen into a wire into what input

92
00:08:00,000 --> 00:08:00,390
buffer.

93
00:08:00,400 --> 00:08:06,120
Here we have to be able to grab what it what I use user draws on the screen into the input buffer.

94
00:08:06,610 --> 00:08:07,630
So we do down next.

95
00:08:07,660 --> 00:08:12,370
I'm gonna come over here to the part where we do what we're drawing.

96
00:08:12,370 --> 00:08:22,540
So we said this but here this bit's over here's what reproduces the drawing this bit here gives us that

97
00:08:22,540 --> 00:08:23,080
drawing.

98
00:08:23,740 --> 00:08:29,200
So over here we're simply using a function that reproduces Detroit over here is the scaled down version

99
00:08:29,350 --> 00:08:32,510
of the type that our neural network needs.

100
00:08:33,150 --> 00:08:39,310
The 28 by 28 version is held in small x small access more y.

101
00:08:39,310 --> 00:08:44,600
And we've been able to shift and redraw that in our small square here.

102
00:08:44,710 --> 00:08:51,140
So we're going to use the same method that we used to draw the pixels to arrange the pixels in Iowa

103
00:08:52,030 --> 00:08:54,250
into our data buffer.

104
00:08:54,610 --> 00:08:56,420
And that's what I mean.

105
00:08:56,440 --> 00:09:06,040
So to collect the pixels when I call a what input buffer here it's called and an input data come over

106
00:09:06,040 --> 00:09:17,860
here and then 0 2 x plus 1 index x plus 1 and by X plus 1 I mean small x plus 1 and then small y plus

107
00:09:17,860 --> 00:09:25,010
1 and then I'm going to pass because we are dealing with floats I cannot pass to Phi Phi so I'm going

108
00:09:25,010 --> 00:09:32,140
to pass the pixel set which I created a symbolic name for over here I'm gonna pass that over here like

109
00:09:32,140 --> 00:09:38,830
this and then all I'm gonna do is copy and paste this and just change the index next I'm gonna do X

110
00:09:38,830 --> 00:09:46,450
minus one Y minus one just following the same sequence or just following the same arrangement we used

111
00:09:46,450 --> 00:09:58,450
for drawing the pixels up here and after that I'm gonna do a whole ball for got X minus one here we've

112
00:09:58,540 --> 00:10:02,680
got X plus one I'm gonna do X plus 1 is simply y over here

113
00:10:05,830 --> 00:10:15,130
then for the fourth row I'm gonna do X minus 1 and Y X minus one over here is simply y

114
00:10:19,660 --> 00:10:28,640
and then after that I'm going to do X X plus one X Y plus one come over here X over here.

115
00:10:28,650 --> 00:10:32,260
No y plus 1 and then I'm gonna do X Y minus 1

116
00:10:34,810 --> 00:10:48,160
Is this over here we have X and then we have Y minus 1 right now I'm gonna do X plus 1 y minus one x

117
00:10:48,160 --> 00:10:51,090
plus 1 y minus 1.

118
00:10:51,760 --> 00:10:57,840
Now I'm gonna do X minus one Y plus 1 x minus 1

119
00:11:00,880 --> 00:11:03,870
Um do we have the x minus one Y plus 1.

120
00:11:04,930 --> 00:11:05,240
Okay.

121
00:11:05,260 --> 00:11:09,300
We don't have it so X minus 1 y plus 1.

122
00:11:09,820 --> 00:11:15,110
And then finally I'm gonna do x y you're right.

123
00:11:15,130 --> 00:11:17,590
So they should be able to give us all the pixels.

124
00:11:18,220 --> 00:11:20,670
Okay.

125
00:11:22,030 --> 00:11:29,470
So after this we would have the the input the input buffer populate it.

126
00:11:29,710 --> 00:11:38,470
And what we're going to do is we're going to print the um we're gonna print the position off your finger

127
00:11:38,500 --> 00:11:41,920
or your stylus or your pointer.

128
00:11:42,150 --> 00:11:47,530
Not serial port we're going to print that in 0 0 1 and so I should say so say x percentage to you over

129
00:11:47,530 --> 00:11:50,320
here and then Y

130
00:11:52,950 --> 00:11:55,020
percentage T.

131
00:11:55,750 --> 00:12:09,210
And then I'm simply gonna pass you I on this score state DOT X and then you uh on that score state the

132
00:12:09,220 --> 00:12:10,300
Y over here.

133
00:12:10,300 --> 00:12:14,270
I'm gonna put a carriage return a new line here.

134
00:12:14,560 --> 00:12:24,730
Okay so this was gonna happen if if you are drawing in the um in Detroit area we're going to first reproduce

135
00:12:25,240 --> 00:12:26,530
exactly what you are drawing.

136
00:12:26,530 --> 00:12:32,830
Scale it into a train eight by twenty eight and put it in the twenty eight by twenty eight square and

137
00:12:32,830 --> 00:12:40,520
take that twenty eight by twenty eight and put it in a what neural network input data buffer like this.

138
00:12:40,540 --> 00:12:42,610
So this was going to happen.

139
00:12:42,610 --> 00:12:50,950
However if you are at the other side which is this part the ball the reset if you are the in the area

140
00:12:51,010 --> 00:12:53,160
with regards to the reset button.

141
00:12:53,160 --> 00:12:57,730
In other words when you press the reset button we want to clean the screen.

142
00:12:57,730 --> 00:13:08,050
We want to reset the control panel or reset control panel reset this sentence or this function if it

143
00:13:08,110 --> 00:13:14,840
should be you I reset cos it's reset the entire screen not just the control panel.

144
00:13:14,860 --> 00:13:24,700
So I'm gonna change this plus when I refactor roots I'll come up here and um to refactor you simply

145
00:13:24,700 --> 00:13:31,830
highlight this right click code to refactor rename and I'll call this user

146
00:13:34,380 --> 00:13:39,210
interface on this code reset and then hit enter.

147
00:13:39,240 --> 00:13:42,630
It should be able to change the name at all instances.

148
00:13:43,440 --> 00:13:46,470
Okay so it's changed a name here.

149
00:13:47,670 --> 00:13:50,030
Okay let's change the name here.

150
00:13:50,340 --> 00:13:50,570
Okay.

151
00:13:50,580 --> 00:13:53,670
So now our control panel said this quote you say interface reset.

152
00:13:54,450 --> 00:13:56,630
So apart from resetting now you say interface.

153
00:13:56,640 --> 00:14:05,850
What we also want to do is we want to be able to reset the entire game and then we have to create a

154
00:14:05,850 --> 00:14:11,490
function to just sort of do that for us right.

155
00:14:11,570 --> 00:14:18,540
And to reset we simply want to set let's say the labels and the prediction is back to zero so that they

156
00:14:18,540 --> 00:14:22,130
can be repopulated to run your resource.

157
00:14:22,200 --> 00:14:31,560
So I'm gonna create a function down here I call this function like void M next game.

158
00:14:31,560 --> 00:14:32,100
Reset

159
00:14:35,070 --> 00:14:40,920
like this and the first comment is going to be the input data.

160
00:14:42,240 --> 00:14:45,940
Oh the uh pointer to the input data buffer.

161
00:14:46,370 --> 00:14:48,660
I see a float stars the

162
00:14:54,300 --> 00:14:55,670
data over here.

163
00:14:55,740 --> 00:15:07,290
And then when I say print prop type prediction probability type a pointer to that type I call this first

164
00:15:07,290 --> 00:15:15,120
prediction course we're going to our first print and second print first print like this.

165
00:15:15,130 --> 00:15:16,140
Then we're going to have

166
00:15:19,360 --> 00:15:20,940
print prop type again

167
00:15:25,160 --> 00:15:27,580
second prediction like this.

168
00:15:28,100 --> 00:15:30,560
Right.

169
00:15:31,190 --> 00:15:38,680
And what we want to do is set the um sets the input buffer to zero.

170
00:15:38,690 --> 00:15:41,560
We going to use memes sets to do this.

171
00:15:41,780 --> 00:15:43,000
I'm gonna see a memo set

172
00:15:47,090 --> 00:15:55,340
and then I'm going to see in data that zero point zero here and then we pass size off

173
00:15:59,080 --> 00:16:05,890
in data like zero like this.

174
00:16:05,990 --> 00:16:16,170
Multiply by the the input image with an input image height which we've got.

175
00:16:16,170 --> 00:16:25,980
Symbolic names represent and already input image height API just paste this and then rename this

176
00:16:35,200 --> 00:16:35,830
like this.

177
00:16:43,220 --> 00:16:45,240
All right.

178
00:16:45,610 --> 00:16:49,570
So I've got a pool close the brackets over here.

179
00:16:49,630 --> 00:16:59,320
Dennis call on over here once we've set once we've said the entire input buffer to zero zero point zero.

180
00:16:59,530 --> 00:17:03,210
We've got to reset the label and disarm the probability values.

181
00:17:03,420 --> 00:17:10,350
So come down here and see the second prediction.

182
00:17:11,290 --> 00:17:16,350
Second prayed that we're using a pointer here.

183
00:17:16,360 --> 00:17:20,290
So we have to use the operator label

184
00:17:23,110 --> 00:17:23,590
because

185
00:17:28,700 --> 00:17:30,070
the second prediction

186
00:17:32,760 --> 00:17:37,350
probability and of course

187
00:17:39,600 --> 00:17:50,650
the first prediction label it calls first prediction

188
00:17:53,400 --> 00:18:01,220
probability all of this because you have points you like this.

189
00:18:01,380 --> 00:18:05,800
So this will initialize or reset everything for us as well.

190
00:18:06,060 --> 00:18:07,900
Okay.

191
00:18:08,490 --> 00:18:13,250
So I'm going to take the prototype of this put out a top as well.

192
00:18:14,570 --> 00:18:19,400
I'll put it over here and we're going to call this function in a way.

193
00:18:20,050 --> 00:18:27,920
You raise a button such that whenever one presses the reset button to the entire game is reset as well

194
00:18:31,710 --> 00:18:33,850
okay.

195
00:18:34,350 --> 00:18:44,400
So I'm gonna go to the um the while one loop over here we said when you press t you raise we reset the

196
00:18:44,400 --> 00:18:48,160
U.S. to face but now we want to reset the game as well.

197
00:18:48,740 --> 00:18:55,720
So come over here and then the first argument is going to be addressed to inputs buffer.

198
00:18:56,800 --> 00:19:04,490
So out take the numbers on sine and then copy the name and input data.

199
00:19:04,710 --> 00:19:12,030
The second argument is going to be the address to the um to the first prediction type we're going to

200
00:19:12,030 --> 00:19:16,110
have a local variable called first prediction where we're going to store the first prediction.

201
00:19:17,490 --> 00:19:27,540
So I'll call this 0 0 past the M percent to indicate it s it s address and then the third argument of

202
00:19:27,540 --> 00:19:29,820
course is the second prediction.

203
00:19:29,820 --> 00:19:34,080
So like this this will sort of resets the game for us.

204
00:19:35,400 --> 00:19:38,290
Okay.

205
00:19:38,400 --> 00:19:39,630
Right.

206
00:19:39,720 --> 00:19:41,180
So that is done.

207
00:19:41,850 --> 00:19:48,120
So the next thing we want to do for our API application is when we press that push button which is the

208
00:19:48,120 --> 00:19:51,990
blue button we want to run to you phrase we want it in French.

209
00:19:52,000 --> 00:19:52,370
Okay.

210
00:19:52,380 --> 00:19:59,100
When we press the push button and we want the results to be produce on the screen when we press the

211
00:19:59,100 --> 00:20:06,090
push button the um the data should be taken put it through our new uh put through on your network and

212
00:20:06,090 --> 00:20:10,890
then to resort to produced the results taken and then printed on the screen.

213
00:20:10,890 --> 00:20:17,670
So we've got to implement that here and we've got to implement it over here in the same place in our

214
00:20:17,670 --> 00:20:19,620
while one loop.

215
00:20:19,620 --> 00:20:27,990
So while one starts by checking by trying to detect whether um the screen has been touched after we've

216
00:20:27,990 --> 00:20:33,010
checked for touch detection on this screen we can check for the push button as well.

217
00:20:33,030 --> 00:20:34,380
So that's what we're gonna do next.

218
00:20:34,830 --> 00:20:44,730
So I'm gonna say if if PSP underscore P B for push button we use to get state to function get state

219
00:20:46,890 --> 00:20:52,660
and then let states guess its function takes one argument which is the button whose state you want to

220
00:20:53,370 --> 00:20:55,110
get so button key here.

221
00:20:55,110 --> 00:21:03,330
This is already defined in our PSP and this corresponds to the pin of the arm of the blue push button

222
00:21:03,360 --> 00:21:04,740
on our microcontroller board.

223
00:21:05,760 --> 00:21:09,780
So if this is true if it gets the state and it's true

224
00:21:13,170 --> 00:21:18,550
I'm gonna we're gonna implement this we're gonna change this a bit and implement it.

225
00:21:18,690 --> 00:21:19,090
Okay.

226
00:21:19,110 --> 00:21:24,680
If this is true what we want to do is run this over here.

227
00:21:24,690 --> 00:21:28,630
This we would change it a bit rather than take no argument.

228
00:21:28,630 --> 00:21:35,130
We're going to pass a what inputs data buffer as well as our output data buffer.

229
00:21:35,130 --> 00:21:38,790
So um the first argument is going to be the input buffer.

230
00:21:39,030 --> 00:21:47,940
So we're going to pass this to and makes a process and we're going to change the prototype of this function

231
00:21:47,940 --> 00:21:48,420
as well.

232
00:21:48,420 --> 00:21:55,430
Later on in other files you'll see an underscore input underscored data.

233
00:21:55,500 --> 00:22:04,350
Does the first I comment and then the second argument is gonna be an underscore output data.

234
00:22:04,350 --> 00:22:04,830
Right.

235
00:22:06,000 --> 00:22:13,440
So once we've done this once with passed that what input buffer no triple buffer to our neural network.

236
00:22:13,440 --> 00:22:16,970
We create a for loop to determine the prediction.

237
00:22:17,040 --> 00:22:22,870
I'm gonna say we're going to find out which is the number one prediction and then number two prediction.

238
00:22:23,280 --> 00:22:30,850
We can just use a loop over here for int for int i equals zero.

239
00:22:31,720 --> 00:22:33,750
I is less than number of classes

240
00:22:37,520 --> 00:22:41,970
I plus plus now we see

241
00:22:44,830 --> 00:22:45,160
if

242
00:22:47,840 --> 00:22:52,130
first prediction probability by doing first pred dot probe

243
00:22:57,270 --> 00:23:02,970
it first prediction probability is greater than an output data index.

244
00:23:03,000 --> 00:23:03,360
I

245
00:23:11,070 --> 00:23:25,680
we open this block and then we see second prediction that s probability because first prediction that

246
00:23:25,680 --> 00:23:29,210
s probability of course.

247
00:23:29,340 --> 00:23:31,200
Uh second prediction label.

248
00:23:31,260 --> 00:23:35,480
Sorry April you cause first prediction label

249
00:23:44,570 --> 00:23:51,230
and then second prediction probability of first prediction probability.

250
00:23:51,230 --> 00:23:51,850
Yeah.

251
00:23:51,980 --> 00:23:53,310
Or should we do that.

252
00:23:54,860 --> 00:23:59,810
Yeah no problem because we want to view that probability as well I was thinking let's just viewed a

253
00:23:59,810 --> 00:24:03,310
label but we want to know what probability it is.

254
00:24:03,530 --> 00:24:04,380
Right.

255
00:24:04,430 --> 00:24:10,500
So we can get the label we can print out the the probability as well as the label not just a label.

256
00:24:10,580 --> 00:24:14,200
So I see second second prediction.

257
00:24:14,560 --> 00:24:15,440
DOT's probe

258
00:24:18,490 --> 00:24:23,810
because it's called first prediction probe.

259
00:24:23,910 --> 00:24:34,350
I was hoping to process just the m the label but let's process both prob like this and then we see first

260
00:24:34,350 --> 00:24:34,980
prediction

261
00:24:40,190 --> 00:24:46,070
probe equals output

262
00:24:50,480 --> 00:24:51,200
data index.

263
00:24:51,200 --> 00:24:52,040
I like this.

264
00:24:54,920 --> 00:24:59,210
And then my first prediction label is simply I

265
00:25:08,860 --> 00:25:09,410
okay.

266
00:25:09,460 --> 00:25:16,530
Once that is done we can print out the first and second prediction as well as the um.

267
00:25:16,720 --> 00:25:22,510
The prediction labels as well as the probabilities both first and second so simply to a print off over

268
00:25:22,510 --> 00:25:27,010
here and then I'll say percentage.

269
00:25:30,410 --> 00:25:37,500
Percentage F for the probability and then New Line courage return.

270
00:25:39,140 --> 00:25:41,270
What I'm gonna do here is a first prediction

271
00:25:45,300 --> 00:25:49,920
Dutch label and then first prediction

272
00:25:53,850 --> 00:25:55,420
probability like this

273
00:26:06,960 --> 00:26:09,180
okay we solve this later.

274
00:26:12,910 --> 00:26:13,390
She

275
00:26:25,470 --> 00:26:28,150
do not change it is the second prediction.

276
00:26:37,380 --> 00:26:43,360
Actually I'm gonna bring this out of the for loop.

277
00:26:43,860 --> 00:26:45,570
Come this over here.

278
00:26:45,680 --> 00:26:59,370
The for loop this over here and go on a bit of context to it's also a first case of order and then a

279
00:26:59,480 --> 00:27:00,200
second guess

280
00:27:04,930 --> 00:27:05,360
okay.

281
00:27:05,520 --> 00:27:07,990
Let's see what is a process.

282
00:27:08,120 --> 00:27:18,620
Says go to project properties settings to settings and odd print of project properties.

283
00:27:19,240 --> 00:27:21,000
C++ beauty etc..

284
00:27:21,040 --> 00:27:21,720
Okay.

285
00:27:21,780 --> 00:27:32,100
Right click properties C++ build settings to settings.

286
00:27:32,630 --> 00:27:32,880
Okay.

287
00:27:32,880 --> 00:27:38,730
And then we take this and then we take this applying close.

288
00:27:38,730 --> 00:27:41,570
Okay it looks good.

289
00:27:46,960 --> 00:27:47,310
Okay.

290
00:27:47,340 --> 00:27:50,800
Right.

291
00:27:51,030 --> 00:27:55,850
So once we've done this what we're gonna do is we're going to print only the first prediction on to

292
00:27:55,870 --> 00:28:01,380
a while until our LCD screen and to do that we do s print f

293
00:28:05,040 --> 00:28:13,910
what I'm going to do here is pass first prediction first prediction dotcom string.

294
00:28:14,100 --> 00:28:21,290
We've got a kid like this and put it into a string and then we will pass the string to this.

295
00:28:21,950 --> 00:28:22,330
So

296
00:28:28,690 --> 00:28:34,390
so we agreed to take the first prediction put it into a strength so that we'll be able to pass the string

297
00:28:34,390 --> 00:28:43,090
onto our LCD screen so to do this I'm gonna call our buffer that we created over here first prediction.

298
00:28:43,170 --> 00:28:52,970
Uh prediction SDR put us put this over here and then it's off type percentage D.

299
00:28:54,920 --> 00:28:59,180
And then comma is first prediction label.

300
00:28:59,200 --> 00:29:01,350
That is what we want to store here.

301
00:29:01,820 --> 00:29:08,720
So copy this and then dot label over here.

302
00:29:09,250 --> 00:29:15,130
Once this is done we can print it on our LCD screen and we're gonna print it with text color red.

303
00:29:15,130 --> 00:29:25,960
So do BSP on the score LCD on the score set to text color and then I'm going to pass right over here

304
00:29:26,080 --> 00:29:26,680
LCD

305
00:29:30,090 --> 00:29:32,820
color red and then

306
00:29:35,870 --> 00:29:42,220
PSP and the score LCD and a score set font.

307
00:29:42,590 --> 00:29:54,020
Gonna set a font size of 20 bypassing the address font 20 over here once that is done I'm gonna set

308
00:29:54,020 --> 00:30:02,330
the background color to the same color as the um as the LCD as everything else I should say PSP OCD

309
00:30:02,850 --> 00:30:08,580
on a score set back a color so that the texture wouldn't stand out.

310
00:30:08,760 --> 00:30:21,320
You know there's a function called set back color and a color we're using is generally LCD color light

311
00:30:21,350 --> 00:30:26,510
cyan like this and watch all of this is done.

312
00:30:26,510 --> 00:30:33,190
One can print the um the text on the screen by using the display screen got function.

313
00:30:33,350 --> 00:30:40,540
So see PSP on the score LCD display string at

314
00:30:44,820 --> 00:30:53,810
we gonna put it a position exposition one thirty and one uh y position two five five if it doesn't fit

315
00:30:53,840 --> 00:30:59,310
properly we're going to readjust it what I'm gonna do is typecast this to you in eight on a score t

316
00:30:59,320 --> 00:30:59,930
pointer

317
00:31:03,230 --> 00:31:09,830
and what we want to place here is this string here which we've assembled

318
00:31:13,370 --> 00:31:23,390
and I'm gonna set it to left mode over here on a scroll mode right so to read more about this function

319
00:31:23,480 --> 00:31:32,150
you can certainly check it out here okay or double click go to declaration to get more information with

320
00:31:32,150 --> 00:31:39,830
regards to this LCD function once we've done this we can reset the game I'm gonna call this a research

321
00:31:39,830 --> 00:31:49,870
function from here I'm gonna put it over here like this right.

322
00:31:49,940 --> 00:31:56,210
So this what we have so far so in the next lesson what we're going to do is go and implement what we

323
00:31:56,210 --> 00:32:04,610
need to implement in our up underscore X cube a I don't see file after that is done we can test out

324
00:32:04,730 --> 00:32:08,570
our deployment but that's all there is for this lesson.

325
00:32:08,570 --> 00:32:11,720
It's getting a bit long so we should continue in the next lesson.
