WEBVTT

1
00:00:00.080 --> 00:00:02.359
<v Speaker 1>Ever wanted to control a light, make a motor spin,

2
00:00:02.960 --> 00:00:05.879
<v Speaker 1>or read the temperature in your room, not just with

3
00:00:05.919 --> 00:00:08.960
<v Speaker 1>a switch, but with code. If the idea of building

4
00:00:08.960 --> 00:00:11.599
<v Speaker 1>little gadgets that interact with the physical world using simple

5
00:00:11.640 --> 00:00:16.239
<v Speaker 1>programming sounds intriguing, well, you are absolutely in the right place.

6
00:00:16.760 --> 00:00:19.879
<v Speaker 2>Welcome to a deep dive based on a fantastic beginner's

7
00:00:19.879 --> 00:00:20.879
<v Speaker 2>guide you shared with us.

8
00:00:20.960 --> 00:00:21.920
<v Speaker 1>Yeah, great source.

9
00:00:22.039 --> 00:00:24.559
<v Speaker 2>We're pulling out the most important nuggets from the source

10
00:00:24.600 --> 00:00:28.559
<v Speaker 2>material to give you a real shortcut into the fundamental

11
00:00:28.600 --> 00:00:29.960
<v Speaker 2>world of Urdueno programming.

12
00:00:30.440 --> 00:00:33.200
<v Speaker 1>Our mission today is to quickly get you up to

13
00:00:33.240 --> 00:00:35.960
<v Speaker 1>speed on what our Dueno is, why it's become this

14
00:00:36.079 --> 00:00:41.600
<v Speaker 1>go to tool for makers and hobbyists everywhere, and walk

15
00:00:41.679 --> 00:00:45.039
<v Speaker 1>through the absolute essentials of how it works so you

16
00:00:45.079 --> 00:00:48.079
<v Speaker 1>can start bringing your own project ideas to life without

17
00:00:48.119 --> 00:00:49.439
<v Speaker 1>feeling totally lost.

18
00:00:49.679 --> 00:00:53.000
<v Speaker 2>At its heart, Arduino is an open source electronic platform.

19
00:00:53.320 --> 00:00:55.960
<v Speaker 2>Think of it as having two key components. There's the

20
00:00:56.000 --> 00:00:59.280
<v Speaker 2>physical circuit board, the hardware that you can program okay,

21
00:00:59.320 --> 00:01:02.280
<v Speaker 2>and then there's the coding software, the ide that you

22
00:01:02.359 --> 00:01:04.319
<v Speaker 2>use on your computer to write those instructions.

23
00:01:04.680 --> 00:01:07.840
<v Speaker 1>And I love this detail from the source. Unlike traditional programming,

24
00:01:07.840 --> 00:01:11.719
<v Speaker 1>where your first success is often printing Hello World on

25
00:01:11.760 --> 00:01:15.400
<v Speaker 1>a screen. In the microcontroller world, that rite of passage

26
00:01:15.879 --> 00:01:19.079
<v Speaker 1>is getting an LED light to blink. The blinking LED

27
00:01:19.400 --> 00:01:21.959
<v Speaker 1>it's your basic confirmation that the code got onto the

28
00:01:22.040 --> 00:01:24.719
<v Speaker 1>chip and the board is alive. It's a small thing,

29
00:01:25.200 --> 00:01:27.799
<v Speaker 1>but surprisingly satisfying.

30
00:01:28.000 --> 00:01:31.000
<v Speaker 2>That blinking LED is really the signal that you've successfully

31
00:01:31.000 --> 00:01:34.799
<v Speaker 2>bridged the digital and physical worlds. Your code is now

32
00:01:34.840 --> 00:01:37.159
<v Speaker 2>making something happen electrically.

33
00:01:37.280 --> 00:01:40.599
<v Speaker 1>Okay, so it's a programmable board, but drill down a bit,

34
00:01:40.640 --> 00:01:42.719
<v Speaker 1>what exactly is it doing on that board.

35
00:01:42.799 --> 00:01:46.719
<v Speaker 2>It's essentially a small specialized computer called a micro controller.

36
00:01:47.280 --> 00:01:50.239
<v Speaker 2>Unlike your desktop or phone, which can do a million things,

37
00:01:50.599 --> 00:01:53.760
<v Speaker 2>a micro controller is typically designed to execute one specific

38
00:01:53.799 --> 00:01:57.760
<v Speaker 2>program repeatedly and interact directly with electronic components.

39
00:01:58.000 --> 00:02:00.680
<v Speaker 1>And the history as laid out than the source. It's

40
00:02:00.680 --> 00:02:03.519
<v Speaker 1>actually pretty cool. It didn't start because some tech giant

41
00:02:03.560 --> 00:02:05.640
<v Speaker 1>wanted to build I don't know, smart toasters.

42
00:02:05.719 --> 00:02:08.439
<v Speaker 2>No, not at all. It originated back in two thousand

43
00:02:08.439 --> 00:02:11.919
<v Speaker 2>and three at the Interactive Design Institute in Ivrea, Italy.

44
00:02:12.280 --> 00:02:17.120
<v Speaker 2>Right Hernando Barragan had this practical goal simplify micro controllers.

45
00:02:17.919 --> 00:02:20.960
<v Speaker 2>At the time, boards like the basic stamp were really

46
00:02:20.960 --> 00:02:22.599
<v Speaker 2>expensive over one hundred dollars.

47
00:02:22.680 --> 00:02:23.000
<v Speaker 1>Wow.

48
00:02:23.039 --> 00:02:25.400
<v Speaker 2>That put them out of reach for students, especially those

49
00:02:25.439 --> 00:02:28.680
<v Speaker 2>in design who needed to incorporate interaction into their projects

50
00:02:28.680 --> 00:02:31.199
<v Speaker 2>but weren't deep into electrical engineering.

51
00:02:31.759 --> 00:02:34.879
<v Speaker 1>So it was fundamentally about lowering the barrier to entry,

52
00:02:35.000 --> 00:02:37.159
<v Speaker 1>making this tech accessible exactly.

53
00:02:37.280 --> 00:02:40.680
<v Speaker 2>That accessibility is crucial to its story. The platform was

54
00:02:40.719 --> 00:02:44.120
<v Speaker 2>further developed by key figures like Masimo Bonzi, David Mellis,

55
00:02:44.199 --> 00:02:47.560
<v Speaker 2>David Cortils, Tom Ego, and gen Luca Martino, building on

56
00:02:47.599 --> 00:02:52.199
<v Speaker 2>that initial vision and earlier work like the Wiring Project.

57
00:02:52.319 --> 00:02:55.879
<v Speaker 1>And that accessibility focus really defines who uses it today. Right,

58
00:02:56.000 --> 00:02:57.599
<v Speaker 1>It's not just engineers.

59
00:02:57.159 --> 00:03:01.199
<v Speaker 2>Absolutely, The source emphasizes it was intention only designed for everyone.

60
00:03:01.280 --> 00:03:04.159
<v Speaker 2>You see it pop up with artists creating interactive installations,

61
00:03:04.479 --> 00:03:10.199
<v Speaker 2>architects building dynamic models, musicians experimenting with electronic instruments, hobbyists

62
00:03:10.240 --> 00:03:13.240
<v Speaker 2>inventing gadgets in their garage, and yes, it's a fantastic

63
00:03:13.280 --> 00:03:15.919
<v Speaker 2>tool for introducing kids to coding and electronics.

64
00:03:16.439 --> 00:03:19.560
<v Speaker 1>That broad appeal makes perfect sense when you look at

65
00:03:19.560 --> 00:03:23.159
<v Speaker 1>the advantages that source highlights. There are what six big

66
00:03:23.199 --> 00:03:24.960
<v Speaker 1>reasons Ardweno became such a phenomenon.

67
00:03:25.039 --> 00:03:26.000
<v Speaker 2>Yeah, six key ones.

68
00:03:26.680 --> 00:03:29.120
<v Speaker 1>Let's unpack the why behind its popularity.

69
00:03:29.360 --> 00:03:33.039
<v Speaker 2>Number one, and perhaps the most impactful initially, was cost efficiency.

70
00:03:33.759 --> 00:03:38.199
<v Speaker 2>The source contrasts the price starkly, older boards costing one

71
00:03:38.280 --> 00:03:41.960
<v Speaker 2>hundred dollars plus lo o versus pre assembled ardwenos often

72
00:03:42.039 --> 00:03:44.719
<v Speaker 2>less than fifty dollars or even less if you assemble

73
00:03:44.719 --> 00:03:48.199
<v Speaker 2>a kit yourself. Making it affordable was a primary driver.

74
00:03:48.439 --> 00:03:51.360
<v Speaker 1>That changes everything for a student or hobbyist. Okay, what's

75
00:03:51.439 --> 00:03:51.840
<v Speaker 1>number two?

76
00:03:51.919 --> 00:03:55.159
<v Speaker 2>The development environment. The Ardueno ID, that's the software where

77
00:03:55.199 --> 00:03:58.639
<v Speaker 2>you write your code is cross platform. Doesn't matter if

78
00:03:58.639 --> 00:04:00.520
<v Speaker 2>you're on Windows, mac Os, or Linux.

79
00:04:00.639 --> 00:04:03.680
<v Speaker 1>The ID works on all of them, no operating system

80
00:04:03.759 --> 00:04:07.439
<v Speaker 1>lock in. That's a big plus. And related to that software.

81
00:04:07.199 --> 00:04:09.560
<v Speaker 2>The software is open source. This means the coding tools

82
00:04:09.599 --> 00:04:12.319
<v Speaker 2>are completely free, no licenses, no fees.

83
00:04:12.360 --> 00:04:13.039
<v Speaker 1>That's huge.

84
00:04:13.120 --> 00:04:17.160
<v Speaker 2>This is massive for education and collaboration. Anyone can download it,

85
00:04:17.319 --> 00:04:20.360
<v Speaker 2>use it, modify it, teach with it. It really fosters a

86
00:04:20.399 --> 00:04:21.959
<v Speaker 2>culture of sharing and learning.

87
00:04:22.199 --> 00:04:24.040
<v Speaker 1>So it's free and you can see how it works

88
00:04:24.120 --> 00:04:26.920
<v Speaker 1>under the hood. How about for people who aren't just beginners?

89
00:04:27.279 --> 00:04:28.199
<v Speaker 1>Does it scale up?

90
00:04:28.519 --> 00:04:32.439
<v Speaker 2>That's the fourth point? Extendability. While it's simple for beginners.

91
00:04:32.519 --> 00:04:36.439
<v Speaker 2>The software allows more experienced programmers to delve deeper using

92
00:04:36.480 --> 00:04:40.279
<v Speaker 2>C plus plus libraries and AVRC for more complex tasks.

93
00:04:40.839 --> 00:04:42.279
<v Speaker 2>It scales with your skill level.

94
00:04:42.399 --> 00:04:43.720
<v Speaker 1>It grows with you as you learn.

95
00:04:44.120 --> 00:04:48.439
<v Speaker 2>Fifth advantage, the ide itself is designed for clarity and simplicity.

96
00:04:48.519 --> 00:04:51.879
<v Speaker 2>The coding environment is straightforward, aiming to make the process

97
00:04:51.879 --> 00:04:55.639
<v Speaker 2>of writing and debugging code as easy as possible, particularly

98
00:04:55.680 --> 00:04:58.199
<v Speaker 2>for those new to programming micro controllers.

99
00:04:58.399 --> 00:05:01.399
<v Speaker 1>Makes sense, and the sixth Advance Edge takes the open

100
00:05:01.439 --> 00:05:05.839
<v Speaker 1>source idea beyond the software to the physical board itself exactly.

101
00:05:06.120 --> 00:05:09.639
<v Speaker 2>The hardware designs are also open source under a Creative Commons.

102
00:05:09.279 --> 00:05:11.879
<v Speaker 1>License, so you could technically build your own if you

103
00:05:11.959 --> 00:05:12.560
<v Speaker 1>have the knowledge.

104
00:05:12.600 --> 00:05:14.639
<v Speaker 2>Yeah, you can build your own or do we know

105
00:05:14.680 --> 00:05:17.439
<v Speaker 2>compatible board? The source even points out you can start

106
00:05:17.480 --> 00:05:20.199
<v Speaker 2>building simple circuits on a breadboard, which is a prototyping

107
00:05:20.240 --> 00:05:24.240
<v Speaker 2>tool that doesn't require soldering, further lowering the initial hardware barrier.

108
00:05:24.480 --> 00:05:29.199
<v Speaker 1>Affordable, accessible on any computer, free to use and share, scalable,

109
00:05:29.519 --> 00:05:32.920
<v Speaker 1>easy software, and even open source hardware designs.

110
00:05:33.360 --> 00:05:36.079
<v Speaker 2>Yeah, that list definitely paints a clear picture of why

111
00:05:36.120 --> 00:05:39.160
<v Speaker 2>it took off. Now, as you get started, the source

112
00:05:39.279 --> 00:05:43.319
<v Speaker 2>introduces some key terminology you'll encounter constantly. We talked about

113
00:05:43.319 --> 00:05:44.240
<v Speaker 2>open source right.

114
00:05:44.279 --> 00:05:47.759
<v Speaker 1>Open source means the freedom to use, modify, and share

115
00:05:48.240 --> 00:05:52.160
<v Speaker 1>both the hardware designs and software tools. It's really foundational

116
00:05:52.199 --> 00:05:53.720
<v Speaker 1>to the whole platform.

117
00:05:53.240 --> 00:05:56.959
<v Speaker 2>And the basic distinction hardware versus software. Pretty straightforward.

118
00:05:57.040 --> 00:05:59.959
<v Speaker 1>Yeah. Hardware is the physical board, the chips, the pins,

119
00:06:00.079 --> 00:06:04.240
<v Speaker 1>the wires. Software is the code, the instructions you write

120
00:06:04.279 --> 00:06:06.240
<v Speaker 1>and load onto the hardware to tell it what to do.

121
00:06:06.439 --> 00:06:08.800
<v Speaker 2>The code is the brain. The board is the body.

122
00:06:08.879 --> 00:06:11.879
<v Speaker 1>What about EPROM That sounds a bit intimidating.

123
00:06:12.000 --> 00:06:14.120
<v Speaker 2>E PROM is just a specific type of memory on

124
00:06:14.120 --> 00:06:16.360
<v Speaker 2>the board. The source likens it to a tiny hard

125
00:06:16.439 --> 00:06:19.199
<v Speaker 2>drive because, unlike the main memory, which resets when you

126
00:06:19.240 --> 00:06:23.040
<v Speaker 2>power off. Okay, e PROM can store data persistently even

127
00:06:23.079 --> 00:06:26.279
<v Speaker 2>when the board has no power, useful for saving things

128
00:06:26.319 --> 00:06:28.319
<v Speaker 2>like settings or calibration data.

129
00:06:28.319 --> 00:06:32.240
<v Speaker 1>Like a little non volatile storage. Got it and pwmpins?

130
00:06:32.519 --> 00:06:35.160
<v Speaker 1>I see that mession on the board descriptions what's PWM.

131
00:06:35.160 --> 00:06:39.800
<v Speaker 2>PWM stands for pulsewith modulation. Certain digital pins have this

132
00:06:39.879 --> 00:06:43.240
<v Speaker 2>special capability. Instead of just being fully on in five

133
00:06:43.319 --> 00:06:46.800
<v Speaker 2>volts or fully o off zero volts, they can rapidly

134
00:06:46.839 --> 00:06:49.920
<v Speaker 2>switch between on and all off f By controlling the

135
00:06:50.000 --> 00:06:53.160
<v Speaker 2>ratio of on time to off time within a cycle,

136
00:06:53.519 --> 00:06:55.439
<v Speaker 2>you can simulate varying levels in between.

137
00:06:56.040 --> 00:06:58.639
<v Speaker 1>So like dimming an led not just turning it on or.

138
00:06:58.639 --> 00:07:01.519
<v Speaker 2>Off exactly, or controlling the speed of a motor smoothly.

139
00:07:01.839 --> 00:07:04.360
<v Speaker 2>It gives you analog like control from a digital pin.

140
00:07:04.519 --> 00:07:05.399
<v Speaker 2>It's pretty clever.

141
00:07:05.639 --> 00:07:08.399
<v Speaker 1>That is clever, Okay. Clock speed is that just how

142
00:07:08.439 --> 00:07:09.079
<v Speaker 1>fast it thinks?

143
00:07:09.160 --> 00:07:11.480
<v Speaker 2>Pretty much? That's the speed at which the micro controller

144
00:07:11.519 --> 00:07:15.480
<v Speaker 2>executes instructions measured in megahertz EM hurts. A faster clock

145
00:07:15.519 --> 00:07:18.399
<v Speaker 2>speed means it can crunch numbers and react faster, making

146
00:07:18.439 --> 00:07:19.800
<v Speaker 2>your project more responsive.

147
00:07:20.000 --> 00:07:20.879
<v Speaker 1>But there's a trade off.

148
00:07:20.959 --> 00:07:22.959
<v Speaker 2>Yeah. The trade off, the source notes is usually increased

149
00:07:23.000 --> 00:07:26.240
<v Speaker 2>power consumption. Faster usually means hungrier.

150
00:07:25.839 --> 00:07:29.319
<v Speaker 1>Speed versus battery life. The classic trade off and uh

151
00:07:29.600 --> 00:07:31.240
<v Speaker 1>you aret art.

152
00:07:31.560 --> 00:07:34.800
<v Speaker 2>You art relates to serial communication. It's a measure of

153
00:07:34.839 --> 00:07:39.079
<v Speaker 2>how many serial communication lines aboard has. Serial communication sends

154
00:07:39.160 --> 00:07:42.720
<v Speaker 2>data one bit at a time sequentially. It's a simpler

155
00:07:42.759 --> 00:07:46.439
<v Speaker 2>way to transfer data than say, parallel communication, and is

156
00:07:46.480 --> 00:07:49.759
<v Speaker 2>often used for communication between the arduino and a computer

157
00:07:49.920 --> 00:07:51.439
<v Speaker 2>or other devices, which.

158
00:07:51.240 --> 00:07:53.600
<v Speaker 1>Feels like a good bridge to something everyone's heard of,

159
00:07:54.439 --> 00:07:57.439
<v Speaker 1>Internet of things or IoT. How does our Duena fit

160
00:07:57.480 --> 00:07:57.759
<v Speaker 1>in there?

161
00:07:57.879 --> 00:08:01.439
<v Speaker 2>Absolutely? Our Dueno is a fantastic tool for getting into IoT.

162
00:08:02.040 --> 00:08:05.040
<v Speaker 2>Many projects involve using sensors connected to an arduino to

163
00:08:05.120 --> 00:08:08.319
<v Speaker 2>gather data temperature, light, motion, you name it, right, and

164
00:08:08.360 --> 00:08:11.519
<v Speaker 2>then connecting that arduino to a network to share that information,

165
00:08:11.920 --> 00:08:15.319
<v Speaker 2>becoming part of this interconnected world. The source gives examples

166
00:08:15.399 --> 00:08:18.360
<v Speaker 2>like smart appliances or smartphones as part of the broader

167
00:08:18.399 --> 00:08:21.360
<v Speaker 2>IoT landscape, and Ardueno lets you build your own custom

168
00:08:21.399 --> 00:08:22.079
<v Speaker 2>nodes within that.

169
00:08:22.480 --> 00:08:25.040
<v Speaker 1>Building, your own piece of the smart home. Okay, speaking

170
00:08:25.040 --> 00:08:27.480
<v Speaker 1>of building, If I'm sold on our dueno, how do

171
00:08:27.560 --> 00:08:29.600
<v Speaker 1>I pick which board to start with? There seem to

172
00:08:29.600 --> 00:08:32.519
<v Speaker 1>be quite a few. The source offers some smart questions

173
00:08:32.559 --> 00:08:33.279
<v Speaker 1>to ask yourself.

174
00:08:33.600 --> 00:08:37.440
<v Speaker 2>Yeah, it suggests starting with your project idea. First, consider

175
00:08:37.480 --> 00:08:39.000
<v Speaker 2>how much processing power you'll need.

176
00:08:39.399 --> 00:08:42.559
<v Speaker 1>So is it a simple turn an led on project

177
00:08:42.960 --> 00:08:46.799
<v Speaker 1>or is something complex like crunching sensor data while controlling

178
00:08:46.879 --> 00:08:50.000
<v Speaker 1>multiple motors for a robot arm Right? That points towards

179
00:08:50.080 --> 00:08:53.000
<v Speaker 1>requirements like flash memory, SHRAM and processor.

180
00:08:52.559 --> 00:08:56.080
<v Speaker 2>Speed exactly Second, how many inputs and outputs? How many

181
00:08:56.120 --> 00:09:00.000
<v Speaker 2>digital and analog pins. Will your project require simple project

182
00:09:00.120 --> 00:09:03.000
<v Speaker 2>needs just a few? Complex needs many more?

183
00:09:03.240 --> 00:09:07.279
<v Speaker 1>Makes sense? And third, are you envisioning a wearable device

184
00:09:07.720 --> 00:09:09.120
<v Speaker 1>like something sewn into clothing?

185
00:09:09.519 --> 00:09:13.080
<v Speaker 2>That question immediately narrows down the options to specialized boards

186
00:09:13.120 --> 00:09:16.200
<v Speaker 2>designed for e textiles, like the lily Pads or the Gemma.

187
00:09:16.320 --> 00:09:18.679
<v Speaker 2>As the source points out, they're designed to be sown.

188
00:09:18.759 --> 00:09:19.840
<v Speaker 2>Some are even washable.

189
00:09:20.440 --> 00:09:22.799
<v Speaker 1>Let's highlight a couple of the specific boards mentioned, just

190
00:09:22.879 --> 00:09:25.480
<v Speaker 1>to give a concrete feel for the variety. The Uno

191
00:09:25.679 --> 00:09:28.000
<v Speaker 1>is definitely the classic starting point.

192
00:09:27.840 --> 00:09:31.080
<v Speaker 2>Right it really is. The Source positions the Arduino Uno

193
00:09:31.120 --> 00:09:34.039
<v Speaker 2>as the quintessential beginner board. Flexible and easy to get

194
00:09:34.039 --> 00:09:37.840
<v Speaker 2>started with. It uses a standard Mini USB for connection, which.

195
00:09:37.679 --> 00:09:39.320
<v Speaker 1>Is pretty common, and the specs.

196
00:09:39.720 --> 00:09:43.440
<v Speaker 2>Specs listed are around twenty five dollars, Sixteenminger hurt speed,

197
00:09:43.879 --> 00:09:47.399
<v Speaker 2>fourteen digital pins, six of which can do that PWM

198
00:09:47.440 --> 00:09:50.279
<v Speaker 2>thing we talked about, and six analog input pins. A

199
00:09:50.320 --> 00:09:51.679
<v Speaker 2>good all arounder.

200
00:09:51.320 --> 00:09:54.360
<v Speaker 1>A great general purpose board to learn on. How about Leonardo?

201
00:09:54.399 --> 00:09:55.519
<v Speaker 1>What's special about that one?

202
00:09:55.600 --> 00:09:58.919
<v Speaker 2>The Leonardo is interesting because it's processor design allows it

203
00:09:59.000 --> 00:10:01.679
<v Speaker 2>to show up on your computer as a standard mouse

204
00:10:01.759 --> 00:10:04.200
<v Speaker 2>or keyboard right out of the box. Oh neat Yeah,

205
00:10:04.240 --> 00:10:06.879
<v Speaker 2>which is cool for projects that you know physically control

206
00:10:06.919 --> 00:10:10.080
<v Speaker 2>your computer uses a micro USB port and is also

207
00:10:10.200 --> 00:10:13.240
<v Speaker 2>sixteen megahertz priced a bit lower around twenty dollars.

208
00:10:13.399 --> 00:10:16.000
<v Speaker 1>Controlling your computer with physical inputs cool.

209
00:10:16.360 --> 00:10:19.320
<v Speaker 2>The Esplorer sounds like it's designed specifically for education.

210
00:10:19.639 --> 00:10:22.159
<v Speaker 1>It absolutely is. It's based on the Leonardo, but comes

211
00:10:22.159 --> 00:10:24.919
<v Speaker 1>with multiple common sensors and outputs already built right onto

212
00:10:24.919 --> 00:10:29.159
<v Speaker 1>the board. A joystick, slighter, temperature sensor, light sensor, sound sensor,

213
00:10:29.399 --> 00:10:30.399
<v Speaker 1>even an accelerometer.

214
00:10:30.480 --> 00:10:32.039
<v Speaker 2>Wow. All included YEP.

215
00:10:31.879 --> 00:10:34.759
<v Speaker 1>Plus sound and light outputs. You learn by seeing these

216
00:10:34.799 --> 00:10:38.159
<v Speaker 1>integrated components in action, which removes the initial hurdle of

217
00:10:38.159 --> 00:10:41.200
<v Speaker 1>wiring everything up yourself. It's around forty four dollars, also

218
00:10:41.480 --> 00:10:44.159
<v Speaker 1>sixteen megahertz. That's a smart way to ease people into

219
00:10:44.159 --> 00:10:47.440
<v Speaker 1>the hardware side. For bigger, more complex projects that make it.

220
00:10:47.480 --> 00:10:48.679
<v Speaker 1>Twenty five to sixty is mentioned.

221
00:10:48.720 --> 00:10:50.919
<v Speaker 2>The Mega twenty five to sixty is the workhorse for

222
00:10:50.960 --> 00:10:54.799
<v Speaker 2>when you need more resources, robotics, three D printers, anything

223
00:10:54.840 --> 00:10:58.000
<v Speaker 2>requiring a lot of connections, more pins, basically way more pins.

224
00:10:58.000 --> 00:11:01.759
<v Speaker 2>It dramatically increases the pin count fifty four digital pins,

225
00:11:02.000 --> 00:11:06.200
<v Speaker 2>fifteen of those or PWM capable sixteen analog inputs and

226
00:11:06.399 --> 00:11:09.200
<v Speaker 2>much more memory than the you know still keeps the

227
00:11:09.240 --> 00:11:13.360
<v Speaker 2>sixteen megahertz speed, though around forty six upslers.

228
00:11:13.039 --> 00:11:15.879
<v Speaker 1>More inputs and outputs for more complex systems. Okay, and

229
00:11:15.919 --> 00:11:17.480
<v Speaker 1>the zero sounds like an upgrade.

230
00:11:17.519 --> 00:11:20.360
<v Speaker 2>The Arduino zero is presented as a performance upgrade. It's

231
00:11:20.399 --> 00:11:22.960
<v Speaker 2>a thirty two bit board running at forty eight megaherts.

232
00:11:23.000 --> 00:11:26.320
<v Speaker 2>That's faster, much faster processing. It also has a built

233
00:11:26.360 --> 00:11:29.399
<v Speaker 2>in debugger, the EDBG, which helps you find errors in

234
00:11:29.440 --> 00:11:32.440
<v Speaker 2>your code without needing extra hardware. That's a great feature

235
00:11:32.440 --> 00:11:36.159
<v Speaker 2>for troubleshooting, especially more complex code. It's about forty three dollars.

236
00:11:36.080 --> 00:11:39.879
<v Speaker 1>Faster and easier debugging. Nice and for those specifically targeting IoT,

237
00:11:40.440 --> 00:11:41.879
<v Speaker 1>the Internet of Things stuff.

238
00:11:41.720 --> 00:11:43.960
<v Speaker 2>The Ardueno un is built with IoT in mind. It

239
00:11:44.000 --> 00:11:47.200
<v Speaker 2>actually integrates Wi Fi and thret connectivity right on the board,

240
00:11:47.240 --> 00:11:49.960
<v Speaker 2>so convenient. Yeah, and it even runs a small Linux

241
00:11:50.000 --> 00:11:55.200
<v Speaker 2>operating system linino OS alongside the Arduino microcontroller. This makes

242
00:11:55.240 --> 00:11:59.840
<v Speaker 2>network connectivity much more straightforward than adding shields or external modules.

243
00:12:00.360 --> 00:12:03.559
<v Speaker 2>It's the priceiest of the ones, detailed around sixty eight

244
00:12:03.600 --> 00:12:07.279
<v Speaker 2>dollars running at sixteen milihertz on the micro controller side, So.

245
00:12:07.159 --> 00:12:09.080
<v Speaker 1>The choice really depends on what you want to do,

246
00:12:09.480 --> 00:12:12.279
<v Speaker 1>and the source mentions. There's a whole family beyond these

247
00:12:12.320 --> 00:12:15.879
<v Speaker 1>more powerful thirty two bit do boards, Android integration with

248
00:12:15.919 --> 00:12:20.320
<v Speaker 1>the Meg eighty K, smaller ProBoards for permanent installation, those

249
00:12:20.360 --> 00:12:21.879
<v Speaker 1>lilypads and Gema for.

250
00:12:21.919 --> 00:12:24.879
<v Speaker 2>Wearables, right, and even tiny powerful ones like the Ta.

251
00:12:24.960 --> 00:12:28.039
<v Speaker 2>And it's a whole ecosystem. But honestly, starting with something

252
00:12:28.039 --> 00:12:30.799
<v Speaker 2>like the Uno is perfectly fine for learning the fundamentals.

253
00:12:30.840 --> 00:12:31.799
<v Speaker 2>You can do a lot with an.

254
00:12:31.720 --> 00:12:35.080
<v Speaker 1>Uno okay board in hand. Ide software installed on my computer.

255
00:12:35.440 --> 00:12:37.679
<v Speaker 1>What's the very first step to making it do something?

256
00:12:37.759 --> 00:12:39.720
<v Speaker 1>How do you get your instructions onto the board?

257
00:12:39.879 --> 00:12:41.919
<v Speaker 2>First? You write your program, which in the Arduino world

258
00:12:42.000 --> 00:12:44.080
<v Speaker 2>is called a sketch. You do this in the Ardueno

259
00:12:44.120 --> 00:12:47.039
<v Speaker 2>ide on your computer. The IDE helps you write the

260
00:12:47.080 --> 00:12:50.559
<v Speaker 2>code and importantly helps find errors, what we call debugging.

261
00:12:50.879 --> 00:12:53.120
<v Speaker 1>Got the sketch written, Now I need to get it

262
00:12:53.120 --> 00:12:55.159
<v Speaker 1>from my computer onto the board's little brain.

263
00:12:55.399 --> 00:12:57.840
<v Speaker 2>Right. You connect the board to your computer, usually with

264
00:12:57.879 --> 00:13:01.639
<v Speaker 2>a USB cable. Different boards use different USB ports, you know,

265
00:13:02.240 --> 00:13:06.399
<v Speaker 2>standard USBB like on printers, Mini USB, micro USB okay,

266
00:13:06.799 --> 00:13:10.559
<v Speaker 2>and the source notes some older or specialized boards might

267
00:13:10.600 --> 00:13:13.679
<v Speaker 2>need a separate adapter cable called an FTDI cable, but

268
00:13:13.840 --> 00:13:17.879
<v Speaker 2>most common ones just use USB. The ID should recognize

269
00:13:17.879 --> 00:13:19.840
<v Speaker 2>your board, or you might need to select it from

270
00:13:19.879 --> 00:13:23.559
<v Speaker 2>a list. Then you simply click the upload button and

271
00:13:23.639 --> 00:13:27.399
<v Speaker 2>magic happens, sort of. The IDE compiles your code, turns

272
00:13:27.440 --> 00:13:30.720
<v Speaker 2>it into machine language, the micro controller understands and sends

273
00:13:30.759 --> 00:13:33.679
<v Speaker 2>it over the USB cable to the board's memory. The

274
00:13:33.720 --> 00:13:36.120
<v Speaker 2>source adds a little note that with some older boards,

275
00:13:36.159 --> 00:13:38.159
<v Speaker 2>you might need to hit a reset button right after

276
00:13:38.200 --> 00:13:41.000
<v Speaker 2>clicking upload for it to accept the new code. Modern

277
00:13:41.039 --> 00:13:43.000
<v Speaker 2>ones usually handle it automatically and.

278
00:13:43.039 --> 00:13:46.440
<v Speaker 1>Actually writing the code. It feels like learning a new language,

279
00:13:46.440 --> 00:13:48.919
<v Speaker 1>doesn't it, with all the weird symbols and terms.

280
00:13:49.600 --> 00:13:53.000
<v Speaker 2>It really is just like learning Spanish or French. There's vocabulary,

281
00:13:53.080 --> 00:13:57.480
<v Speaker 2>the keywords like int or void. There's grammar, the rules

282
00:13:57.480 --> 00:14:00.600
<v Speaker 2>about semicolon's and curly braces and structure.

283
00:14:00.879 --> 00:14:02.639
<v Speaker 1>It gets easier, definitely.

284
00:14:02.480 --> 00:14:04.440
<v Speaker 2>Just like spoken language. The more you practice, the more

285
00:14:04.519 --> 00:14:07.240
<v Speaker 2>natural it feels. And learning one programming language gives you

286
00:14:07.279 --> 00:14:09.120
<v Speaker 2>a big head start on others because a lot of

287
00:14:09.120 --> 00:14:10.159
<v Speaker 2>the concepts carry over.

288
00:14:10.360 --> 00:14:14.279
<v Speaker 1>Let's go back to that iconic blinking led sketch. The

289
00:14:14.320 --> 00:14:17.080
<v Speaker 1>source breaks down the basic structure of an Ardueno sketch.

290
00:14:17.600 --> 00:14:19.879
<v Speaker 1>What are the absolutely essential parts.

291
00:14:20.240 --> 00:14:23.519
<v Speaker 2>Every basic sketch. Pretty much every Arduino program you write

292
00:14:23.559 --> 00:14:27.440
<v Speaker 2>has two fundamental functions that are required, void setup and

293
00:14:27.519 --> 00:14:28.120
<v Speaker 2>void loop.

294
00:14:28.440 --> 00:14:31.639
<v Speaker 1>Okay, walk me through setup. The example shows constant pink

295
00:14:31.759 --> 00:14:34.799
<v Speaker 1>le lo o open thirteen before it, and then void

296
00:14:34.840 --> 00:14:37.840
<v Speaker 1>setup pin mode pink le lo otput right.

297
00:14:37.919 --> 00:14:41.679
<v Speaker 2>So first, that constant pinklo thirteen line defines a constant.

298
00:14:41.759 --> 00:14:44.720
<v Speaker 2>Const means the value won't change. Int means it's an integer.

299
00:14:45.039 --> 00:14:47.399
<v Speaker 2>Pinkel is just a name we give it, and thirteen

300
00:14:47.480 --> 00:14:50.440
<v Speaker 2>is the value, meaning pin thirteen. Using names like pinkele

301
00:14:50.559 --> 00:14:53.200
<v Speaker 2>makes the code easier to read than just putting thirteen everywhere.

302
00:14:53.279 --> 00:14:54.759
<v Speaker 1>Okay, good practice. Then set up.

303
00:14:54.879 --> 00:14:57.759
<v Speaker 2>The void setup function runs only once when your Arduino

304
00:14:57.840 --> 00:15:00.879
<v Speaker 2>board powers up or resets. That's where you put code

305
00:15:00.879 --> 00:15:03.879
<v Speaker 2>for initial configuration. The most common thing done here is

306
00:15:03.919 --> 00:15:06.159
<v Speaker 2>setting the pin mode for the pins you'll be using.

307
00:15:06.360 --> 00:15:10.360
<v Speaker 1>So pin mode pink ol l utpe tells the Arduino what.

308
00:15:10.600 --> 00:15:13.039
<v Speaker 2>It tells the Arduino that the pin we named pinkle,

309
00:15:13.200 --> 00:15:16.360
<v Speaker 2>which is pin thirteen, will be used as an otput,

310
00:15:16.600 --> 00:15:19.320
<v Speaker 2>meaning the arduino will send signals out from this pin,

311
00:15:19.480 --> 00:15:22.360
<v Speaker 2>like turning an LED on or off. The other option

312
00:15:22.480 --> 00:15:25.879
<v Speaker 2>is I nput if you're reading a button press for instance.

313
00:15:26.000 --> 00:15:28.240
<v Speaker 1>Okay, setup is for one time tasks when it starts

314
00:15:28.279 --> 00:15:30.240
<v Speaker 1>up and then loop That sounds like where.

315
00:15:30.039 --> 00:15:32.840
<v Speaker 2>The action is wabloop is exactly that. This function runs

316
00:15:32.840 --> 00:15:35.480
<v Speaker 2>repeatedly forever, well as long as the board has power.

317
00:15:35.639 --> 00:15:38.279
<v Speaker 2>Right after the setup function finishes, This is where you

318
00:15:38.320 --> 00:15:40.480
<v Speaker 2>put the code that does the actual work of your project,

319
00:15:40.559 --> 00:15:42.360
<v Speaker 2>whatever you want the arduno to keep doing, over and.

320
00:15:42.320 --> 00:15:45.840
<v Speaker 1>Over, looking at the blinking LED code inside loop. Digital

321
00:15:45.960 --> 00:15:49.679
<v Speaker 1>right pink o l HH delay six hundred, Digital right

322
00:15:49.759 --> 00:15:53.080
<v Speaker 1>pink COLW delay six hundred. What sequence does that create?

323
00:15:53.120 --> 00:15:55.840
<v Speaker 2>Okay? Digital right is a function that sets a digital

324
00:15:55.840 --> 00:15:58.600
<v Speaker 2>pin to either five volts, which we call hegh, or

325
00:15:58.720 --> 00:16:01.399
<v Speaker 2>zero volts, which we call a low Got it so,

326
00:16:01.519 --> 00:16:05.200
<v Speaker 2>Digital right pinkle ahgh sits pin thirteen to five V,

327
00:16:05.600 --> 00:16:10.879
<v Speaker 2>turning the connected LED on. Then delay six hundred pauses

328
00:16:10.919 --> 00:16:14.440
<v Speaker 2>the entire program for six hundred milliseconds that's point six seconds.

329
00:16:14.559 --> 00:16:17.759
<v Speaker 2>Waits for a bit exactly after that pause. Digital rate

330
00:16:17.840 --> 00:16:20.919
<v Speaker 2>pink ors low W sets the pin back to zero V,

331
00:16:21.200 --> 00:16:24.000
<v Speaker 2>turning the LED off, and then another delay six hundred

332
00:16:24.279 --> 00:16:26.039
<v Speaker 2>pauses again for point six seconds with.

333
00:16:26.000 --> 00:16:29.279
<v Speaker 1>The LED off, And because this is inside the loop function,

334
00:16:29.879 --> 00:16:32.840
<v Speaker 1>it just repeats that whole sequence. On for point six

335
00:16:32.960 --> 00:16:35.840
<v Speaker 1>is pause oh off for point six is pause on

336
00:16:35.960 --> 00:16:36.960
<v Speaker 1>for point six is forever.

337
00:16:37.080 --> 00:16:40.720
<v Speaker 2>Precisely that creates the continuous blinking effect. It's simple, but

338
00:16:40.759 --> 00:16:42.200
<v Speaker 2>it demonstrates the core structure.

339
00:16:42.519 --> 00:16:45.159
<v Speaker 1>The source gives some helpful basic trouble shooting tips based

340
00:16:45.159 --> 00:16:47.519
<v Speaker 1>on this simple example, which is smart, like what if

341
00:16:47.519 --> 00:16:48.120
<v Speaker 1>it doesn't blink?

342
00:16:48.200 --> 00:16:50.679
<v Speaker 2>Yeah? Common issues If you wired up an external LED

343
00:16:50.840 --> 00:16:53.000
<v Speaker 2>in the little built in LED on the board blinks

344
00:16:53.000 --> 00:16:55.279
<v Speaker 2>but yours doesn't. The most common issue is wiring your

345
00:16:55.360 --> 00:16:58.159
<v Speaker 2>LED backward. LEDs only let current flow one way. They

346
00:16:58.159 --> 00:17:01.679
<v Speaker 2>are polarized. The longer leg usually goes to the positive side.

347
00:17:01.600 --> 00:17:03.600
<v Speaker 1>The penh easy mistake. What else?

348
00:17:03.840 --> 00:17:07.000
<v Speaker 2>Another simple check? If the built in LED on the

349
00:17:07.000 --> 00:17:10.519
<v Speaker 2>board is blinking, but maybe not at the rate you

350
00:17:10.599 --> 00:17:13.839
<v Speaker 2>programmed like it's blinking slowly once a second instead of

351
00:17:13.880 --> 00:17:17.240
<v Speaker 2>your faster point six second rate. It probably means your

352
00:17:17.240 --> 00:17:20.960
<v Speaker 2>new sketch didn't successfully upload. The board is likely still

353
00:17:21.039 --> 00:17:24.079
<v Speaker 2>running the default blink sketch or whatever was on it last.

354
00:17:24.640 --> 00:17:27.920
<v Speaker 1>Good simple checks for beginners. Now let's look inside those

355
00:17:27.920 --> 00:17:30.839
<v Speaker 1>setup and loop functions at the actual pieces of code

356
00:17:30.880 --> 00:17:35.000
<v Speaker 1>you use. The source covers comments, data types, and operators.

357
00:17:35.960 --> 00:17:37.440
<v Speaker 1>Comments first seem important.

358
00:17:37.519 --> 00:17:40.400
<v Speaker 2>Comments are your best friend. Seriously, theare knows you write

359
00:17:40.400 --> 00:17:42.599
<v Speaker 2>in your code for yourself or other humans to explain

360
00:17:42.640 --> 00:17:46.640
<v Speaker 2>what's happening, why you did something, whatever. The computer completely ignores.

361
00:17:46.279 --> 00:17:49.119
<v Speaker 1>Them, like leaving little sticky notes on your code. What

362
00:17:49.200 --> 00:17:50.839
<v Speaker 1>are the types? How do you write them?

363
00:17:50.960 --> 00:17:53.920
<v Speaker 2>There are two main ways. Starts a single line comment.

364
00:17:54.039 --> 00:17:56.519
<v Speaker 2>Everything after the double slash on that line is ignored

365
00:17:56.519 --> 00:17:58.319
<v Speaker 2>by the compiler, okay. And then there's to start a

366
00:17:58.359 --> 00:18:00.880
<v Speaker 2>multiline comment and to end it. Everything between those two

367
00:18:00.960 --> 00:18:03.759
<v Speaker 2>markers is ignored, even if it spans multiple lines. Good

368
00:18:03.799 --> 00:18:04.720
<v Speaker 2>for longer explanation.

369
00:18:04.839 --> 00:18:08.440
<v Speaker 1>So comments are purely for clarity. What about those lines

370
00:18:08.480 --> 00:18:11.119
<v Speaker 1>that start with the hash sign hashtag like hashtag difine

371
00:18:11.160 --> 00:18:12.920
<v Speaker 1>or hashtag include. Those aren't comments.

372
00:18:13.119 --> 00:18:16.119
<v Speaker 2>Those are called preprocessor directives, their instructions for the compiler

373
00:18:16.160 --> 00:18:19.599
<v Speaker 2>before it actually compiles the main pad. Hashtag define creates

374
00:18:19.599 --> 00:18:21.960
<v Speaker 2>a constant name for a value, like we saw earlier

375
00:18:22.000 --> 00:18:26.519
<v Speaker 2>with hashtag define LEDPM thirteen. The compiler just literally replaces

376
00:18:26.640 --> 00:18:30.559
<v Speaker 2>every instance of LEDPN with thirteen throughout your code before compiling.

377
00:18:30.720 --> 00:18:31.880
<v Speaker 1>Does that save memory or something?

378
00:18:32.079 --> 00:18:33.759
<v Speaker 2>The source notes it can save a tiny bit of

379
00:18:33.799 --> 00:18:37.720
<v Speaker 2>program memory compared to defining a constant variable with constant

380
00:18:37.880 --> 00:18:41.559
<v Speaker 2>because it's just text replacement. And crucially, hashtag define lines

381
00:18:41.640 --> 00:18:43.440
<v Speaker 2>do not end with a semicolon.

382
00:18:43.880 --> 00:18:47.440
<v Speaker 1>Good tip about the missing semicolon and hashtag include.

383
00:18:47.480 --> 00:18:50.839
<v Speaker 2>Hashtag include is used to bring in external libraries of code.

384
00:18:51.000 --> 00:18:54.319
<v Speaker 2>Libraries contain pre written functions that handle common tasks like

385
00:18:54.400 --> 00:18:58.839
<v Speaker 2>controlling specific sensors or communication protocols. So hashtag includes servo

386
00:18:58.880 --> 00:19:02.119
<v Speaker 2>dot oh would let you use functions for controlling servo motors.

387
00:19:02.359 --> 00:19:04.279
<v Speaker 2>These also do not end with a semicolon.

388
00:19:04.519 --> 00:19:07.640
<v Speaker 1>Got it? Okay? Let's talk data types. When we store

389
00:19:07.720 --> 00:19:10.599
<v Speaker 1>values in variables, the source says, the value has a

390
00:19:10.599 --> 00:19:12.640
<v Speaker 1>specific type. Why is that important?

391
00:19:12.960 --> 00:19:15.319
<v Speaker 2>Yes? The data type tells the computer what kind of

392
00:19:15.359 --> 00:19:17.839
<v Speaker 2>information the variable holds, like is it a whole number,

393
00:19:17.839 --> 00:19:20.559
<v Speaker 2>a number with a decimal, a character, and how much

394
00:19:20.599 --> 00:19:23.559
<v Speaker 2>memory it needs to store it. Using the right type

395
00:19:23.599 --> 00:19:25.519
<v Speaker 2>is important for accuracy and efficiency.

396
00:19:25.559 --> 00:19:27.160
<v Speaker 1>What are the common ones we'll see.

397
00:19:27.079 --> 00:19:29.400
<v Speaker 2>You'll see end all the time. That's for whole numbers

398
00:19:29.680 --> 00:19:32.960
<v Speaker 2>positive or negative like ten or mineta five or zero.

399
00:19:33.319 --> 00:19:36.240
<v Speaker 2>Then float for numbers with decimal points like three point one,

400
00:19:36.359 --> 00:19:38.880
<v Speaker 2>four or nan a zero point zero zero one by

401
00:19:39.240 --> 00:19:43.240
<v Speaker 2>exactly U. Char is for a single character like A

402
00:19:43.640 --> 00:19:46.559
<v Speaker 2>or b or even seven stored as a character, and

403
00:19:46.680 --> 00:19:49.519
<v Speaker 2>boolean is super simple. It can only hold one of

404
00:19:49.559 --> 00:19:51.400
<v Speaker 2>two values, true or false.

405
00:19:51.519 --> 00:19:54.839
<v Speaker 1>And there are others mentioned like byte long, unsigned long,

406
00:19:55.039 --> 00:19:55.599
<v Speaker 1>and void.

407
00:19:55.920 --> 00:19:59.079
<v Speaker 2>Right bite is useful for small positive whole numbers from

408
00:19:59.160 --> 00:20:02.200
<v Speaker 2>zero up to two fifty five. It uses less memory

409
00:20:02.240 --> 00:20:04.839
<v Speaker 2>than an int, which is good on these small microcontrollers.

410
00:20:05.400 --> 00:20:07.559
<v Speaker 2>Long and unsigned long are for when you need to

411
00:20:07.559 --> 00:20:10.720
<v Speaker 2>store much larger whole numbers, like maybe counting milliseconds since

412
00:20:10.720 --> 00:20:11.559
<v Speaker 2>the board started.

413
00:20:11.759 --> 00:20:12.240
<v Speaker 1>And void.

414
00:20:12.640 --> 00:20:14.839
<v Speaker 2>Void isn't really a type you store data in. It's

415
00:20:14.920 --> 00:20:18.039
<v Speaker 2>used in function definitions like voids setup to indicate that

416
00:20:18.079 --> 00:20:20.599
<v Speaker 2>the function doesn't return any value when it's done running.

417
00:20:20.759 --> 00:20:23.039
<v Speaker 1>Okay, so we know what kinds of data we can

418
00:20:23.079 --> 00:20:27.240
<v Speaker 1>work with, how do we well operate on that data?

419
00:20:27.319 --> 00:20:28.759
<v Speaker 1>Add things, compare things.

420
00:20:28.880 --> 00:20:31.759
<v Speaker 2>That's where operators come in. They're the symbols that perform actions.

421
00:20:31.799 --> 00:20:35.400
<v Speaker 2>You know, the basic arithmetic ones from school plus for addition,

422
00:20:35.559 --> 00:20:37.759
<v Speaker 2>for subtraction, for multiplication, for division.

423
00:20:37.640 --> 00:20:39.400
<v Speaker 1>Percent, I always forget what modulo does.

424
00:20:39.640 --> 00:20:43.039
<v Speaker 2>Modulo the percent signed percent gives you the remainder after

425
00:20:43.119 --> 00:20:47.640
<v Speaker 2>an integer division. This source gives the example seven percent five. Well,

426
00:20:47.680 --> 00:20:50.440
<v Speaker 2>five goes into seven one time with a remainder of two,

427
00:20:50.599 --> 00:20:54.000
<v Speaker 2>so seven percent five equals too. It's surprisingly useful for

428
00:20:54.039 --> 00:20:56.519
<v Speaker 2>things like checking if a number is even or odd,

429
00:20:57.039 --> 00:20:58.960
<v Speaker 2>or making counters wrap around.

430
00:20:59.079 --> 00:21:02.079
<v Speaker 1>Okay, remainder, got it now. The source points out a

431
00:21:02.079 --> 00:21:05.839
<v Speaker 1>classic beginner pitfall versus that one trips everyone up initially,

432
00:21:05.920 --> 00:21:06.319
<v Speaker 1>doesn't it?

433
00:21:06.359 --> 00:21:09.319
<v Speaker 2>Oh yeah, it's super common. A single equal sign is

434
00:21:09.359 --> 00:21:11.799
<v Speaker 2>the assignment operator. It puts the value on the right

435
00:21:11.839 --> 00:21:14.240
<v Speaker 2>into variable on the left, Like insensor value of equal

436
00:21:14.279 --> 00:21:16.200
<v Speaker 2>five hundred. It's saying, makes sensor value.

437
00:21:16.000 --> 00:21:17.880
<v Speaker 1>Equal five hundred, assigning of value right.

438
00:21:18.440 --> 00:21:21.519
<v Speaker 2>A double equal sign is the comparison operator. It checks

439
00:21:21.720 --> 00:21:24.200
<v Speaker 2>if the two things on either side are already equal.

440
00:21:24.680 --> 00:21:28.119
<v Speaker 2>It asks the question, is sensor value equal to five hundred.

441
00:21:28.480 --> 00:21:30.319
<v Speaker 2>It results in either true or false.

442
00:21:30.599 --> 00:21:34.799
<v Speaker 1>So if sense value is five hundred is wrong because

443
00:21:34.799 --> 00:21:37.559
<v Speaker 1>it tries to assign five hundred. But if sensor value

444
00:21:37.559 --> 00:21:40.319
<v Speaker 1>equals five hundred is right because it checks if it's

445
00:21:40.359 --> 00:21:41.880
<v Speaker 1>already five hundred exactly.

446
00:21:42.119 --> 00:21:44.519
<v Speaker 2>Using inside an if is a very common bug when

447
00:21:44.559 --> 00:21:45.240
<v Speaker 2>you're starting out.

448
00:21:45.440 --> 00:21:49.240
<v Speaker 1>That distinction is vital. Beyond checking for equality, what other

449
00:21:49.240 --> 00:21:50.680
<v Speaker 1>comparison operators are there?

450
00:21:50.839 --> 00:21:53.880
<v Speaker 2>The standard ones you'd expect means not equal to, then

451
00:21:53.920 --> 00:21:56.240
<v Speaker 2>you have for less than, for greater than, for less

452
00:21:56.240 --> 00:21:57.839
<v Speaker 2>than or equal to. And it's for greater than or

453
00:21:57.880 --> 00:21:58.240
<v Speaker 2>equal to.

454
00:21:58.400 --> 00:22:00.000
<v Speaker 1>And these all give back true or false.

455
00:22:00.240 --> 00:22:03.200
<v Speaker 2>Yeap. They all evaluate to a boolean true or false value,

456
00:22:03.440 --> 00:22:06.319
<v Speaker 2>which is perfect for using in if statements or loops.

457
00:22:06.119 --> 00:22:08.680
<v Speaker 1>Which ties directly into boolean or logical operators. How do

458
00:22:08.720 --> 00:22:09.160
<v Speaker 1>those work?

459
00:22:09.279 --> 00:22:12.519
<v Speaker 2>Exactly? These operators let you combine or modify those true

460
00:22:12.559 --> 00:22:15.079
<v Speaker 2>false results. And is the logical A and D operator.

461
00:22:15.279 --> 00:22:17.720
<v Speaker 2>Condition an and condition B is only true if both

462
00:22:17.720 --> 00:22:20.240
<v Speaker 2>condition A and A D condition B are true. Is

463
00:22:20.279 --> 00:22:24.720
<v Speaker 2>the logical OAR operator. That's two vertical bars. Condition A

464
00:22:25.039 --> 00:22:28.599
<v Speaker 2>condition B is true if either condition AOAR condition B

465
00:22:28.759 --> 00:22:31.680
<v Speaker 2>is true, or if both are true. And the exclamation

466
00:22:31.799 --> 00:22:34.759
<v Speaker 2>mark it's the logical not operator. It just reverses the

467
00:22:34.759 --> 00:22:39.119
<v Speaker 2>truth value, so true becomes false and false becomes true.

468
00:22:39.759 --> 00:22:41.200
<v Speaker 2>Useful for flipping conditions.

469
00:22:41.279 --> 00:22:44.519
<v Speaker 1>These are the fundamental tools for calculation and comparison. Now,

470
00:22:44.519 --> 00:22:46.960
<v Speaker 1>how do we make our program smart? How do we

471
00:22:47.000 --> 00:22:49.480
<v Speaker 1>make it decide what to do based on conditions or

472
00:22:49.559 --> 00:22:51.559
<v Speaker 1>repeat actions multiple times?

473
00:22:51.880 --> 00:22:54.680
<v Speaker 2>That's where control structures come in. They direct the flow

474
00:22:54.680 --> 00:22:57.599
<v Speaker 2>of your program, deciding which lines of code get executed

475
00:22:57.640 --> 00:23:01.440
<v Speaker 2>and when. Decision making is typically handled with if statements,

476
00:23:01.680 --> 00:23:03.640
<v Speaker 2>often paired with else, if and else.

477
00:23:04.079 --> 00:23:06.240
<v Speaker 1>How does that sequence work? Like? Does it check all

478
00:23:06.279 --> 00:23:06.559
<v Speaker 1>of them?

479
00:23:06.640 --> 00:23:09.200
<v Speaker 2>It checks them in order and if condition code block

480
00:23:09.440 --> 00:23:11.720
<v Speaker 2>runs the code inside its curly braces only if the

481
00:23:11.720 --> 00:23:13.119
<v Speaker 2>condition evaluates to true.

482
00:23:13.319 --> 00:23:15.960
<v Speaker 1>Okay, if it's true, run the code if it's false.

483
00:23:16.279 --> 00:23:19.160
<v Speaker 2>If the if condition is false, the program can then

484
00:23:19.240 --> 00:23:23.480
<v Speaker 2>optionally check an el sif another condition. If that condition

485
00:23:23.559 --> 00:23:27.119
<v Speaker 2>is true, it's code runs. You can string multiple elsifs together,

486
00:23:27.240 --> 00:23:30.160
<v Speaker 2>one after another. It checks them sequentially until it finds

487
00:23:30.160 --> 00:23:32.680
<v Speaker 2>one that's true, runs its code, and then skips the

488
00:23:32.720 --> 00:23:34.920
<v Speaker 2>rest of the elsifs and any final.

489
00:23:34.559 --> 00:23:35.880
<v Speaker 1>Else and the else at the end.

490
00:23:35.960 --> 00:23:39.200
<v Speaker 2>A final optional else code block runs only if none

491
00:23:39.240 --> 00:23:42.160
<v Speaker 2>of the preceding if or else if conditions were true.

492
00:23:42.160 --> 00:23:44.720
<v Speaker 2>It's the fallback the otherwise case.

493
00:23:45.160 --> 00:23:47.480
<v Speaker 1>So it's how you create those branching paths in your logic.

494
00:23:47.519 --> 00:23:50.400
<v Speaker 1>If the sensor reads high, do this otherwise. If it's

495
00:23:50.480 --> 00:23:52.440
<v Speaker 1>kind of medium, do that otherwise. If it's low, do

496
00:23:52.519 --> 00:23:53.000
<v Speaker 1>this other thing.

497
00:23:53.079 --> 00:23:56.559
<v Speaker 2>Precisely, that's the core of decision making in code. For

498
00:23:56.640 --> 00:24:00.440
<v Speaker 2>repeating actions, you generally use loops. The source details two

499
00:24:00.519 --> 00:24:02.839
<v Speaker 2>main types, while loops and four loops.

500
00:24:02.960 --> 00:24:05.000
<v Speaker 1>What does a wild loop do? How is it different?

501
00:24:05.359 --> 00:24:08.880
<v Speaker 2>A while code to repeat loop is pretty straightforward. It

502
00:24:09.000 --> 00:24:12.359
<v Speaker 2>checks the condition before each potential run. If the condition

503
00:24:12.480 --> 00:24:15.400
<v Speaker 2>is true, it executes the code block inside the curly braces.

504
00:24:15.920 --> 00:24:18.559
<v Speaker 2>Then it goes back, checks the condition again. If it's

505
00:24:18.599 --> 00:24:21.200
<v Speaker 2>still true, it runs the code again. It keeps doing

506
00:24:21.200 --> 00:24:23.240
<v Speaker 2>this as long as the condition remains true.

507
00:24:23.200 --> 00:24:25.480
<v Speaker 1>So it could run zero times if the condition is

508
00:24:25.480 --> 00:24:26.319
<v Speaker 1>false the first.

509
00:24:26.160 --> 00:24:29.799
<v Speaker 2>Time exactly, or it could run forever if the condition

510
00:24:30.039 --> 00:24:32.759
<v Speaker 2>never becomes false. Think of it as a loop that

511
00:24:32.880 --> 00:24:36.559
<v Speaker 2>keeps going while something is true, like processing data while

512
00:24:36.559 --> 00:24:39.920
<v Speaker 2>there is data available, or running a game loop while

513
00:24:39.920 --> 00:24:40.799
<v Speaker 2>the game isn't over.

514
00:24:41.000 --> 00:24:43.720
<v Speaker 1>It keeps checking the condition, and four loops they look

515
00:24:43.759 --> 00:24:44.680
<v Speaker 1>a bit more structured.

516
00:24:45.119 --> 00:24:48.839
<v Speaker 2>Four loops are generally used when you know or can

517
00:24:49.000 --> 00:24:51.359
<v Speaker 2>calculate how many times you want to repeat something, or

518
00:24:51.400 --> 00:24:54.039
<v Speaker 2>when you're iterating through a known sequence like the elements

519
00:24:54.039 --> 00:24:56.559
<v Speaker 2>in an array. The structure looks a bit more complex

520
00:24:57.079 --> 00:25:00.599
<v Speaker 2>for initialization condition, iteration, code repeat.

521
00:25:00.960 --> 00:25:04.119
<v Speaker 1>Okay, break down those three parts in the parentheses. Initialization.

522
00:25:04.640 --> 00:25:08.039
<v Speaker 2>Initialization runs only once at the very beginning of the loop.

523
00:25:08.319 --> 00:25:10.799
<v Speaker 2>It's typically used to declare and set up a counter

524
00:25:10.920 --> 00:25:14.160
<v Speaker 2>variable like into I zero zero got it condition. The

525
00:25:14.200 --> 00:25:17.240
<v Speaker 2>condition is checked before each loop iteration, just like in

526
00:25:17.279 --> 00:25:19.759
<v Speaker 2>a while loop. If it's true, the code inside the

527
00:25:19.799 --> 00:25:22.839
<v Speaker 2>loop runs. If it's false, the loop terminates. A common

528
00:25:22.839 --> 00:25:25.960
<v Speaker 2>condition is something like I ten and iteration. The iteration

529
00:25:26.039 --> 00:25:28.559
<v Speaker 2>part runs after the code block inside the loop executes,

530
00:25:28.799 --> 00:25:31.279
<v Speaker 2>but before the condition is checked again for the next round.

531
00:25:31.640 --> 00:25:34.400
<v Speaker 2>It's usually used to update the counter variable, most often

532
00:25:34.400 --> 00:25:36.920
<v Speaker 2>incrementing it with I plus plus which means i I

533
00:25:37.000 --> 00:25:40.160
<v Speaker 2>plus one, or decrementing it with iis i.

534
00:25:40.200 --> 00:25:43.680
<v Speaker 1>One okay, So for into I zero I five I

535
00:25:43.839 --> 00:25:47.039
<v Speaker 1>plus plus do something would initialize I to zero. Then

536
00:25:47.079 --> 00:25:49.640
<v Speaker 1>it checks is zero less than five yes, runs, the

537
00:25:49.680 --> 00:25:51.880
<v Speaker 1>code increment's e to one checks is one less than

538
00:25:51.880 --> 00:25:54.160
<v Speaker 1>five yes runs the code increment's i all the way

539
00:25:54.200 --> 00:25:56.519
<v Speaker 1>until it becomes five checks is five to eight and

540
00:25:56.559 --> 00:25:59.240
<v Speaker 1>five no, so the loop stops. I ran five times

541
00:25:59.279 --> 00:26:01.759
<v Speaker 1>with I having the values zero, one, two, three, and

542
00:26:01.839 --> 00:26:03.119
<v Speaker 1>four inside the loop.

543
00:26:03.240 --> 00:26:06.200
<v Speaker 2>You got it. That's exactly how it works, and the

544
00:26:06.319 --> 00:26:10.000
<v Speaker 2>source gives that critical warning. Your four loop must have

545
00:26:10.039 --> 00:26:13.440
<v Speaker 2>a condition that will eventually become false. If you accidentally

546
00:26:13.480 --> 00:26:16.599
<v Speaker 2>write a condition that's always true, like I expeol zero

547
00:26:16.839 --> 00:26:19.880
<v Speaker 2>when I only ever increases, the loop runs forever and

548
00:26:19.920 --> 00:26:22.759
<v Speaker 2>your program just gets stuck there. That's another common way

549
00:26:22.759 --> 00:26:24.039
<v Speaker 2>to get stuck when you're starting.

550
00:26:23.759 --> 00:26:26.359
<v Speaker 1>Out, an accidental infinite loop. Yeah, I can see how

551
00:26:26.440 --> 00:26:29.599
<v Speaker 1>that happens. Speaking of iterating through things, that brings us

552
00:26:29.680 --> 00:26:32.240
<v Speaker 1>nicely to a rays. What's an array for? Why not

553
00:26:32.359 --> 00:26:34.079
<v Speaker 1>just use separate variables?

554
00:26:34.160 --> 00:26:36.480
<v Speaker 2>An array is a way to group multiple pieces of

555
00:26:36.559 --> 00:26:39.640
<v Speaker 2>data of the exact same type under a single variable name.

556
00:26:39.920 --> 00:26:42.599
<v Speaker 2>Think of it like a list or sequence of related values,

557
00:26:42.880 --> 00:26:46.319
<v Speaker 2>all stored neatly together in memory. The source uses the

558
00:26:46.359 --> 00:26:51.000
<v Speaker 2>example of wanting to control several LEDs, maybe using pins two, seven, four, six,

559
00:26:51.160 --> 00:26:53.480
<v Speaker 2>five and three instead of six different variables, use one

560
00:26:53.519 --> 00:26:57.200
<v Speaker 2>array exactly. You could declare it like in lead pins seven, four, six,

561
00:26:57.279 --> 00:26:59.839
<v Speaker 2>fy three. Now you have one variable lead pins that

562
00:27:00.079 --> 00:27:01.400
<v Speaker 2>it's all six pin numbers.

563
00:27:01.519 --> 00:27:05.240
<v Speaker 1>The syntax uses those square brackets. What's the potentially tricky

564
00:27:05.279 --> 00:27:07.319
<v Speaker 1>part about getting items out of that list.

565
00:27:07.599 --> 00:27:10.720
<v Speaker 2>The main thing to remember is zero indexing. In our

566
00:27:10.759 --> 00:27:14.279
<v Speaker 2>dwino and C plus plus says and many other programming languages,

567
00:27:14.680 --> 00:27:18.200
<v Speaker 2>you access elements in an array using an index number

568
00:27:18.240 --> 00:27:19.440
<v Speaker 2>that starts at zero.

569
00:27:19.279 --> 00:27:21.839
<v Speaker 1>Not oneh right, zero based.

570
00:27:21.960 --> 00:27:24.240
<v Speaker 2>So the first item in the array is it index zero,

571
00:27:24.480 --> 00:27:26.680
<v Speaker 2>The second item is at index one, the third at two,

572
00:27:26.839 --> 00:27:27.279
<v Speaker 2>and so on.

573
00:27:27.640 --> 00:27:30.880
<v Speaker 1>Okay, So in that lead pins example, leadpin zero would

574
00:27:30.880 --> 00:27:33.440
<v Speaker 1>give you the value two. The first pin number, yeah,

575
00:27:33.480 --> 00:27:35.839
<v Speaker 1>leadpins one would give you seven, and the last one,

576
00:27:35.839 --> 00:27:38.160
<v Speaker 1>which is the sixth element, would be at index five,

577
00:27:38.240 --> 00:27:39.279
<v Speaker 1>giving you the value three.

578
00:27:39.480 --> 00:27:41.960
<v Speaker 2>Exactly right. It feels a little weird at first if

579
00:27:42.000 --> 00:27:44.240
<v Speaker 2>you're used to counting from one in everyday life, but

580
00:27:44.519 --> 00:27:46.680
<v Speaker 2>you get used to zero indexing pretty quickly. It's just

581
00:27:46.759 --> 00:27:48.039
<v Speaker 2>the standard way it's done.

582
00:27:48.200 --> 00:27:50.720
<v Speaker 1>And the source shows how arrays and four loops are

583
00:27:50.720 --> 00:27:53.880
<v Speaker 1>often used together. That makes perfect sense. Now you can

584
00:27:53.960 --> 00:27:55.839
<v Speaker 1>use a four loop with a counter i that goes

585
00:27:55.880 --> 00:27:58.839
<v Speaker 1>from zero up to the size of the array minus one,

586
00:27:59.440 --> 00:28:02.279
<v Speaker 1>and inside the loop you use lead pinc to access

587
00:28:02.279 --> 00:28:04.839
<v Speaker 1>each element in turn, like you could loop through and

588
00:28:04.880 --> 00:28:06.559
<v Speaker 1>set the pin mode for all of them. In setup,

589
00:28:06.799 --> 00:28:08.359
<v Speaker 1>or loop through and turn them all on or off

590
00:28:08.359 --> 00:28:08.880
<v Speaker 1>in loop.

591
00:28:08.960 --> 00:28:12.599
<v Speaker 2>It's a really fundamental and efficient pattern for handling collections

592
00:28:12.640 --> 00:28:15.279
<v Speaker 2>of things in your code, much cleaner than writing the

593
00:28:15.319 --> 00:28:18.319
<v Speaker 2>same line of code six times with different variable names.

594
00:28:18.440 --> 00:28:22.200
<v Speaker 1>Definitely, okay, we've seen the built in functions set up

595
00:28:22.279 --> 00:28:25.480
<v Speaker 1>and loop, But what if you have a specific sequence

596
00:28:25.480 --> 00:28:29.440
<v Speaker 1>of actions, maybe like calculating something complex or controlling a

597
00:28:29.480 --> 00:28:31.759
<v Speaker 1>motor in a certain way, that you need to perform

598
00:28:31.880 --> 00:28:35.359
<v Speaker 1>multiple times throughout your program. Copy pasting that block of

599
00:28:35.400 --> 00:28:37.400
<v Speaker 1>code everywhere seems bad.

600
00:28:37.680 --> 00:28:41.799
<v Speaker 2>Copy pasting is definitely messy and prone to errors. If

601
00:28:41.839 --> 00:28:43.680
<v Speaker 2>you find a bug, you have to fix it in

602
00:28:43.839 --> 00:28:47.039
<v Speaker 2>every single place you pasted it. That's where user defined

603
00:28:47.039 --> 00:28:50.000
<v Speaker 2>functions are incredibly useful. They let you package a block

604
00:28:50.039 --> 00:28:52.319
<v Speaker 2>of code into a named, reusable.

605
00:28:51.880 --> 00:28:53.720
<v Speaker 1>Unit, like creating your own custom command.

606
00:28:53.839 --> 00:28:56.759
<v Speaker 2>Pretty much, you write the code for that task once

607
00:28:56.799 --> 00:28:59.720
<v Speaker 2>inside a function definition, give the function a meaningful name,

608
00:29:00.079 --> 00:29:02.079
<v Speaker 2>and then whenever you need to perform that task in

609
00:29:02.119 --> 00:29:04.680
<v Speaker 2>your main code set up or loop or even another function,

610
00:29:04.960 --> 00:29:07.519
<v Speaker 2>you just call that function by using its name. It

611
00:29:07.559 --> 00:29:10.839
<v Speaker 2>makes your code much neater, easier to read, easier to debug,

612
00:29:10.960 --> 00:29:11.640
<v Speaker 2>and easier to.

613
00:29:11.720 --> 00:29:17.480
<v Speaker 1>Update the source gives the general structure return type, function name, parameters,

614
00:29:17.680 --> 00:29:22.960
<v Speaker 1>code block, return value. Let's unpack that function signature return type.

615
00:29:23.279 --> 00:29:26.519
<v Speaker 2>Return type specifies what type of data, if any, the

616
00:29:26.599 --> 00:29:28.759
<v Speaker 2>function sends back to the place it was called from

617
00:29:28.920 --> 00:29:32.519
<v Speaker 2>when it finishes its job. We saw void earlier, meaning

618
00:29:32.559 --> 00:29:35.319
<v Speaker 2>it returns nothing, but it could be into if it

619
00:29:35.359 --> 00:29:39.279
<v Speaker 2>calculates a whole number, float, if it calculates a decimal number, boolean,

620
00:29:39.359 --> 00:29:40.960
<v Speaker 2>if it returns true or false.

621
00:29:40.720 --> 00:29:42.960
<v Speaker 1>And so on. Okay, function name is just what you

622
00:29:43.000 --> 00:29:43.240
<v Speaker 1>call it.

623
00:29:43.359 --> 00:29:45.519
<v Speaker 2>Yep, you pick the name. Make it descriptive so you

624
00:29:45.559 --> 00:29:48.519
<v Speaker 2>know what it does, like calculated distance or blinkeled sequence.

625
00:29:48.240 --> 00:29:50.119
<v Speaker 1>And parameters inside the parentheses.

626
00:29:50.160 --> 00:29:53.599
<v Speaker 2>Parameters are optional inputs. There are variables declared inside the

627
00:29:53.599 --> 00:29:56.799
<v Speaker 2>parentheses that allow you to pass information into the function

628
00:29:56.880 --> 00:29:58.519
<v Speaker 2>when you call it. So the function has data to

629
00:29:58.559 --> 00:30:01.039
<v Speaker 2>work with. You define them with their data type and

630
00:30:01.079 --> 00:30:04.759
<v Speaker 2>a placeholder name like int, pin number, int, blink delay.

631
00:30:05.200 --> 00:30:07.720
<v Speaker 2>If a function doesn't need any input, the parentheses are

632
00:30:07.759 --> 00:30:08.599
<v Speaker 2>just empty and.

633
00:30:08.599 --> 00:30:11.440
<v Speaker 1>The code block is just the steps the function takes.

634
00:30:11.720 --> 00:30:15.480
<v Speaker 2>Right, the instructions between the curly braces are the actual

635
00:30:15.559 --> 00:30:19.200
<v Speaker 2>work the function performs in that return value line at

636
00:30:19.240 --> 00:30:21.839
<v Speaker 2>the end, The return keyword is used to send a

637
00:30:21.920 --> 00:30:25.079
<v Speaker 2>value back to wherever the function was called from. You

638
00:30:25.160 --> 00:30:27.519
<v Speaker 2>only use it if your function's return type is something

639
00:30:27.519 --> 00:30:31.640
<v Speaker 2>other than void. Using return also immediately stops the function's

640
00:30:31.680 --> 00:30:34.400
<v Speaker 2>execution right there and goes back to the calling code.

641
00:30:34.880 --> 00:30:38.720
<v Speaker 1>The example from the source is float employe yearnings, float

642
00:30:38.759 --> 00:30:40.400
<v Speaker 1>hours worked flow pay rate.

643
00:30:40.519 --> 00:30:40.599
<v Speaker 2>Ye.

644
00:30:40.759 --> 00:30:41.680
<v Speaker 1>So that takes two.

645
00:30:41.720 --> 00:30:45.720
<v Speaker 2>Inputs right That function definition says it's named employee yearnings.

646
00:30:45.759 --> 00:30:49.079
<v Speaker 2>It expects two numbers with decimal points float as input,

647
00:30:49.440 --> 00:30:52.160
<v Speaker 2>which it will call hours worked and pay rate. Inside

648
00:30:52.160 --> 00:30:56.400
<v Speaker 2>the function, it does some calculation inside presumably hours worked,

649
00:30:56.440 --> 00:30:59.079
<v Speaker 2>pay rate, and then returns the result, which must also

650
00:30:59.119 --> 00:31:02.240
<v Speaker 2>be a float, using return statement like return hours worked,

651
00:31:02.279 --> 00:31:02.640
<v Speaker 2>pay rate.

652
00:31:02.720 --> 00:31:04.960
<v Speaker 1>And in your main sketch, maybe in loop you'd use

653
00:31:05.000 --> 00:31:08.039
<v Speaker 1>that function, maybe like float my weekly pay employee earnings

654
00:31:08.160 --> 00:31:10.200
<v Speaker 1>forty point zero twenty five point fifteen er, and the

655
00:31:10.240 --> 00:31:12.920
<v Speaker 1>function would run do the math forty twenty five point

656
00:31:12.920 --> 00:31:15.039
<v Speaker 1>to yo, and that calculated value would get stored in

657
00:31:15.039 --> 00:31:16.960
<v Speaker 1>the my weekly pay variable exactly.

658
00:31:17.079 --> 00:31:19.759
<v Speaker 2>You call the function by name, provide the input values

659
00:31:19.880 --> 00:31:23.400
<v Speaker 2>called arguments in the parentheses, and if it returns something,

660
00:31:23.480 --> 00:31:24.880
<v Speaker 2>you can capture that result in.

661
00:31:24.839 --> 00:31:28.640
<v Speaker 1>A variable where do you actually write these function definitions?

662
00:31:29.160 --> 00:31:31.799
<v Speaker 2>The source points out that any functions you create yourself

663
00:31:32.000 --> 00:31:34.599
<v Speaker 2>need to be defined outside of the standard set up

664
00:31:34.680 --> 00:31:37.759
<v Speaker 2>and loop functions. Usually you put them either before setup

665
00:31:37.880 --> 00:31:41.000
<v Speaker 2>or after loop. And remember they can be simple void

666
00:31:41.000 --> 00:31:43.720
<v Speaker 2>functions that don't return a value, and they might not

667
00:31:43.880 --> 00:31:46.599
<v Speaker 2>need any parameters if they just perform a fixed sequence

668
00:31:46.640 --> 00:31:47.279
<v Speaker 2>of actions.

669
00:31:47.400 --> 00:31:52.400
<v Speaker 1>Got it. Functions are all about organization and reusability. Okay,

670
00:31:52.519 --> 00:31:55.480
<v Speaker 1>moving on from writing our own functions. Our duino gives

671
00:31:55.519 --> 00:31:58.000
<v Speaker 1>us a whole library of built in functions to interact

672
00:31:58.039 --> 00:32:00.920
<v Speaker 1>with the board itself and the outside world it's API

673
00:32:01.160 --> 00:32:04.759
<v Speaker 1>or application programming interface. What are some crucial ones we

674
00:32:04.880 --> 00:32:05.880
<v Speaker 1>absolutely need to know?

675
00:32:06.200 --> 00:32:08.480
<v Speaker 2>We've actually seen some of the most important ones already.

676
00:32:08.880 --> 00:32:11.319
<v Speaker 2>For digital pins, we saw pin mode and set up

677
00:32:11.359 --> 00:32:14.480
<v Speaker 2>and digital right to set a pin HGH or low W.

678
00:32:14.920 --> 00:32:18.200
<v Speaker 2>There's also its counterpart, digital read pin, which checks the

679
00:32:18.200 --> 00:32:20.720
<v Speaker 2>current state of an input pin. Is it reading high

680
00:32:20.839 --> 00:32:24.039
<v Speaker 2>like five V from a press button or LW zero V.

681
00:32:24.119 --> 00:32:28.039
<v Speaker 2>These are your basic digital io input output tools, right.

682
00:32:28.119 --> 00:32:30.839
<v Speaker 1>What about analog? We know boards have those analog input

683
00:32:30.839 --> 00:32:32.960
<v Speaker 1>pins like a zero through a five on the UNO.

684
00:32:33.519 --> 00:32:34.640
<v Speaker 1>How do we read those.

685
00:32:34.599 --> 00:32:37.119
<v Speaker 2>For reading analog inputs. The core function is an allog

686
00:32:37.200 --> 00:32:39.640
<v Speaker 2>read pin. You give it the pin number like a zero.

687
00:32:39.960 --> 00:32:42.200
<v Speaker 2>It reads the voltage level present on that pin, which

688
00:32:42.240 --> 00:32:44.559
<v Speaker 2>could be anything between zero V and five E, and

689
00:32:44.680 --> 00:32:47.960
<v Speaker 2>converts that varying analog voltage into a digital number.

690
00:32:47.880 --> 00:32:49.319
<v Speaker 1>As a condvaria what kind of number do you get?

691
00:32:49.359 --> 00:32:52.039
<v Speaker 2>It performs what's called analog to digital conversion or ADC.

692
00:32:52.519 --> 00:32:54.240
<v Speaker 2>On most standard or do we knows like the UNO,

693
00:32:54.319 --> 00:32:56.720
<v Speaker 2>it's a ten bit ADC. This means it maps the

694
00:32:56.759 --> 00:32:59.160
<v Speaker 2>input voltage range zero V to five V to a

695
00:32:59.240 --> 00:33:01.839
<v Speaker 2>numerical range of zero to ten twenty three. So if

696
00:33:01.880 --> 00:33:04.559
<v Speaker 2>the pin reads zero V and I'll agreed return zero.

697
00:33:04.880 --> 00:33:07.839
<v Speaker 2>If it reads five V, it returns twenty twenty three.

698
00:33:08.319 --> 00:33:11.279
<v Speaker 2>If it reads say two point five V halfway, it

699
00:33:11.319 --> 00:33:13.240
<v Speaker 2>returns around five to twelve AH.

700
00:33:13.279 --> 00:33:16.359
<v Speaker 1>So a sensor like a potentiometer or temperature sensor that

701
00:33:16.400 --> 00:33:19.079
<v Speaker 1>outputs a varying voltage gets turned into a usable number

702
00:33:19.079 --> 00:33:22.160
<v Speaker 1>between zero and ten on twenty three. That's really useful

703
00:33:22.279 --> 00:33:25.200
<v Speaker 1>and analog right. We touched on that with PWM.

704
00:33:24.759 --> 00:33:28.200
<v Speaker 2>Exactly analog right pin value is used on those special

705
00:33:28.240 --> 00:33:32.039
<v Speaker 2>PWM enabled digital pins marked with a tilt on many boards.

706
00:33:32.400 --> 00:33:35.319
<v Speaker 2>It uses pulse width modulation to output an analog like

707
00:33:35.359 --> 00:33:38.039
<v Speaker 2>signal even though it's a digital pin. The value provide

708
00:33:38.039 --> 00:33:39.759
<v Speaker 2>here is typically between zero and two.

709
00:33:39.680 --> 00:33:41.839
<v Speaker 1>Fifty five, not zero to ten twenty three.

710
00:33:41.920 --> 00:33:44.279
<v Speaker 2>Now for analog right, the standard range is zero to

711
00:33:44.319 --> 00:33:47.359
<v Speaker 2>two fifty five, Where zero means the signal is effectively

712
00:33:47.400 --> 00:33:50.400
<v Speaker 2>off zero percent duty cycle, two fifty five means it's

713
00:33:50.440 --> 00:33:53.559
<v Speaker 2>fully on one hundred percent duty cycle, and a value

714
00:33:53.640 --> 00:33:55.440
<v Speaker 2>like one hundred and twenty seven means it's not about

715
00:33:55.480 --> 00:33:58.400
<v Speaker 2>half the time simulating roughly half brightness or half speed.

716
00:33:58.880 --> 00:34:00.960
<v Speaker 2>This is how you smoothly dem LEDs or control the

717
00:34:01.000 --> 00:34:02.359
<v Speaker 2>speed of many DC motors.

718
00:34:02.519 --> 00:34:04.960
<v Speaker 1>Okay, so analog read for getting sensor data in El

719
00:34:05.000 --> 00:34:07.720
<v Speaker 1>de Lando twenty three, anlog ride for controlling things with

720
00:34:07.799 --> 00:34:10.679
<v Speaker 1>varying levels out using PWM zero two five to five.

721
00:34:11.000 --> 00:34:13.199
<v Speaker 1>The source also covers how the Arduino can talk back

722
00:34:13.199 --> 00:34:15.519
<v Speaker 1>to your computer using something called the serial monitor.

723
00:34:15.920 --> 00:34:19.800
<v Speaker 2>Yes, serial communication is fundamental. It's a standard way electronic

724
00:34:19.840 --> 00:34:22.800
<v Speaker 2>devices talk to each other, sending data one bit after another,

725
00:34:22.960 --> 00:34:26.360
<v Speaker 2>usually over a simple connection like the USB cable. The

726
00:34:26.400 --> 00:34:29.840
<v Speaker 2>serial monitor built into the Arduino ide is basically a

727
00:34:29.880 --> 00:34:32.639
<v Speaker 2>simple text window on your computer. That lets your ardueno

728
00:34:32.760 --> 00:34:35.679
<v Speaker 2>send messages to you and lets you type messages from

729
00:34:35.719 --> 00:34:37.480
<v Speaker 2>your computer to the ardweno.

730
00:34:37.880 --> 00:34:40.199
<v Speaker 1>How do you enable that communication in your code?

731
00:34:40.320 --> 00:34:43.320
<v Speaker 2>The first step, usually done inside setup is to start

732
00:34:43.320 --> 00:34:47.440
<v Speaker 2>the serial communication channel using serial dot begin speed. The

733
00:34:47.480 --> 00:34:49.880
<v Speaker 2>speed is the data rate in bits per second, often

734
00:34:49.920 --> 00:34:52.519
<v Speaker 2>called the BOD rate. A very common speed to use

735
00:34:52.559 --> 00:34:55.360
<v Speaker 2>is ninety six hundred, so you'd write serial dot begin

736
00:34:55.639 --> 00:34:58.079
<v Speaker 2>ninety six hundred. You also need to make sure the

737
00:34:58.119 --> 00:35:00.639
<v Speaker 2>serial monitor window in the IDE is set to the

738
00:35:00.679 --> 00:35:01.320
<v Speaker 2>same speed.

739
00:35:01.559 --> 00:35:04.920
<v Speaker 1>Okay, communication started. Now how do I send data like

740
00:35:04.960 --> 00:35:07.880
<v Speaker 1>a sensor reading from the arduino to my computer screen?

741
00:35:08.159 --> 00:35:10.800
<v Speaker 2>You use the serial dot print and serial dot print

742
00:35:10.800 --> 00:35:14.239
<v Speaker 2>ale in functions. Serial dot print data sends whatever data

743
00:35:14.280 --> 00:35:17.599
<v Speaker 2>you give it text in quotes like hello, or the

744
00:35:17.719 --> 00:35:21.000
<v Speaker 2>value of a variable like sensor value to the serial monitor.

745
00:35:21.400 --> 00:35:23.880
<v Speaker 2>Serial dot printal data does the same thing, but it

746
00:35:23.920 --> 00:35:26.239
<v Speaker 2>also adds a new line character at the end, so

747
00:35:26.280 --> 00:35:28.039
<v Speaker 2>the next thing you print will appear on the next

748
00:35:28.039 --> 00:35:30.760
<v Speaker 2>line in the monitor. Print aline is usually what you

749
00:35:30.800 --> 00:35:32.360
<v Speaker 2>want for reading streams of data.

750
00:35:32.679 --> 00:35:35.159
<v Speaker 1>It makes the output readable. And how about the other

751
00:35:35.199 --> 00:35:39.280
<v Speaker 1>way sending commands from my computer to the arduino like

752
00:35:39.360 --> 00:35:41.039
<v Speaker 1>typing something in the serial monitor.

753
00:35:41.079 --> 00:35:44.880
<v Speaker 2>For that, you typically use serial dot read. This function

754
00:35:44.960 --> 00:35:48.360
<v Speaker 2>reads the next available byte character of incoming data that

755
00:35:48.400 --> 00:35:51.360
<v Speaker 2>has been sent from the computer. You usually check first

756
00:35:51.400 --> 00:35:54.800
<v Speaker 2>if data is actually available using serial dot available, which

757
00:35:54.840 --> 00:35:56.880
<v Speaker 2>returns the number of bytes waiting to be read.

758
00:35:56.960 --> 00:35:59.599
<v Speaker 1>Okay, check if something's there, then read it. The source

759
00:35:59.639 --> 00:36:03.719
<v Speaker 1>gives some fantastic practical examples tying these API functions together,

760
00:36:04.679 --> 00:36:07.360
<v Speaker 1>like reading a temperature sensor and showing the actual temperature

761
00:36:07.400 --> 00:36:08.320
<v Speaker 1>on the computer screen.

762
00:36:08.599 --> 00:36:11.599
<v Speaker 2>Right. That example really brings it together. You'd use analog

763
00:36:11.679 --> 00:36:13.960
<v Speaker 2>reed in your loop to get the raw sensor value

764
00:36:14.239 --> 00:36:17.119
<v Speaker 2>zero air zero two three. Then you do a little

765
00:36:17.159 --> 00:36:19.480
<v Speaker 2>math based on the sensor's data sheet to convert that

766
00:36:19.599 --> 00:36:22.159
<v Speaker 2>raw reading into an actual voltage and then maybe into

767
00:36:22.159 --> 00:36:25.760
<v Speaker 2>degrees celsius or fahrenheit. And finally you'd use serial dot

768
00:36:25.800 --> 00:36:30.199
<v Speaker 2>print temperature followed by serial dot print calculated temperature to

769
00:36:30.280 --> 00:36:32.760
<v Speaker 2>display that reading live in the serial monitor.

770
00:36:32.800 --> 00:36:35.360
<v Speaker 1>That's a complete little system. Another one uses a photo

771
00:36:35.440 --> 00:36:39.599
<v Speaker 1>resistor a light sensor and prints text descriptions like dark, dim,

772
00:36:39.840 --> 00:36:40.679
<v Speaker 1>light bright.

773
00:36:40.920 --> 00:36:43.400
<v Speaker 2>Yeah. That one demonstrates combining analog reed to get the

774
00:36:43.480 --> 00:36:46.079
<v Speaker 2>light level again zero one zero two three with a

775
00:36:46.119 --> 00:36:48.519
<v Speaker 2>series of I false iff statements. You check is the

776
00:36:48.559 --> 00:36:51.920
<v Speaker 2>value less than two hundred if yes, Serial dot printaline dark,

777
00:36:52.199 --> 00:36:54.679
<v Speaker 2>else if it's less than five hundred ceial dot print

778
00:36:54.760 --> 00:36:57.039
<v Speaker 2>lan dim else off less than eight hundred, Serial dot

779
00:36:57.079 --> 00:37:00.639
<v Speaker 2>print lin and light L serial dot printline bright categorizes

780
00:37:00.639 --> 00:37:02.760
<v Speaker 2>the numerical reading into meaningful text.

781
00:37:02.559 --> 00:37:05.719
<v Speaker 1>Output, turning numbers into words. And the final example using

782
00:37:05.719 --> 00:37:09.000
<v Speaker 1>serial communication lets you actually control an LED from your

783
00:37:09.000 --> 00:37:09.800
<v Speaker 1>computer keyboard.

784
00:37:10.239 --> 00:37:12.960
<v Speaker 2>Yes, that project shows how you can use serial dot

785
00:37:13.000 --> 00:37:16.559
<v Speaker 2>available and serial dot read inside your loop. You check

786
00:37:16.599 --> 00:37:19.159
<v Speaker 2>if the user has typed something into the serial monitor's

787
00:37:19.199 --> 00:37:22.280
<v Speaker 2>input bar and hit send. If they have, you read

788
00:37:22.280 --> 00:37:25.320
<v Speaker 2>the character they sent. If the character is, say one,

789
00:37:25.880 --> 00:37:28.360
<v Speaker 2>the code sees that and uses digital right to turn

790
00:37:28.400 --> 00:37:30.760
<v Speaker 2>an LED on. If the character is a role on it,

791
00:37:30.760 --> 00:37:31.800
<v Speaker 2>it turns the LED off.

792
00:37:31.960 --> 00:37:34.840
<v Speaker 1>F That's really cool building a simple remote control interface

793
00:37:35.079 --> 00:37:36.559
<v Speaker 1>just using the serial monitor.

794
00:37:36.840 --> 00:37:39.840
<v Speaker 2>It's a simple but powerful demonstration of two way communication

795
00:37:39.920 --> 00:37:42.639
<v Speaker 2>between your computer and the physical world via the arduino.

796
00:37:42.960 --> 00:37:45.480
<v Speaker 1>The source also quickly mentions a couple of other useful

797
00:37:45.519 --> 00:37:49.199
<v Speaker 1>built in math related functions. Yeah, map and constraint.

798
00:37:49.239 --> 00:37:52.360
<v Speaker 2>Yeah, those are super handy. Utility functions map value from

799
00:37:52.440 --> 00:37:54.480
<v Speaker 2>low to high to low. A high takes a number

800
00:37:54.480 --> 00:37:56.599
<v Speaker 2>of value that's within one range from load to from

801
00:37:56.679 --> 00:37:59.000
<v Speaker 2>high and mathematically scales it to fit within a different

802
00:37:59.079 --> 00:38:00.000
<v Speaker 2>range to low to high.

803
00:38:00.360 --> 00:38:02.639
<v Speaker 1>Oh like taking that zero one to two three analog

804
00:38:02.719 --> 00:38:05.159
<v Speaker 1>read result and scaling it down to the zero two

805
00:38:05.199 --> 00:38:07.119
<v Speaker 1>five to five range needed for analog.

806
00:38:06.880 --> 00:38:10.719
<v Speaker 2>Right exactly, that's a perfect use case. Map sensor of

807
00:38:10.800 --> 00:38:13.920
<v Speaker 2>value zero one seria three zero two fifty five saves

808
00:38:13.960 --> 00:38:18.000
<v Speaker 2>you doing the proportional math yourself and constrain value lower

809
00:38:18.039 --> 00:38:20.559
<v Speaker 2>bound upperbound is simple. It just makes sure a number

810
00:38:20.559 --> 00:38:23.519
<v Speaker 2>stays within a specific minimum and maximum limit. If the

811
00:38:23.639 --> 00:38:26.840
<v Speaker 2>value is below lower bound, it returns lower bound. If

812
00:38:26.880 --> 00:38:29.800
<v Speaker 2>it's above upper bound, it returns upper bound. Otherwise it

813
00:38:29.880 --> 00:38:32.840
<v Speaker 2>just returns the original value. Useful for keeping things within

814
00:38:32.960 --> 00:38:34.280
<v Speaker 2>safe operating.

815
00:38:33.880 --> 00:38:37.679
<v Speaker 1>Ranges, handy shortcuts, and it mentions their whole other categories too,

816
00:38:37.760 --> 00:38:40.280
<v Speaker 1>like math character random number functions.

817
00:38:40.360 --> 00:38:43.559
<v Speaker 2>Right, the Arduino API is quite rich. Once you start exploring.

818
00:38:43.880 --> 00:38:46.760
<v Speaker 1>You also touched on the serial communication as dealing with

819
00:38:47.079 --> 00:38:49.920
<v Speaker 1>a stream of data. The source goes a bit deeper

820
00:38:49.920 --> 00:38:54.639
<v Speaker 1>into working with text data, specifically strings and the stream concept.

821
00:38:54.679 --> 00:38:55.599
<v Speaker 1>What's that about?

822
00:38:55.960 --> 00:38:59.519
<v Speaker 2>Conceptually, the stream class in Arduino programming represents a flow

823
00:38:59.519 --> 00:39:01.880
<v Speaker 2>of data coming in or going out sequentially, like a

824
00:39:01.920 --> 00:39:04.000
<v Speaker 2>stream of characters or bites from a source like the

825
00:39:04.000 --> 00:39:07.360
<v Speaker 2>serial port or a file or network connection, and strings

826
00:39:07.360 --> 00:39:10.719
<v Speaker 2>are fundamental when you're dealing with text within that stream

827
00:39:10.800 --> 00:39:11.639
<v Speaker 2>or just in your program.

828
00:39:11.679 --> 00:39:15.199
<v Speaker 1>Generally, what exactly is a string in this context? Is

829
00:39:15.199 --> 00:39:17.400
<v Speaker 1>it like the string object in other languages.

830
00:39:17.519 --> 00:39:20.519
<v Speaker 2>Are Duino supports two main ways of handling strings. There's

831
00:39:20.559 --> 00:39:23.039
<v Speaker 2>the string object, which is easier to use for beginners.

832
00:39:23.039 --> 00:39:26.159
<v Speaker 2>You can concatenate them with plus said, et cetera, but

833
00:39:26.239 --> 00:39:29.239
<v Speaker 2>it can use more memory and potentially cause issues on

834
00:39:29.320 --> 00:39:33.559
<v Speaker 2>small micro controllers. The more fundamental way, inherited from CC

835
00:39:33.639 --> 00:39:36.960
<v Speaker 2>plus plus day is using character arrays, often called Sea

836
00:39:36.960 --> 00:39:38.159
<v Speaker 2>style strings.

837
00:39:38.000 --> 00:39:41.119
<v Speaker 1>So like charm my message hello exactly.

838
00:39:41.679 --> 00:39:45.119
<v Speaker 2>The source defines these Sea style strings as basically a

839
00:39:45.239 --> 00:39:48.199
<v Speaker 2>rays of characters. They are stored one character after another

840
00:39:48.239 --> 00:39:51.599
<v Speaker 2>in memory, and crucially, they end with a special invisible

841
00:39:51.639 --> 00:39:54.360
<v Speaker 2>character called the null character, which is written as zaguro

842
00:39:54.679 --> 00:39:57.400
<v Speaker 2>to mark the actual end of the string within the array.

843
00:39:57.639 --> 00:40:00.159
<v Speaker 1>So text is just stored as a list of character

844
00:40:00.320 --> 00:40:01.360
<v Speaker 1>ending with a special marker.

845
00:40:01.519 --> 00:40:04.480
<v Speaker 2>Essentially yes for seestyle strings, and the serial object we've

846
00:40:04.480 --> 00:40:07.760
<v Speaker 2>been talking about is a practical implementation a derivative class

847
00:40:08.039 --> 00:40:12.280
<v Speaker 2>in programming terms of that general stream concept. It's specifically

848
00:40:12.360 --> 00:40:15.360
<v Speaker 2>tailored for sending and receiving streams of bites or characters

849
00:40:15.400 --> 00:40:18.320
<v Speaker 2>over the serial connection like the USB cable to your computer.

850
00:40:18.599 --> 00:40:21.599
<v Speaker 1>It's the specialized tool that handles that flow of characters

851
00:40:21.639 --> 00:40:24.880
<v Speaker 1>between the board and the computer's serial monitor exactly.

852
00:40:24.920 --> 00:40:27.840
<v Speaker 2>So when the source revisits cerial functions like serial dot begin,

853
00:40:28.000 --> 00:40:31.320
<v Speaker 2>serial dot print, cereal dot printal N, and cereal dot read,

854
00:40:31.679 --> 00:40:34.280
<v Speaker 2>it's helpful to think of them as methods for interacting

855
00:40:34.320 --> 00:40:37.639
<v Speaker 2>with this data stream. It also mentions other useful stream

856
00:40:37.760 --> 00:40:41.400
<v Speaker 2>serial functions like serial dot available, which we discuss checks

857
00:40:41.400 --> 00:40:43.960
<v Speaker 2>if there's data waiting in the incoming stream. Any of

858
00:40:43.960 --> 00:40:47.519
<v Speaker 2>those for reading, Yeah, cereal dot parsent and cereal dot

859
00:40:47.559 --> 00:40:50.480
<v Speaker 2>parsefloat are handy. They try to read through the incoming

860
00:40:50.559 --> 00:40:53.199
<v Speaker 2>stream until they find and parse out a valid integer

861
00:40:53.320 --> 00:40:56.519
<v Speaker 2>or a floating point number, skipping any non numeric characters

862
00:40:56.519 --> 00:40:59.000
<v Speaker 2>of for it saves you reading characters one by one

863
00:40:59.039 --> 00:41:02.719
<v Speaker 2>and converting them yourself, And cereal dot peak lets you

864
00:41:02.760 --> 00:41:05.119
<v Speaker 2>look at the next character in the incoming stream without

865
00:41:05.159 --> 00:41:08.360
<v Speaker 2>actually removing it from the stream, which can sometimes be useful.

866
00:41:08.760 --> 00:41:12.119
<v Speaker 1>So working with text inputs or outputs socially over cereal

867
00:41:12.559 --> 00:41:17.039
<v Speaker 1>really relies on understanding either character arrays c strings or

868
00:41:17.079 --> 00:41:20.559
<v Speaker 1>the string object and using the right ceial stream functions

869
00:41:20.599 --> 00:41:22.119
<v Speaker 1>to read and write that data.

870
00:41:22.239 --> 00:41:25.639
<v Speaker 2>That's the pathway for text communication between your arduino and

871
00:41:25.719 --> 00:41:29.440
<v Speaker 2>another device like your computer. Mastering serial is key for

872
00:41:29.639 --> 00:41:32.519
<v Speaker 2>debugging and for many interactive projects.

873
00:41:32.559 --> 00:41:35.079
<v Speaker 1>Wow, that was a fantastic tour through the essentials of

874
00:41:35.119 --> 00:41:36.719
<v Speaker 1>our dueno. We really covered a lot.

875
00:41:36.840 --> 00:41:39.280
<v Speaker 2>We did cover quite a bit of ground, from understanding

876
00:41:39.280 --> 00:41:43.639
<v Speaker 2>what our dueno is, it's very accessible history and the

877
00:41:43.760 --> 00:41:46.039
<v Speaker 2>key advantages that really made it so popular, the.

878
00:41:46.039 --> 00:41:48.119
<v Speaker 1>Cost, the open source nature, cross.

879
00:41:47.800 --> 00:41:51.159
<v Speaker 2>Platform exactly, then figuring out how to pick your first

880
00:41:51.159 --> 00:41:53.239
<v Speaker 2>board based on what you actually want to do with it.

881
00:41:53.320 --> 00:41:55.960
<v Speaker 1>We dove into setting up the software, writing your first

882
00:41:56.239 --> 00:41:59.639
<v Speaker 1>sketch love that term, with the essential setup and loop functions,

883
00:41:59.800 --> 00:42:03.960
<v Speaker 1>and walking through that fundamental blinking led example line by line.

884
00:42:04.480 --> 00:42:07.239
<v Speaker 1>Even touched on basic troubleshooting if it doesn't work first

885
00:42:07.280 --> 00:42:07.880
<v Speaker 1>time yep.

886
00:42:08.360 --> 00:42:11.960
<v Speaker 2>And we explored the building blocks of writing the code itself,

887
00:42:12.440 --> 00:42:17.440
<v Speaker 2>adding comments for clarity understanding different data types like int, float, boolean,

888
00:42:17.960 --> 00:42:21.480
<v Speaker 2>and using operators for math and comparisons, remembering that crucial

889
00:42:21.559 --> 00:42:22.440
<v Speaker 2>versus difference.

890
00:42:22.800 --> 00:42:25.840
<v Speaker 1>Don't forget controlling the flow of your program with Eiffel's

891
00:42:25.920 --> 00:42:30.519
<v Speaker 1>decisions and wildfoar loops for repetition, and grouping data efficiently

892
00:42:30.519 --> 00:42:34.000
<v Speaker 1>with a raise, always remembering that tricky zero indexing right.

893
00:42:34.079 --> 00:42:36.400
<v Speaker 2>And we saw the power of creating your own reusable

894
00:42:36.440 --> 00:42:39.599
<v Speaker 2>functions to keep your code organized and avoid copy pasting.

895
00:42:39.800 --> 00:42:43.199
<v Speaker 2>Plus how to leverage our duenos built in API functions,

896
00:42:43.239 --> 00:42:47.119
<v Speaker 2>the really important ones like digital read digital right, analog

897
00:42:47.199 --> 00:42:50.480
<v Speaker 2>read for sensors, analog right for PWOM, control.

898
00:42:50.239 --> 00:42:53.199
<v Speaker 1>Sommudicating back and forth of your computer using the serial monitor,

899
00:42:53.400 --> 00:42:56.480
<v Speaker 1>including handling strings, and the whole concept of the serial

900
00:42:56.559 --> 00:42:57.039
<v Speaker 1>data stream.

901
00:42:57.199 --> 00:43:00.559
<v Speaker 2>So, based on this deep dive into your material, I

902
00:43:00.559 --> 00:43:02.840
<v Speaker 2>think the most important takeaway is probably that the absolute

903
00:43:02.840 --> 00:43:05.199
<v Speaker 2>best way to learn this stuff is by doing. Get

904
00:43:05.239 --> 00:43:07.760
<v Speaker 2>your hands on a board, even a cheap clone to start.

905
00:43:09.079 --> 00:43:11.679
<v Speaker 2>Try those examples, tweak the code, mess around with it,

906
00:43:11.719 --> 00:43:14.039
<v Speaker 2>see what happens. Break it. That's honestly how you learn

907
00:43:14.079 --> 00:43:16.039
<v Speaker 2>a lot of the time, and then figure out how

908
00:43:16.079 --> 00:43:16.519
<v Speaker 2>to fix it.

909
00:43:16.760 --> 00:43:19.679
<v Speaker 1>And you are absolutely not alone in this journey. The

910
00:43:19.760 --> 00:43:24.239
<v Speaker 1>source really highlights the incredible Arduino community online forums, websites

911
00:43:24.320 --> 00:43:28.559
<v Speaker 1>packed with projects and tutorials, YouTube channels, plus local resources

912
00:43:28.599 --> 00:43:31.199
<v Speaker 1>like maybe a hobby shop or even books from the library.

913
00:43:31.800 --> 00:43:34.199
<v Speaker 1>Don't ever hesitate to look for health or inspiration.

914
00:43:34.599 --> 00:43:39.199
<v Speaker 2>Definitely and start small. That blinking led is simple for

915
00:43:39.239 --> 00:43:43.199
<v Speaker 2>a reason. Master basic inputs like buttons and simple sensors

916
00:43:43.239 --> 00:43:46.480
<v Speaker 2>and basic outputs like LEDs and maybe small motors or

917
00:43:46.519 --> 00:43:51.039
<v Speaker 2>buzzers before you tackle, you know, complex robotics or network

918
00:43:51.079 --> 00:43:54.239
<v Speaker 2>IoT projects. Build your confidence step by step.

919
00:43:54.400 --> 00:43:56.840
<v Speaker 1>It's true or do we know? Genuinely gives you the

920
00:43:56.840 --> 00:43:58.679
<v Speaker 1>power to take an idea that's just in your head

921
00:43:58.679 --> 00:44:01.360
<v Speaker 1>and make it physically happen in the real world using code.

922
00:44:01.800 --> 00:44:03.679
<v Speaker 1>So thinking about all the different things you could potentially

923
00:44:03.760 --> 00:44:06.480
<v Speaker 1>sense or read from the world around you, light temperature, motion,

924
00:44:06.599 --> 00:44:09.800
<v Speaker 1>button presses, commands from a computer, and all the different

925
00:44:09.840 --> 00:44:11.719
<v Speaker 1>things you could potentially control or make happen in the

926
00:44:11.760 --> 00:44:16.840
<v Speaker 1>world lights, sounds, motors sending data back. What simple, perhaps

927
00:44:16.960 --> 00:44:20.239
<v Speaker 1>unexpected or even playful interaction are you imagining building into

928
00:44:20.280 --> 00:44:21.840
<v Speaker 1>your very first Arduino project.
