WEBVTT

1
00:00:00.040 --> 00:00:01.840
<v Speaker 1>Welcome back to the deep dive, the place where we

2
00:00:01.879 --> 00:00:05.000
<v Speaker 1>take your source material and uh really turn it into

3
00:00:05.280 --> 00:00:07.759
<v Speaker 1>actionable insight tailored just for you.

4
00:00:08.039 --> 00:00:08.480
<v Speaker 2>That's right.

5
00:00:08.759 --> 00:00:13.199
<v Speaker 1>Today we're plunging into well, the fascinating world of micro.

6
00:00:13.039 --> 00:00:19.160
<v Speaker 2>Controllers, specifically using a source called arduinoworkshop dot pdf. Yeah exactly,

7
00:00:19.399 --> 00:00:24.199
<v Speaker 2>And our mission here really is to unpack the Orduno platform.

8
00:00:24.280 --> 00:00:26.839
<v Speaker 2>You know, understand what it is, how you work with it.

9
00:00:26.719 --> 00:00:28.559
<v Speaker 1>And see what you can actually build with it, right.

10
00:00:28.440 --> 00:00:32.200
<v Speaker 2>Absolutely, turn that technical info into hopefully some real inspiration

11
00:00:32.320 --> 00:00:33.039
<v Speaker 2>for your projects.

12
00:00:33.399 --> 00:00:36.840
<v Speaker 1>Think of this as you're like fast track to grasping

13
00:00:36.840 --> 00:00:39.920
<v Speaker 1>the basics and seeing the cool electronic possibilities that are

14
00:00:39.960 --> 00:00:45.399
<v Speaker 1>suddenly well possible. Okay, so first things first, the source

15
00:00:45.520 --> 00:00:48.320
<v Speaker 1>dives straight into Urdueno. Let's unpack that. What is an

16
00:00:48.399 --> 00:00:49.679
<v Speaker 1>Arduino fundamentally?

17
00:00:49.799 --> 00:00:53.399
<v Speaker 2>Right, The source defines it as a cheap, flexible, open

18
00:00:53.439 --> 00:00:55.039
<v Speaker 2>source microcontroller platform.

19
00:00:55.039 --> 00:00:57.880
<v Speaker 1>Okay, open source micro controller platform. That sounds important.

20
00:00:57.920 --> 00:00:59.759
<v Speaker 2>It is. It's not just one chip, it's a whole

21
00:00:59.799 --> 00:01:03.159
<v Speaker 2>sort of ecosystem really designed to make electronics.

22
00:01:02.560 --> 00:01:06.200
<v Speaker 1>Accessible accessible seems key, doesn't it? Making it easy for

23
00:01:06.400 --> 00:01:08.959
<v Speaker 1>well anyone hobbyists, artists.

24
00:01:08.640 --> 00:01:11.519
<v Speaker 2>Designers, Yeah, people who want to use electronics in homemade

25
00:01:11.519 --> 00:01:15.079
<v Speaker 2>projects without needing you know, an engineering degree.

26
00:01:14.680 --> 00:01:18.000
<v Speaker 1>Taking the scary complex stuff and making it friendly exactly.

27
00:01:18.400 --> 00:01:21.959
<v Speaker 2>And the platform bid is crucial too. It's about connecting

28
00:01:21.959 --> 00:01:24.359
<v Speaker 2>to the real world. How so, the source says, an

29
00:01:24.359 --> 00:01:30.719
<v Speaker 2>almost unlimited range of input and output add ons, sensors, indicators, displays, motors,

30
00:01:30.760 --> 00:01:31.239
<v Speaker 2>and more.

31
00:01:31.680 --> 00:01:35.719
<v Speaker 1>So it bridges your code to like physical things happening.

32
00:01:35.400 --> 00:01:37.760
<v Speaker 2>Precisely, sensing things, making things move.

33
00:01:37.920 --> 00:01:41.239
<v Speaker 1>Okay, so you've got the Arduino board the hardware, but

34
00:01:41.359 --> 00:01:44.599
<v Speaker 1>hardware needs instructions. Yeah, how do you tell it what

35
00:01:44.719 --> 00:01:45.040
<v Speaker 1>to do?

36
00:01:45.719 --> 00:01:49.519
<v Speaker 2>That's where the software comes in, the Ardueno Integrated Development Environment.

37
00:01:49.560 --> 00:01:51.519
<v Speaker 1>Or id IDA.

38
00:01:51.560 --> 00:01:54.000
<v Speaker 2>Install that on your computer, and that's where you write

39
00:01:54.000 --> 00:01:54.519
<v Speaker 2>what they call.

40
00:01:54.439 --> 00:01:56.359
<v Speaker 1>Sketches sketches like drawings.

41
00:01:56.719 --> 00:01:59.920
<v Speaker 2>Huh No, not quite, it's just their term for the programs.

42
00:02:00.120 --> 00:02:02.239
<v Speaker 2>Right for the Ardueno, you ride the sketch, then.

43
00:02:02.159 --> 00:02:04.840
<v Speaker 1>Send it to the board and the ide itself. It

44
00:02:04.879 --> 00:02:07.439
<v Speaker 1>looks pretty straightforward. The source compared it to a simple

45
00:02:07.560 --> 00:02:08.439
<v Speaker 1>word processor.

46
00:02:08.560 --> 00:02:11.759
<v Speaker 2>It really does, very deliberately simple. You've got your main

47
00:02:11.840 --> 00:02:12.360
<v Speaker 2>space for.

48
00:02:12.319 --> 00:02:14.800
<v Speaker 1>Typing code, and then men use and buttons.

49
00:02:14.879 --> 00:02:17.599
<v Speaker 2>Yeah, standard men use file edit, that kind of thing,

50
00:02:18.039 --> 00:02:21.479
<v Speaker 2>But the key icons are Verify and upload.

51
00:02:21.759 --> 00:02:23.599
<v Speaker 1>Verify checks for mistakes.

52
00:02:23.240 --> 00:02:25.800
<v Speaker 2>Yeap catches errors before you send the code saves a

53
00:02:25.840 --> 00:02:30.319
<v Speaker 2>lot of headache. And upload well, that sends the compiled

54
00:02:30.360 --> 00:02:33.280
<v Speaker 2>sketch over the USB cable to the Arduino board.

55
00:02:33.439 --> 00:02:35.199
<v Speaker 1>Those sound like the main buttons you'd hit.

56
00:02:35.520 --> 00:02:38.400
<v Speaker 2>Definitely you get very familiar with Verify and upload, Oh

57
00:02:38.520 --> 00:02:42.080
<v Speaker 2>and new open save the usuals, and the.

58
00:02:42.039 --> 00:02:45.879
<v Speaker 1>Source mentions something about comments in the code little notes.

59
00:02:45.719 --> 00:02:49.280
<v Speaker 2>Oh yeah, super important. Adding comments notes for yourself or

60
00:02:49.319 --> 00:02:51.599
<v Speaker 2>others makes your code way easier to understand when you

61
00:02:51.599 --> 00:02:53.800
<v Speaker 2>come back to it later, like leaving little sign posts.

62
00:02:53.919 --> 00:02:56.479
<v Speaker 1>Okay, makes sense, but you can't build much with just

63
00:02:56.599 --> 00:03:00.400
<v Speaker 1>the board and code, right. You need stuff component.

64
00:03:00.199 --> 00:03:04.080
<v Speaker 2>Exactly and the source covers the essentials. Resistors are usually

65
00:03:04.120 --> 00:03:05.240
<v Speaker 2>the first things you encounter.

66
00:03:05.360 --> 00:03:07.800
<v Speaker 1>The little components with the colored stripes.

67
00:03:07.879 --> 00:03:11.199
<v Speaker 2>Those are the ones they resist the flow of electricity

68
00:03:11.560 --> 00:03:12.879
<v Speaker 2>measured in omes.

69
00:03:12.599 --> 00:03:14.719
<v Speaker 1>And the stripes are a code for the value like

70
00:03:15.000 --> 00:03:17.080
<v Speaker 1>yellow violet orange.

71
00:03:16.919 --> 00:03:19.919
<v Speaker 2>Forty seven thousand ohms or forty seven k. Yeah, it's

72
00:03:19.960 --> 00:03:22.479
<v Speaker 2>a bit like learning a secret code. But essential and.

73
00:03:22.479 --> 00:03:25.000
<v Speaker 1>The tiny flat ones chip resistors.

74
00:03:24.560 --> 00:03:28.000
<v Speaker 2>They use number codes instead, like one O three means

75
00:03:28.159 --> 00:03:31.759
<v Speaker 2>ten followed by three zeros, so ten thousand oms or

76
00:03:31.840 --> 00:03:32.199
<v Speaker 2>ten k.

77
00:03:32.560 --> 00:03:34.680
<v Speaker 1>But the source says you can just measure.

78
00:03:34.400 --> 00:03:38.000
<v Speaker 2>Them best way. Honestly, a multimeter is your best friend

79
00:03:38.039 --> 00:03:40.439
<v Speaker 2>for checking resistance, especially if the stripes are hard to

80
00:03:40.439 --> 00:03:41.120
<v Speaker 2>read or.

81
00:03:41.080 --> 00:03:43.960
<v Speaker 1>You're just not sure okay resistors. What about actually connecting

82
00:03:44.000 --> 00:03:45.960
<v Speaker 1>things together before you solder.

83
00:03:45.919 --> 00:03:50.439
<v Speaker 2>Ah, The solderless breadboard a total game changer for prototyping.

84
00:03:50.719 --> 00:03:52.840
<v Speaker 1>Right the plastic block with all the holes.

85
00:03:53.080 --> 00:03:56.319
<v Speaker 2>You just push component legs and wires into the sockets.

86
00:03:56.719 --> 00:03:59.400
<v Speaker 2>The source shows how they're connected internally, columns in the middle,

87
00:03:59.479 --> 00:04:00.840
<v Speaker 2>rowse on the side typically, so.

88
00:04:00.800 --> 00:04:03.039
<v Speaker 1>You can wire things up, test them, change them.

89
00:04:02.919 --> 00:04:06.960
<v Speaker 2>All without any permanent soldering. Yeah. Perfect for trying ideas out.

90
00:04:07.039 --> 00:04:11.360
<v Speaker 1>What about components that control the flow? Not just resistant

91
00:04:11.680 --> 00:04:12.719
<v Speaker 1>diodes are key there.

92
00:04:12.919 --> 00:04:15.520
<v Speaker 2>The basic rectifier diode acts like a one way street.

93
00:04:15.240 --> 00:04:18.360
<v Speaker 1>For current, a node to cathode blocks the other way. Simple.

94
00:04:19.240 --> 00:04:22.240
<v Speaker 2>Then you have transistors. The source mentions the BC five

95
00:04:22.319 --> 00:04:22.759
<v Speaker 2>forty eight.

96
00:04:23.000 --> 00:04:27.399
<v Speaker 1>I always think of them as tiny electronic switches or amplifiers.

97
00:04:27.639 --> 00:04:29.519
<v Speaker 2>That's a great way to think about it. The arduino

98
00:04:29.639 --> 00:04:35.360
<v Speaker 2>pins themselves can't handle much power. Maybe twenty forty milliamps.

99
00:04:34.959 --> 00:04:37.360
<v Speaker 1>Not enough for a motor or bright lights.

100
00:04:37.279 --> 00:04:40.160
<v Speaker 2>Exactly, so you use a transistor. The arduino sends a

101
00:04:40.199 --> 00:04:42.439
<v Speaker 2>small signal to the transistor's base pin.

102
00:04:42.480 --> 00:04:45.399
<v Speaker 1>And that controls a bigger current flowing through the transistor's

103
00:04:45.399 --> 00:04:46.519
<v Speaker 1>other pins.

104
00:04:46.120 --> 00:04:49.439
<v Speaker 2>Precisely the BC five forty eight, the source says, can

105
00:04:49.439 --> 00:04:51.800
<v Speaker 2>switch up to one hundred million amps at thirty volts,

106
00:04:52.600 --> 00:04:54.639
<v Speaker 2>way more than the arduino pin alone.

107
00:04:54.759 --> 00:04:56.800
<v Speaker 1>And relays do something similar but differently.

108
00:04:56.879 --> 00:05:00.360
<v Speaker 2>Yeah, relays use an electromagnet to flick a physical switch inside.

109
00:05:00.439 --> 00:05:03.199
<v Speaker 2>The big advantage, the source points out is electrical isolation,

110
00:05:03.600 --> 00:05:07.160
<v Speaker 2>meaning the circuit controlling the relay coil is completely separate

111
00:05:07.160 --> 00:05:10.680
<v Speaker 2>from the circuit being switched. Safer for controlling say mains

112
00:05:10.759 --> 00:05:12.480
<v Speaker 2>voltage or high current.

113
00:05:12.319 --> 00:05:14.519
<v Speaker 1>DC loads, protects the arden know right.

114
00:05:14.879 --> 00:05:17.600
<v Speaker 2>The example circuit shows using a transistor to drive the

115
00:05:17.680 --> 00:05:21.000
<v Speaker 2>relay coil and importantly a diode across the coil to

116
00:05:21.040 --> 00:05:22.959
<v Speaker 2>handle voltage spikes when it switches off.

117
00:05:23.040 --> 00:05:27.800
<v Speaker 1>Okay. One more basic component capacitors, especially the electrolytic ones.

118
00:05:28.600 --> 00:05:32.079
<v Speaker 2>The source mentions these for storing large amounts of electrical charge.

119
00:05:32.519 --> 00:05:35.639
<v Speaker 2>Electrolytics are polarized. They have a plus and minus side

120
00:05:35.680 --> 00:05:36.519
<v Speaker 2>you must get right?

121
00:05:36.560 --> 00:05:37.600
<v Speaker 1>And what are they used for?

122
00:05:38.199 --> 00:05:42.120
<v Speaker 2>Often for smoothing out fluctuations in power supply voltage or

123
00:05:42.160 --> 00:05:44.360
<v Speaker 2>providing a quick burst of energy like when a motor

124
00:05:44.399 --> 00:05:46.160
<v Speaker 2>starts up. They add stability.

125
00:05:46.319 --> 00:05:50.040
<v Speaker 1>Okay, components breadboard, But if you have a complex circuit,

126
00:05:50.160 --> 00:05:53.399
<v Speaker 1>just looking at the physical layout can be confusing. How

127
00:05:53.439 --> 00:05:55.560
<v Speaker 1>do people share circuit designs cleanly?

128
00:05:55.920 --> 00:05:59.920
<v Speaker 2>That's where schematic diagrams or circuit diagrams come in essential.

129
00:06:00.439 --> 00:06:03.000
<v Speaker 2>The Source calls them a visual language.

130
00:06:02.519 --> 00:06:05.360
<v Speaker 1>Instead of wires. Everywhere you use symbols exactly.

131
00:06:05.399 --> 00:06:08.000
<v Speaker 2>Once you learn the symbols, you can understand the logic

132
00:06:08.040 --> 00:06:09.399
<v Speaker 2>of the circuit no matter how it's.

133
00:06:09.279 --> 00:06:12.319
<v Speaker 1>Physically built, like the zigzag line for a resistor.

134
00:06:12.120 --> 00:06:14.959
<v Speaker 2>Or the triangle and bar for a diode. The triangle

135
00:06:15.000 --> 00:06:16.399
<v Speaker 2>points the way current flows.

136
00:06:16.160 --> 00:06:19.800
<v Speaker 1>Easily, and an led is that diode symbol with little

137
00:06:19.920 --> 00:06:20.920
<v Speaker 1>arrows pointing.

138
00:06:20.600 --> 00:06:23.480
<v Speaker 2>Out showing it gives off light. Yeah, transistors have their

139
00:06:23.480 --> 00:06:27.000
<v Speaker 2>own symbols showing collector base, emmetter, the aero direction tells

140
00:06:27.040 --> 00:06:28.199
<v Speaker 2>you if it's NPN or P and.

141
00:06:28.199 --> 00:06:29.680
<v Speaker 1>P type capacitors.

142
00:06:29.839 --> 00:06:32.639
<v Speaker 2>Other chips, they all have standard symbols. Learning them is

143
00:06:32.680 --> 00:06:34.959
<v Speaker 2>like learning the alphabet of electronics. It lets you read

144
00:06:35.040 --> 00:06:36.120
<v Speaker 2>and share ideas clearly.

145
00:06:36.240 --> 00:06:39.600
<v Speaker 1>All right, hardware diagrams. Let's get into the code side

146
00:06:39.680 --> 00:06:41.399
<v Speaker 1>the sketches. How are they structured?

147
00:06:41.720 --> 00:06:46.680
<v Speaker 2>Super simple? Actually, every Ardueno sketch must have two main parts,

148
00:06:46.959 --> 00:06:49.839
<v Speaker 2>two functions, void setup and void loop.

149
00:06:50.199 --> 00:06:51.680
<v Speaker 1>Set up and loop. What do they do?

150
00:06:51.879 --> 00:06:54.680
<v Speaker 2>Set up runs only once right when the Arduino starts

151
00:06:54.680 --> 00:06:57.920
<v Speaker 2>out for your press reset. It's for initialization, setting up pins,

152
00:06:57.959 --> 00:07:01.000
<v Speaker 2>starting communications, that sort of thing, and runs over and

153
00:07:01.040 --> 00:07:04.519
<v Speaker 2>over and over again continuously after setup finishes. This is

154
00:07:04.519 --> 00:07:07.040
<v Speaker 2>where the main logic of your program lives. The repeating

155
00:07:07.040 --> 00:07:08.040
<v Speaker 2>actions makes sense.

156
00:07:08.279 --> 00:07:11.399
<v Speaker 1>Set up once, then loop forever. How do you actually

157
00:07:11.399 --> 00:07:14.560
<v Speaker 1>control the Arduino's pins from the code.

158
00:07:14.439 --> 00:07:16.800
<v Speaker 2>There are a few core functions. First, in set up,

159
00:07:17.120 --> 00:07:20.600
<v Speaker 2>use the pin mode pin number in PP two output.

160
00:07:20.560 --> 00:07:22.720
<v Speaker 1>Tells the pin whether it's listening or talking.

161
00:07:22.560 --> 00:07:25.959
<v Speaker 2>Basically yeah on input TT for reading sensors or buttons

162
00:07:26.000 --> 00:07:28.879
<v Speaker 2>outpu'd for controlling LEDs or motors. And then in the

163
00:07:28.920 --> 00:07:32.639
<v Speaker 2>loop you use digital right pin number AGH or digital

164
00:07:32.680 --> 00:07:36.240
<v Speaker 2>right pin number l LOW to turn it OUTPTPN on

165
00:07:36.480 --> 00:07:39.920
<v Speaker 2>that's five volts or off a zoo volts okay soup

166
00:07:40.079 --> 00:07:42.800
<v Speaker 2>on and to read an n NPT pin you use

167
00:07:42.879 --> 00:07:44.720
<v Speaker 2>digital read pin number. It tells you if the pin

168
00:07:44.800 --> 00:07:46.279
<v Speaker 2>is currently high GH or LOA W.

169
00:07:46.600 --> 00:07:50.279
<v Speaker 1>What if you want something in between, like dimming an led,

170
00:07:50.480 --> 00:07:51.279
<v Speaker 1>not just on off?

171
00:07:51.439 --> 00:07:54.959
<v Speaker 2>Ah? Good question, that's analog right now, The source explains

172
00:07:55.000 --> 00:07:56.600
<v Speaker 2>it's not true analog voltage.

173
00:07:56.720 --> 00:07:57.800
<v Speaker 1>Now what is it? Then?

174
00:07:58.040 --> 00:08:02.639
<v Speaker 2>It's called pulse width modulation or EM. On special pins

175
00:08:02.720 --> 00:08:05.279
<v Speaker 2>often marked with a little squiggle, the RDWINO turns the

176
00:08:05.319 --> 00:08:07.839
<v Speaker 2>pin on and off really really fast, okay, By changing

177
00:08:07.839 --> 00:08:10.439
<v Speaker 2>the percentage of time the pin is on versus off

178
00:08:10.439 --> 00:08:13.120
<v Speaker 2>the duty cycle, it fakes an average voltage level.

179
00:08:13.399 --> 00:08:16.439
<v Speaker 1>Clever, so you can control brightness that way exactly, or

180
00:08:16.480 --> 00:08:18.920
<v Speaker 1>even make tones on a piezo buzzer by varying the

181
00:08:18.959 --> 00:08:22.199
<v Speaker 1>PWM signal rapidly. And can you read analog values too,

182
00:08:22.360 --> 00:08:23.199
<v Speaker 1>not just high low?

183
00:08:23.439 --> 00:08:28.079
<v Speaker 2>Yes? With analog read pin number, you use the dedicated

184
00:08:28.120 --> 00:08:30.439
<v Speaker 2>analog input pins like a zero to.

185
00:08:30.399 --> 00:08:32.960
<v Speaker 1>A five on an unoboard, and it gives you.

186
00:08:33.200 --> 00:08:36.159
<v Speaker 2>A number between zero and twenty three three. That number

187
00:08:36.200 --> 00:08:39.519
<v Speaker 2>represents the voltage measured on the pin from zero V

188
00:08:39.879 --> 00:08:43.919
<v Speaker 2>up to the ardueno's reference voltage usually five VE. Perfect

189
00:08:43.919 --> 00:08:44.639
<v Speaker 2>for reading.

190
00:08:44.399 --> 00:08:48.000
<v Speaker 1>Sensors timing seems important. How do you make the Arduino

191
00:08:48.159 --> 00:08:49.519
<v Speaker 1>weight or measure time?

192
00:08:49.720 --> 00:08:54.200
<v Speaker 2>The simplest way is delay milliseconds just pauses everything for

193
00:08:54.240 --> 00:08:54.879
<v Speaker 2>that amount.

194
00:08:54.600 --> 00:08:55.960
<v Speaker 1>Of time, stops the whole program.

195
00:08:56.080 --> 00:08:58.960
<v Speaker 2>Yeah, which can be a problem sometimes. So the source

196
00:08:59.039 --> 00:09:01.120
<v Speaker 2>introduces milli and micros.

197
00:09:01.200 --> 00:09:01.720
<v Speaker 1>What did he do?

198
00:09:01.799 --> 00:09:05.559
<v Speaker 2>They return the number of milliseconds millis or microseconds micros

199
00:09:05.600 --> 00:09:07.799
<v Speaker 2>that have passed since the Arduena boards started running.

200
00:09:07.840 --> 00:09:09.039
<v Speaker 1>How's that different from delay?

201
00:09:09.279 --> 00:09:12.039
<v Speaker 2>Crucially, they don't stop your code. You can check Millie's

202
00:09:12.240 --> 00:09:13.919
<v Speaker 2>see how much time has passed and decide if it's

203
00:09:13.919 --> 00:09:17.279
<v Speaker 2>time to do something without halting everything else. Great for multitasking.

204
00:09:17.440 --> 00:09:20.320
<v Speaker 1>Okay. To handle data, you need variables. The source mentions

205
00:09:20.320 --> 00:09:20.840
<v Speaker 1>the basics.

206
00:09:20.919 --> 00:09:24.679
<v Speaker 2>Right, you've got info integers, whole numbers, float for numbers

207
00:09:24.679 --> 00:09:27.120
<v Speaker 2>with decimal points, really useful for sensor math.

208
00:09:27.120 --> 00:09:30.799
<v Speaker 1>Like converting a sensor reading to degrees celsius exactly.

209
00:09:31.120 --> 00:09:34.759
<v Speaker 2>Then booleon for simple tru or false values. And byte

210
00:09:34.960 --> 00:09:37.639
<v Speaker 2>which holds a small number from zero to two fifty five,

211
00:09:37.879 --> 00:09:39.399
<v Speaker 2>often used for binary data.

212
00:09:39.440 --> 00:09:42.080
<v Speaker 1>And you can mix types like int and float yep.

213
00:09:42.120 --> 00:09:45.279
<v Speaker 2>The source nodes you can do calculations mixing them. Ardueno

214
00:09:45.360 --> 00:09:46.639
<v Speaker 2>handles the conversion.

215
00:09:46.399 --> 00:09:50.080
<v Speaker 1>Standard mass is there plus minus multiplied divide.

216
00:09:49.639 --> 00:09:52.360
<v Speaker 2>For basic arithmetic operators, but you also need way to

217
00:09:52.360 --> 00:09:53.480
<v Speaker 2>compare values, like.

218
00:09:53.480 --> 00:09:56.240
<v Speaker 1>Checking if a sensor reading is above a threshold exactly.

219
00:09:56.360 --> 00:09:59.759
<v Speaker 2>You use comparison operators here for equals for not, equals

220
00:09:59.759 --> 00:10:02.039
<v Speaker 2>great than, less than and so on.

221
00:10:02.000 --> 00:10:04.440
<v Speaker 1>And combining conditions like is this nd.

222
00:10:04.440 --> 00:10:07.519
<v Speaker 2>That logical operators do that for not and for and

223
00:10:07.600 --> 00:10:11.639
<v Speaker 2>d for r lets you build complex decision logic, which.

224
00:10:11.399 --> 00:10:14.879
<v Speaker 1>Brings us to control flow, making the program make decisions

225
00:10:14.960 --> 00:10:15.799
<v Speaker 1>or repeat things.

226
00:10:16.000 --> 00:10:19.399
<v Speaker 2>The is statement is the cornerstone. If this condition is true,

227
00:10:19.919 --> 00:10:22.799
<v Speaker 2>then run this block of code simpler. Then if LS

228
00:10:22.799 --> 00:10:25.480
<v Speaker 2>adds an alternative if the condition is true, do this.

229
00:10:25.799 --> 00:10:29.720
<v Speaker 2>Otherwise do that class example, checking if a button digital

230
00:10:29.720 --> 00:10:30.799
<v Speaker 2>read is AGH.

231
00:10:31.120 --> 00:10:32.879
<v Speaker 1>And for repeating stuff loops.

232
00:10:33.279 --> 00:10:35.080
<v Speaker 2>For loops are great when you know how many times

233
00:10:35.120 --> 00:10:37.960
<v Speaker 2>you need to repeat, like flashing in LED five times.

234
00:10:38.600 --> 00:10:42.440
<v Speaker 2>The LED wave project uses this. Okay, wile and do

235
00:10:42.519 --> 00:10:44.960
<v Speaker 2>wile loops keep repeating as long as a certain condition

236
00:10:45.039 --> 00:10:48.720
<v Speaker 2>remains true. The source mentions do wile for the Electronic

237
00:10:48.799 --> 00:10:52.200
<v Speaker 2>Dye project because it guarantees the code inside runs at

238
00:10:52.279 --> 00:10:53.200
<v Speaker 2>least once before.

239
00:10:53.120 --> 00:10:56.120
<v Speaker 1>Checking useful sometimes and switch case it's a.

240
00:10:56.120 --> 00:10:59.639
<v Speaker 2>Neat way to handle multiple specific possibilities for a variable's value,

241
00:11:00.080 --> 00:11:03.639
<v Speaker 2>cleaner than a bunch of nested IFL statements. Sometimes good

242
00:11:03.639 --> 00:11:05.960
<v Speaker 2>for reacting to different button presses or commands.

243
00:11:06.120 --> 00:11:08.480
<v Speaker 1>Lastly, functions grouping code.

244
00:11:08.559 --> 00:11:10.679
<v Speaker 2>Yeah. Functions let you bundle up a piece of code

245
00:11:10.679 --> 00:11:13.399
<v Speaker 2>that does a specific task, give it a name, and

246
00:11:13.440 --> 00:11:15.080
<v Speaker 2>then just call that name whenever you need it.

247
00:11:15.120 --> 00:11:16.480
<v Speaker 1>Avoids repeating code.

248
00:11:16.240 --> 00:11:19.200
<v Speaker 2>Exactly makes code cleaner easier to manage. You can even

249
00:11:19.240 --> 00:11:21.879
<v Speaker 2>create your own functions that take inputs and return a result,

250
00:11:22.360 --> 00:11:25.960
<v Speaker 2>like the sources example of converting temperature scales. Like building

251
00:11:26.039 --> 00:11:27.799
<v Speaker 2>your own custom Arduino commands.

252
00:11:27.840 --> 00:11:30.679
<v Speaker 1>Okay, so you're writing code testing things. How do you

253
00:11:30.720 --> 00:11:33.639
<v Speaker 1>actually see what the ardweno's thinking or send it commands

254
00:11:33.639 --> 00:11:34.399
<v Speaker 1>while it's running.

255
00:11:34.679 --> 00:11:38.039
<v Speaker 2>Ah, this serial monitor it's built right into the ardweno ID.

256
00:11:38.519 --> 00:11:40.840
<v Speaker 2>It's your communication channel over the USB.

257
00:11:40.720 --> 00:11:42.320
<v Speaker 1>Cable, so data goes both ways.

258
00:11:42.440 --> 00:11:46.519
<v Speaker 2>Yep. The arduino can send text or numbers to the

259
00:11:46.559 --> 00:11:48.480
<v Speaker 2>serial monitor window on your computer.

260
00:11:48.360 --> 00:11:50.919
<v Speaker 1>And you can type stuff into the monitor to send

261
00:11:50.919 --> 00:11:52.320
<v Speaker 1>it to the arduino exactly.

262
00:11:52.720 --> 00:11:55.240
<v Speaker 2>Super useful for debugging or simple interaction.

263
00:11:55.759 --> 00:11:57.600
<v Speaker 1>How do you set it up in the code in.

264
00:11:57.559 --> 00:12:00.440
<v Speaker 2>Your setup function. You start it with serial begin and

265
00:12:00.519 --> 00:12:03.399
<v Speaker 2>bod rate. The bod rate is the communication speed like

266
00:12:03.480 --> 00:12:05.200
<v Speaker 2>ninety six hundred bits per second.

267
00:12:05.240 --> 00:12:07.919
<v Speaker 1>And that speed has to match the setting in the

268
00:12:07.960 --> 00:12:09.159
<v Speaker 1>serial monitor window.

269
00:12:09.200 --> 00:12:12.159
<v Speaker 2>Itself critically important. Yes, they have to agree.

270
00:12:11.879 --> 00:12:14.600
<v Speaker 1>On the speed, and to send data from the ARDUINO.

271
00:12:14.440 --> 00:12:17.759
<v Speaker 2>You use cerial dot print for cereal dot print LN.

272
00:12:18.360 --> 00:12:20.480
<v Speaker 2>The only difference is print LIN adds a character, return

273
00:12:20.840 --> 00:12:22.600
<v Speaker 2>moves to the next line in the monitor.

274
00:12:22.279 --> 00:12:24.279
<v Speaker 1>So you can print messages, variable.

275
00:12:24.039 --> 00:12:27.600
<v Speaker 2>Values, anything. It's invaluable for seeing what's going on inside

276
00:12:27.600 --> 00:12:31.159
<v Speaker 2>your sketch. The source even shows formatting like serial dot

277
00:12:31.200 --> 00:12:34.480
<v Speaker 2>print number bi in to see the binary value.

278
00:12:34.600 --> 00:12:36.960
<v Speaker 1>And how does the ARDWENO know If you type something

279
00:12:37.000 --> 00:12:38.159
<v Speaker 1>into the monitor, it.

280
00:12:38.200 --> 00:12:41.519
<v Speaker 2>Checks using serial dot available. If that returns a value

281
00:12:41.519 --> 00:12:44.399
<v Speaker 2>greater than zero, it means there's data waiting to.

282
00:12:44.360 --> 00:12:46.919
<v Speaker 1>Be read, and you read it with cereal dot read.

283
00:12:47.399 --> 00:12:49.960
<v Speaker 2>It usually reads one character or bite at a time

284
00:12:50.000 --> 00:12:53.399
<v Speaker 2>from the incoming buffer. Project seventeen uses this for a

285
00:12:53.440 --> 00:12:57.080
<v Speaker 2>binary guessing game. Okay, the real magic happens when you

286
00:12:57.120 --> 00:12:59.879
<v Speaker 2>apply all this stuff in projects. The source walks through

287
00:12:59.879 --> 00:13:02.919
<v Speaker 2>a lot of examples that build skills progressively.

288
00:13:02.559 --> 00:13:04.519
<v Speaker 1>Like the classic blinking led.

289
00:13:04.679 --> 00:13:08.639
<v Speaker 2>Project hashtag one, Yeah, your basic digital right high gh

290
00:13:08.720 --> 00:13:12.720
<v Speaker 2>delay digital right LW delay the Hello world of hardware.

291
00:13:12.919 --> 00:13:16.240
<v Speaker 1>But then project hashtag two immediately improves it using a

292
00:13:16.279 --> 00:13:16.799
<v Speaker 1>for loop.

293
00:13:17.279 --> 00:13:20.399
<v Speaker 2>Shows how programming structures make code more elegant and efficient

294
00:13:20.440 --> 00:13:23.039
<v Speaker 2>for repetitive tasks like that LED wave effect.

295
00:13:23.120 --> 00:13:24.759
<v Speaker 1>Right, what about something using sensors?

296
00:13:24.840 --> 00:13:27.399
<v Speaker 2>Project hashtag eight the quick read thermometer that's the great

297
00:13:27.399 --> 00:13:30.080
<v Speaker 2>one uses analogreed to get data from a TMP thirty

298
00:13:30.120 --> 00:13:31.120
<v Speaker 2>six temperature sensor.

299
00:13:31.240 --> 00:13:32.480
<v Speaker 1>Doesn't just read it though, right.

300
00:13:32.440 --> 00:13:35.080
<v Speaker 2>No, it shows the whole process. Read the raw analog

301
00:13:35.159 --> 00:13:38.440
<v Speaker 2>value converted to voltage, then convert the voltage to degrees

302
00:13:38.440 --> 00:13:39.440
<v Speaker 2>celsius using a.

303
00:13:39.399 --> 00:13:42.240
<v Speaker 1>Formula, and then use that temperature value exactly.

304
00:13:42.480 --> 00:13:44.799
<v Speaker 2>Uses if all statements to light up different LEDs. Maybe

305
00:13:44.960 --> 00:13:48.480
<v Speaker 2>red for hot, green for normal, blue for cold. It's sensing,

306
00:13:48.600 --> 00:13:50.679
<v Speaker 2>processing and acting based on the environment.

307
00:13:51.200 --> 00:13:53.679
<v Speaker 1>Cool The electronic dye project sounds fun too.

308
00:13:53.840 --> 00:13:56.759
<v Speaker 2>Project hashtag fifteen Yeah uses the random function to pick

309
00:13:56.759 --> 00:13:59.600
<v Speaker 2>a number, lights up the corresponding LEDs, and it uses

310
00:13:59.600 --> 00:14:01.679
<v Speaker 2>that do t while one loop to keep the results

311
00:14:01.679 --> 00:14:04.440
<v Speaker 2>showing until you reset it. Neat demo of do while

312
00:14:05.080 --> 00:14:08.039
<v Speaker 2>The source also makes a point about binary base two numbers.

313
00:14:08.080 --> 00:14:08.559
<v Speaker 2>Why is that.

314
00:14:08.559 --> 00:14:13.320
<v Speaker 1>Important because computers, including the Arduino think in ones and zos. Fundamentally.

315
00:14:13.919 --> 00:14:16.720
<v Speaker 1>Understanding binary helps when you work with data at a

316
00:14:16.759 --> 00:14:17.639
<v Speaker 1>lower level, like.

317
00:14:17.600 --> 00:14:20.320
<v Speaker 2>The byte variable type zero to two fifty five.

318
00:14:20.279 --> 00:14:23.440
<v Speaker 1>Exactly, that's eight bits. The source shows how to print

319
00:14:23.480 --> 00:14:27.320
<v Speaker 1>values in binary using serial dot print value BIM, and

320
00:14:27.440 --> 00:14:29.759
<v Speaker 1>introduces bitwise operators.

321
00:14:29.200 --> 00:14:34.039
<v Speaker 2>Bit wise like A and D or x or xo,

322
00:14:34.320 --> 00:14:37.440
<v Speaker 2>and also bit shifting. These let you manipulate individual bits

323
00:14:37.480 --> 00:14:40.240
<v Speaker 2>within a byte or integer. Sounds obscure, but it's crucial

324
00:14:40.240 --> 00:14:43.360
<v Speaker 2>when interfacing with certain chips are packing data efficiently. Project

325
00:14:43.399 --> 00:14:46.000
<v Speaker 2>seventeen's guessing game makes learning it fun okay.

326
00:14:46.039 --> 00:14:49.759
<v Speaker 1>One common challenge Orduenos have a limited number of pins.

327
00:14:50.080 --> 00:14:52.679
<v Speaker 1>What if you need to control lots of outputs like

328
00:14:52.840 --> 00:14:55.200
<v Speaker 1>tons of LEDs AH shift registers.

329
00:14:55.799 --> 00:14:58.360
<v Speaker 2>The source highlights the seventy four HC five ninety five.

330
00:14:58.480 --> 00:14:59.440
<v Speaker 2>This is a classic solution.

331
00:14:59.559 --> 00:15:00.360
<v Speaker 1>How does it work?

332
00:15:00.559 --> 00:15:04.080
<v Speaker 2>You use just a feword winopins typically data latch and

333
00:15:04.200 --> 00:15:08.200
<v Speaker 2>kilock to send data serially into the shift register. The

334
00:15:08.279 --> 00:15:11.320
<v Speaker 2>register then shifts the data along internally and holds it

335
00:15:11.600 --> 00:15:14.159
<v Speaker 2>controlling many output pins, usually eight per.

336
00:15:14.120 --> 00:15:16.480
<v Speaker 1>Chip, so a few pins control many exactly.

337
00:15:16.759 --> 00:15:19.759
<v Speaker 2>You can even chain multiple shift registers together. The source

338
00:15:19.840 --> 00:15:22.320
<v Speaker 2>uses this for an eight y eight LED matrix. In

339
00:15:22.360 --> 00:15:25.519
<v Speaker 2>Project twenty one, just two shift registers control all sixty

340
00:15:25.519 --> 00:15:29.559
<v Speaker 2>four LEDs shows scrolling text two. It's a fundamental technique

341
00:15:29.600 --> 00:15:30.559
<v Speaker 2>for expanding outputs.

342
00:15:30.720 --> 00:15:33.519
<v Speaker 1>The source also mentions a arrays, what are they useful for.

343
00:15:33.440 --> 00:15:36.200
<v Speaker 2>Storing collections of related data. Instead of having say ten

344
00:15:36.240 --> 00:15:38.600
<v Speaker 2>separate temperature variables, you can have one array holding ten

345
00:15:38.639 --> 00:15:41.919
<v Speaker 2>temperature readings. Cleaner code useful for lists of sensor data,

346
00:15:42.039 --> 00:15:44.960
<v Speaker 2>RFID tags, pin numbers, et cetera. And the modulle operator

347
00:15:45.039 --> 00:15:46.879
<v Speaker 2>percent It seems specific.

348
00:15:47.039 --> 00:15:50.120
<v Speaker 1>It gives you the remainder after division. The source points

349
00:15:50.159 --> 00:15:52.919
<v Speaker 1>out it's handy for tasks like separating the digits of

350
00:15:52.919 --> 00:15:55.840
<v Speaker 1>a number like twenty three per ten. Ten gives you three.

351
00:15:56.320 --> 00:15:58.559
<v Speaker 1>Useful if you need to display digits individually.

352
00:15:59.120 --> 00:16:03.519
<v Speaker 2>Okay, moving beyond simil LEDs displaying actual text or numbers.

353
00:16:03.639 --> 00:16:07.399
<v Speaker 1>Liquid crystal displays or LCDs. The source covers the common

354
00:16:07.480 --> 00:16:10.799
<v Speaker 1>character LCDs like sixteen by two or twenty by four.

355
00:16:10.679 --> 00:16:12.080
<v Speaker 2>Characters requires special code.

356
00:16:12.200 --> 00:16:15.120
<v Speaker 1>Usually use a library like liquid crystal makes pretty easy.

357
00:16:15.519 --> 00:16:18.679
<v Speaker 1>You initialize it, then use commands like LCD dot print

358
00:16:19.159 --> 00:16:22.000
<v Speaker 1>or LCD dot set cursor column yeah row to position

359
00:16:22.080 --> 00:16:22.720
<v Speaker 1>the text.

360
00:16:22.559 --> 00:16:24.519
<v Speaker 2>And Project fifty eight uses this for a clock.

361
00:16:24.720 --> 00:16:27.240
<v Speaker 1>Yeah, a digital clock displayed right on the LCD. Much

362
00:16:27.240 --> 00:16:28.799
<v Speaker 1>more informative than just blinking lights.

363
00:16:29.159 --> 00:16:32.759
<v Speaker 2>Now, the concept of shields seems central to our dueno's

364
00:16:32.799 --> 00:16:33.360
<v Speaker 2>ease of use.

365
00:16:33.440 --> 00:16:36.279
<v Speaker 1>Oh, definitely. Shields are pre built circuit boards that just

366
00:16:36.279 --> 00:16:37.960
<v Speaker 1>plug right on top of the oduena.

367
00:16:37.720 --> 00:16:39.240
<v Speaker 2>Instantly adding new hardware.

368
00:16:38.879 --> 00:16:43.320
<v Speaker 1>Features exactly Ethernet shields for network connection, micro SD shields

369
00:16:43.320 --> 00:16:47.440
<v Speaker 1>for file storage, GPS shields for location, motor driver shields,

370
00:16:47.639 --> 00:16:48.600
<v Speaker 1>LCD shields.

371
00:16:49.080 --> 00:16:51.480
<v Speaker 2>You name it, so someone else did the hard wiring

372
00:16:51.519 --> 00:16:55.320
<v Speaker 2>part pretty much. You plug it in low the corresponding library,

373
00:16:55.399 --> 00:16:58.120
<v Speaker 2>and you can start using that feature relatively easily. It

374
00:16:58.240 --> 00:17:00.759
<v Speaker 2>massively accelerates development for us common tasks.

375
00:17:00.919 --> 00:17:02.960
<v Speaker 1>But the source warns about stacking them.

376
00:17:03.320 --> 00:17:07.279
<v Speaker 2>Yes, crucial point. Different shields might try to use the

377
00:17:07.319 --> 00:17:11.359
<v Speaker 2>same arduinopins. If they conflict, stacking them won't work or worse,

378
00:17:11.640 --> 00:17:14.480
<v Speaker 2>could damage something. Always check the pin usage.

379
00:17:14.680 --> 00:17:17.720
<v Speaker 1>And proto shields are kind of the opposite blank shields.

380
00:17:17.480 --> 00:17:20.359
<v Speaker 2>Right their prototyping brees laid out like an Arduino shield.

381
00:17:20.759 --> 00:17:23.319
<v Speaker 2>You build and solder your own custom circuit onto them,

382
00:17:23.519 --> 00:17:27.160
<v Speaker 2>making your breadburd design more permanent and stackable. Project twenty

383
00:17:27.160 --> 00:17:29.480
<v Speaker 2>eight shows building a custom LED driver shield.

384
00:17:29.640 --> 00:17:32.960
<v Speaker 1>Data logging is a big application micro SD cards YEP.

385
00:17:33.079 --> 00:17:35.880
<v Speaker 2>Projects twenty nine and thirty cover using a micro SD

386
00:17:35.960 --> 00:17:39.319
<v Speaker 2>shield and the SDH library, you could open files, write

387
00:17:39.400 --> 00:17:42.200
<v Speaker 2>data like sensor readings with timestamps, and close.

388
00:17:41.960 --> 00:17:44.599
<v Speaker 1>Files, creating log files you can read later exactly.

389
00:17:45.000 --> 00:17:47.319
<v Speaker 2>The data usually gets saved as a plaintext file dot

390
00:17:47.359 --> 00:17:50.359
<v Speaker 2>txt or dot csv. You can then pop the SD

391
00:17:50.440 --> 00:17:52.720
<v Speaker 2>card in your computer and analyze the data and Excel

392
00:17:52.799 --> 00:17:55.440
<v Speaker 2>or another program. Super useful for long term.

393
00:17:55.319 --> 00:17:58.559
<v Speaker 1>Monitor interrupts sound a bit more advanced Project thirty two

394
00:17:59.039 --> 00:18:00.000
<v Speaker 1>reacting instantly.

395
00:18:00.279 --> 00:18:04.279
<v Speaker 2>They are powerful. Instead of your main loop constantly checking

396
00:18:04.319 --> 00:18:07.839
<v Speaker 2>if say a button is pressed, Digital read and interrupt

397
00:18:07.920 --> 00:18:11.359
<v Speaker 2>automatically triggers a specific function the moment a change happens

398
00:18:11.400 --> 00:18:12.920
<v Speaker 2>on certain pins pins two.

399
00:18:12.759 --> 00:18:14.599
<v Speaker 1>And three on the you know, like a signal edge

400
00:18:14.599 --> 00:18:15.119
<v Speaker 1>triggers it.

401
00:18:15.200 --> 00:18:18.680
<v Speaker 2>Yeah, modes like rising goes from low to high, falling

402
00:18:18.759 --> 00:18:22.039
<v Speaker 2>high to low, or change use attached interrupt to set

403
00:18:22.039 --> 00:18:25.359
<v Speaker 2>it up. Why use them for things that need immediate reaction?

404
00:18:25.640 --> 00:18:27.799
<v Speaker 2>Catching a super fast signal you might miss in the

405
00:18:27.799 --> 00:18:30.240
<v Speaker 2>main loop, or maybe an emergency stop button that needs

406
00:18:30.240 --> 00:18:32.599
<v Speaker 2>to act right now, regardless of what else the code

407
00:18:32.640 --> 00:18:32.920
<v Speaker 2>is doing.

408
00:18:33.039 --> 00:18:36.319
<v Speaker 1>Chapter nine talks about in numeric keypads simple input.

409
00:18:36.160 --> 00:18:39.440
<v Speaker 2>Yeah, basic grid of buttons zero two, nine maybe and hashtag.

410
00:18:40.039 --> 00:18:42.000
<v Speaker 2>You scan the rows and columns to see which key

411
00:18:42.079 --> 00:18:45.039
<v Speaker 2>is pressed. The source suggests using switchcase is a good

412
00:18:45.039 --> 00:18:47.839
<v Speaker 2>way to handle the different keypresses. Good for pen entry,

413
00:18:48.079 --> 00:18:49.680
<v Speaker 2>simple menus, and touch screens.

414
00:18:49.680 --> 00:18:51.799
<v Speaker 1>In chapter ten, ticking it up a notch.

415
00:18:51.720 --> 00:18:55.200
<v Speaker 2>Specifically resistive touch screens. When you press, they create a

416
00:18:55.240 --> 00:18:58.160
<v Speaker 2>voltage divider and the arduino reads the X and Y

417
00:18:58.240 --> 00:19:01.640
<v Speaker 2>voltages using an alogreed so you get coordinates right Then

418
00:19:01.720 --> 00:19:05.519
<v Speaker 2>in your code you define rectangular zones on the screen.

419
00:19:06.000 --> 00:19:08.519
<v Speaker 2>If the touch coordinates fall within a zone, you treat

420
00:19:08.559 --> 00:19:11.559
<v Speaker 2>it as a button press for on or F or

421
00:19:11.599 --> 00:19:13.200
<v Speaker 2>whatever function you assign to that area.

422
00:19:13.400 --> 00:19:15.720
<v Speaker 1>Motors. Chapter twelve cover servos.

423
00:19:15.759 --> 00:19:18.680
<v Speaker 2>First, servos are great. They don't just spin. They rotate

424
00:19:18.720 --> 00:19:21.319
<v Speaker 2>to a specific angle you command, usually zero to one

425
00:19:21.400 --> 00:19:24.400
<v Speaker 2>hundred and eighty degrees controlled how the servo dot library

426
00:19:24.440 --> 00:19:26.920
<v Speaker 2>makes it easy. You create a server object, attach it

427
00:19:26.960 --> 00:19:29.759
<v Speaker 2>to a pin, and then just use MYSERVO dot right

428
00:19:29.799 --> 00:19:30.759
<v Speaker 2>angle simple as.

429
00:19:30.599 --> 00:19:33.440
<v Speaker 1>That Project thirty eight uses one as a thermometer needle.

430
00:19:33.640 --> 00:19:36.480
<v Speaker 2>Yeah, a really cool visual way to display analog data.

431
00:19:36.640 --> 00:19:39.079
<v Speaker 2>Moves the servero arm like an old school gauge.

432
00:19:39.160 --> 00:19:43.880
<v Speaker 1>Also in chapter twelve. Regular DC motors spin continuously right,

433
00:19:44.079 --> 00:19:44.519
<v Speaker 1>but they.

434
00:19:44.400 --> 00:19:48.200
<v Speaker 2>Need more current than Ardweno pins can supply directly.

435
00:19:47.839 --> 00:19:50.039
<v Speaker 1>So you need external power and a way for.

436
00:19:50.000 --> 00:19:53.480
<v Speaker 2>The Arduena to switch that power. Transistors or relays can work,

437
00:19:53.720 --> 00:19:55.119
<v Speaker 2>but motor shields are very common.

438
00:19:55.200 --> 00:19:56.279
<v Speaker 1>What a motor shields do?

439
00:19:56.359 --> 00:19:59.119
<v Speaker 2>They handle the higher current and often include h breed

440
00:19:59.200 --> 00:20:02.079
<v Speaker 2>circuits and h bringe lets. You control both the speed

441
00:20:02.559 --> 00:20:05.319
<v Speaker 2>using PWM and the direction of the motor spin with

442
00:20:05.440 --> 00:20:06.759
<v Speaker 2>simple commands from the Ardwino.

443
00:20:07.240 --> 00:20:10.400
<v Speaker 1>Essential for robotics like the tank boton projects thirty nine

444
00:20:10.400 --> 00:20:10.839
<v Speaker 1>and forty.

445
00:20:10.960 --> 00:20:14.640
<v Speaker 2>Classic example a chassis with two DC motors controlled by

446
00:20:14.640 --> 00:20:16.359
<v Speaker 2>a motor shield driven by an Arduino.

447
00:20:16.559 --> 00:20:19.759
<v Speaker 1>For robots like that, sensing distance is key, definitely.

448
00:20:20.200 --> 00:20:24.599
<v Speaker 2>The source mentions ultrasonic sensors but details the infrared IR

449
00:20:24.759 --> 00:20:28.000
<v Speaker 2>distance sensor. The sharp GP two Y zero A twenty

450
00:20:28.039 --> 00:20:29.440
<v Speaker 2>one white K zero F model.

451
00:20:29.559 --> 00:20:30.440
<v Speaker 1>How does that work?

452
00:20:30.599 --> 00:20:33.119
<v Speaker 2>It sends out an IR beam and measures the reflection,

453
00:20:33.599 --> 00:20:36.640
<v Speaker 2>it outputs an analog voltage that varies with distance. Closer

454
00:20:36.640 --> 00:20:38.640
<v Speaker 2>objects give a higher voltage usually.

455
00:20:38.839 --> 00:20:40.640
<v Speaker 1>So you read that with an l A grade YEP,

456
00:20:40.920 --> 00:20:41.400
<v Speaker 1>and use.

457
00:20:41.279 --> 00:20:43.720
<v Speaker 2>The reading to make decisions like stopping the tank pot

458
00:20:43.759 --> 00:20:44.519
<v Speaker 2>before it hits a wall.

459
00:20:44.519 --> 00:20:48.000
<v Speaker 1>In Project forty two, Finding location GPS Chapter thirteen.

460
00:20:47.880 --> 00:20:51.200
<v Speaker 2>Using a GPS shield and a library like tiny GPS,

461
00:20:51.400 --> 00:20:53.839
<v Speaker 2>the shield receives signals from satellites and.

462
00:20:53.839 --> 00:20:55.599
<v Speaker 1>The library parses that data right.

463
00:20:55.720 --> 00:20:59.440
<v Speaker 2>It extracts things like latitude, longitude, altitude, speed, and very

464
00:20:59.440 --> 00:21:00.559
<v Speaker 2>accurate time UTC.

465
00:21:00.839 --> 00:21:02.039
<v Speaker 1>What kind of projects use this?

466
00:21:02.359 --> 00:21:06.079
<v Speaker 2>Project forty four just displays the raw data. Project forty

467
00:21:06.079 --> 00:21:09.319
<v Speaker 2>five builds a clock using the accurate GPS time, and

468
00:21:09.400 --> 00:21:12.440
<v Speaker 2>Project forty six is a GPS logger. Combines the GPS

469
00:21:12.440 --> 00:21:15.480
<v Speaker 2>shield with a microSD shield and battery power to record

470
00:21:15.480 --> 00:21:16.599
<v Speaker 2>a track of where it's been.

471
00:21:16.559 --> 00:21:18.240
<v Speaker 1>And you can visualize that track later.

472
00:21:18.400 --> 00:21:21.720
<v Speaker 2>Yeah. The source mentioned sites like gpsvisualizer dot com where

473
00:21:21.720 --> 00:21:23.839
<v Speaker 2>you can upload the logged coordinates and see your path

474
00:21:23.880 --> 00:21:24.359
<v Speaker 2>on a map.

475
00:21:24.519 --> 00:21:29.680
<v Speaker 1>Pretty cool, okay. Wireless data Chapter fourteen, Sending stuff without wires.

476
00:21:29.519 --> 00:21:32.759
<v Speaker 2>Starts with simple, low cost RF modules, often four hundred

477
00:21:32.759 --> 00:21:35.240
<v Speaker 2>and thirty three mil hertz. These are typically one way

478
00:21:35.359 --> 00:21:38.319
<v Speaker 2>a transmitter sends data to a receiver, a basic text

479
00:21:38.319 --> 00:21:39.359
<v Speaker 2>info usually.

480
00:21:39.160 --> 00:21:40.440
<v Speaker 1>And for more complex stuff.

481
00:21:40.640 --> 00:21:43.359
<v Speaker 2>XB modules These are more advanced transceivers. They can both

482
00:21:43.359 --> 00:21:46.559
<v Speaker 2>send and receive, often used with specific shields or adapter boards.

483
00:21:46.799 --> 00:21:48.759
<v Speaker 2>You can build two way communication systems like.

484
00:21:48.759 --> 00:21:50.960
<v Speaker 1>The remote control thermometer Project forty nine.

485
00:21:51.000 --> 00:21:53.480
<v Speaker 2>Yeah. One ard weener reads a temperature sensor and sends

486
00:21:53.480 --> 00:21:57.279
<v Speaker 2>the data wirelessly via XP to another ARDWENO that displays it,

487
00:21:57.480 --> 00:21:58.559
<v Speaker 2>untethering your sensors.

488
00:21:58.559 --> 00:22:02.440
<v Speaker 1>What about using regular remote control for ATV Chapter fifteen.

489
00:22:02.599 --> 00:22:05.920
<v Speaker 2>Yeah. Using an IR receiver module like the TSOP four

490
00:22:06.000 --> 00:22:09.200
<v Speaker 2>one three eight mentioned and the I Remote dot H library.

491
00:22:08.880 --> 00:22:11.200
<v Speaker 1>The rdueno listens for IR signals yep.

492
00:22:11.480 --> 00:22:14.680
<v Speaker 2>The library decodes the signals from common remote controls. The

493
00:22:14.720 --> 00:22:17.960
<v Speaker 2>source mentions sony codes. Your sketch gets a unique code

494
00:22:17.960 --> 00:22:18.920
<v Speaker 2>for each button.

495
00:22:18.680 --> 00:22:21.200
<v Speaker 1>Pressed, and you can react to those codes exactly.

496
00:22:21.759 --> 00:22:24.440
<v Speaker 2>Use a switchcase statement to say, if I receive code X,

497
00:22:24.599 --> 00:22:27.440
<v Speaker 2>turn on LED one. If I recees code Y, run

498
00:22:27.480 --> 00:22:30.440
<v Speaker 2>the motor turns any old remote into a custom controller

499
00:22:30.480 --> 00:22:31.400
<v Speaker 2>for your project.

500
00:22:31.720 --> 00:22:35.440
<v Speaker 1>RFID comes up in chapter sixteen identifying things.

501
00:22:35.319 --> 00:22:39.440
<v Speaker 2>Radio frequency identification. You have an RFID reader module connected

502
00:22:39.480 --> 00:22:43.160
<v Speaker 2>to the r DWENO and passive RFID tags like cards

503
00:22:43.240 --> 00:22:44.160
<v Speaker 2>or keyfobs.

504
00:22:44.200 --> 00:22:46.200
<v Speaker 1>The reader detects nearby tags.

505
00:22:45.880 --> 00:22:49.400
<v Speaker 2>And reads their UNIID number. Project fifty two shows building

506
00:22:49.440 --> 00:22:51.599
<v Speaker 2>a system that checks the ID against a list of

507
00:22:51.640 --> 00:22:54.759
<v Speaker 2>known tags and takes action like unlocking something only if

508
00:22:54.799 --> 00:22:56.200
<v Speaker 2>a recognized tag is scanned.

509
00:22:56.319 --> 00:22:59.039
<v Speaker 1>There's a note about programming with RFID readers.

510
00:22:59.119 --> 00:23:02.519
<v Speaker 2>Yeah, practical time. Sometimes you need to disconnect the reader's

511
00:23:02.599 --> 00:23:05.480
<v Speaker 2>RX receive pin from the r duino while uploading a

512
00:23:05.480 --> 00:23:08.480
<v Speaker 2>new sketch because they might interfere with the USB communication,

513
00:23:09.119 --> 00:23:11.319
<v Speaker 2>then reconnect it after uploading. Good to know.

514
00:23:11.519 --> 00:23:15.119
<v Speaker 1>Also in chapter sixteen, ee PROM built in memory.

515
00:23:15.359 --> 00:23:18.200
<v Speaker 2>Yes, e PROM is non volatile memory on the Arduino

516
00:23:18.319 --> 00:23:21.559
<v Speaker 2>chip itself. Data store there stays even if the.

517
00:23:21.519 --> 00:23:25.319
<v Speaker 1>Power is turned off, unlike regular variables which reset exactly.

518
00:23:25.440 --> 00:23:29.480
<v Speaker 2>You use eprom dot address value to store a byte

519
00:23:29.759 --> 00:23:33.240
<v Speaker 2>and prombout readaddressed to get it back. It's limited in size,

520
00:23:33.279 --> 00:23:37.119
<v Speaker 2>but incredibly useful. How So, Project fifty three combines RFID

521
00:23:37.279 --> 00:23:40.960
<v Speaker 2>and e PROM brilliantly an RFID lock system that remembers

522
00:23:40.960 --> 00:23:43.920
<v Speaker 2>whether it's locked or unlocked even after a power outage

523
00:23:44.039 --> 00:23:47.240
<v Speaker 2>by saving the state to the E prom adds persistence.

524
00:23:47.400 --> 00:23:51.279
<v Speaker 1>Chapter seventeen gets into communication buses how chips talk to

525
00:23:51.319 --> 00:23:51.680
<v Speaker 1>each other.

526
00:23:51.799 --> 00:23:54.640
<v Speaker 2>Sounds technical it is, but I two C is surprisingly

527
00:23:54.680 --> 00:23:57.319
<v Speaker 2>accessible stands for inter integrated circuit.

528
00:23:57.359 --> 00:23:58.359
<v Speaker 1>What's special about it?

529
00:23:58.359 --> 00:24:02.200
<v Speaker 2>It uses only two wires SDA A data and SEL clock,

530
00:24:02.400 --> 00:24:04.039
<v Speaker 2>which are pins A four and A five on the

531
00:24:04.119 --> 00:24:06.680
<v Speaker 2>UNDE to communicate with multiple devices on the same bus

532
00:24:06.799 --> 00:24:07.200
<v Speaker 2>one are.

533
00:24:07.119 --> 00:24:08.920
<v Speaker 1>Do we know? Talking to many sensors or chips?

534
00:24:09.000 --> 00:24:11.519
<v Speaker 2>YEP. Each I two C device has unique address. The

535
00:24:11.559 --> 00:24:14.400
<v Speaker 2>air do we Know acts as the master, addressing specific slaves.

536
00:24:14.799 --> 00:24:17.480
<v Speaker 2>Thewire dot H library handles the protocol details.

537
00:24:17.519 --> 00:24:20.359
<v Speaker 1>What kind of devices use I two C lots.

538
00:24:20.480 --> 00:24:24.240
<v Speaker 2>External EPROM chips for more storage, Project fifty four port

539
00:24:24.240 --> 00:24:27.799
<v Speaker 2>expanded chips like the MCP two thirty zero seventeen Project

540
00:24:27.839 --> 00:24:31.319
<v Speaker 2>fifty five that give you sixteen extra digital pins. Using

541
00:24:31.440 --> 00:24:34.319
<v Speaker 2>just the two I two C pins is incredibly powerful

542
00:24:34.359 --> 00:24:34.960
<v Speaker 2>for expansion.

543
00:24:35.039 --> 00:24:36.240
<v Speaker 1>Anything to watch out for.

544
00:24:36.200 --> 00:24:38.119
<v Speaker 2>The source notes You usually need pull up resistors on

545
00:24:38.119 --> 00:24:40.559
<v Speaker 2>the SDA and SEL lines, and you have to make

546
00:24:40.559 --> 00:24:43.480
<v Speaker 2>sure all devices on the bus are voltage compatible, usually

547
00:24:43.480 --> 00:24:44.880
<v Speaker 2>five V for standard are do we know?

548
00:24:45.200 --> 00:24:47.240
<v Speaker 1>SPI is another bus mentioned.

549
00:24:46.920 --> 00:24:52.480
<v Speaker 2>Serial peripheral interface uses four wires SCK MISO MOSISS and

550
00:24:52.599 --> 00:24:55.519
<v Speaker 2>is generally faster than IT two C, often used for

551
00:24:55.559 --> 00:24:58.359
<v Speaker 2>things like SD cards and some types of displays or sensors.

552
00:24:58.400 --> 00:25:00.000
<v Speaker 2>The SPIH library helps here twos.

553
00:25:00.400 --> 00:25:03.880
<v Speaker 1>Keeping accurate time is often needed Real time clocks Chapter

554
00:25:03.880 --> 00:25:05.039
<v Speaker 1>eighteen RTC modules.

555
00:25:05.079 --> 00:25:07.960
<v Speaker 2>Yeah, these are dedicated chips like the DS three two

556
00:25:08.000 --> 00:25:11.920
<v Speaker 2>three two mentioned. They keep track of seconds, minutes, hours, date, month, year,

557
00:25:12.400 --> 00:25:14.480
<v Speaker 2>usually have a small battery backup so they keep time

558
00:25:14.519 --> 00:25:15.720
<v Speaker 2>even when they are do we knows off?

559
00:25:15.759 --> 00:25:16.559
<v Speaker 1>How do they connect?

560
00:25:16.759 --> 00:25:18.480
<v Speaker 2>Often using that I two C bus We just talked

561
00:25:18.519 --> 00:25:21.359
<v Speaker 2>about anything tricky? The source mentions they often store time

562
00:25:21.440 --> 00:25:24.839
<v Speaker 2>in BCV binary coded decimal format, so you need small

563
00:25:24.839 --> 00:25:28.960
<v Speaker 2>helper functions at TOEBCDBCD to tach to convert between regular

564
00:25:28.960 --> 00:25:31.799
<v Speaker 2>decimal numbers and BCD when reading or setting the time.

565
00:25:31.920 --> 00:25:33.400
<v Speaker 1>And projects using RTCs.

566
00:25:33.519 --> 00:25:36.319
<v Speaker 2>Project fifty seven makes a simple digital clock outputting to

567
00:25:36.319 --> 00:25:39.599
<v Speaker 2>the serial monitor. Project fifty eight puts that clock on

568
00:25:39.640 --> 00:25:42.079
<v Speaker 2>an LCD and Project fifty nine.

569
00:25:42.279 --> 00:25:44.160
<v Speaker 1>Wow, what's Project fifty.

570
00:25:43.960 --> 00:25:47.440
<v Speaker 2>Nine an employee RFID time clock. It combines an RTC,

571
00:25:47.680 --> 00:25:51.079
<v Speaker 2>an RFID reader, a micro SD card for logging, an

572
00:25:51.160 --> 00:25:55.000
<v Speaker 2>LTD for display and a custom shield. Employees scan their

573
00:25:55.000 --> 00:25:57.400
<v Speaker 2>tag and it logs their ID and the exact time

574
00:25:57.440 --> 00:26:00.440
<v Speaker 2>from the RTC onto the SD card. A really complex

575
00:26:00.480 --> 00:26:02.440
<v Speaker 2>system built by integrating multiple modules.

576
00:26:02.480 --> 00:26:06.039
<v Speaker 1>Connecting our dueno to the Internet Ethernet in Chapter nineteen.

577
00:26:05.920 --> 00:26:08.680
<v Speaker 2>Using an Ethernet shield or a board with Ethernet built

578
00:26:08.680 --> 00:26:11.279
<v Speaker 2>in like the ether. Ten needs a network cable obviously,

579
00:26:11.559 --> 00:26:12.920
<v Speaker 2>and configuration like an IP.

580
00:26:12.839 --> 00:26:14.759
<v Speaker 1>Address, and what can you do once it's networked?

581
00:26:14.960 --> 00:26:17.559
<v Speaker 2>Cool stuff. Project sixty creates a webpage served by the

582
00:26:17.640 --> 00:26:19.920
<v Speaker 2>arduino that shows live sensor readings. You can check it

583
00:26:19.960 --> 00:26:21.599
<v Speaker 2>from any browser on your network.

584
00:26:21.279 --> 00:26:23.440
<v Speaker 1>And Arduino webserver a simple one yeah.

585
00:26:23.720 --> 00:26:26.559
<v Speaker 2>Project sixty one uses a Twitter library to send tweets

586
00:26:26.599 --> 00:26:30.160
<v Speaker 2>directly from the arduino. Imagine your plant tweeting when it

587
00:26:30.200 --> 00:26:32.880
<v Speaker 2>needs water and til adueno.

588
00:26:33.200 --> 00:26:34.680
<v Speaker 1>Project sixty two that's.

589
00:26:34.519 --> 00:26:37.759
<v Speaker 2>An interesting service. It lets you control Ardueno pins remotely

590
00:26:37.839 --> 00:26:40.359
<v Speaker 2>over the web using a simple proxy sketch on the

591
00:26:40.440 --> 00:26:43.440
<v Speaker 2>arduino and an API key without you having to write

592
00:26:43.440 --> 00:26:46.400
<v Speaker 2>all the complex web server or networking code yourself. Kind

593
00:26:46.400 --> 00:26:47.079
<v Speaker 2>of a shortcut for.

594
00:26:47.079 --> 00:26:49.279
<v Speaker 1>Web control and if there's no Wi Fi or Ethernet

595
00:26:50.119 --> 00:26:52.440
<v Speaker 1>cellular Chapter twenty yep.

596
00:26:52.599 --> 00:26:56.240
<v Speaker 2>Using a GSM shield needs a simcard and usually a

597
00:26:56.279 --> 00:26:57.559
<v Speaker 2>hefty external power supply.

598
00:26:57.839 --> 00:26:59.119
<v Speaker 1>How do you talk to the cell network?

599
00:26:59.240 --> 00:27:02.440
<v Speaker 2>Often using text based at commands or libraries like Serial

600
00:27:02.480 --> 00:27:03.920
<v Speaker 2>GSM that wrap those commands.

601
00:27:03.960 --> 00:27:04.599
<v Speaker 1>What can I do?

602
00:27:04.720 --> 00:27:07.680
<v Speaker 2>Project sixty three shows dialing a phone number, Project sixty

603
00:27:07.680 --> 00:27:10.480
<v Speaker 2>four sends an SMS text message, and Project sixty five

604
00:27:10.519 --> 00:27:12.559
<v Speaker 2>is really need It allows you to control the Arduino

605
00:27:12.720 --> 00:27:15.599
<v Speaker 2>by sending it specific text messages, turn things on or

606
00:27:15.640 --> 00:27:19.319
<v Speaker 2>off remotely via SMS. Great for places without Internet access.

607
00:27:19.559 --> 00:27:21.519
<v Speaker 2>And the source kind of wraps up by emphasizing the

608
00:27:21.559 --> 00:27:22.920
<v Speaker 2>open source aspect again.

609
00:27:22.880 --> 00:27:25.079
<v Speaker 1>Right, not just a soft variety E. But the hardware

610
00:27:25.119 --> 00:27:26.079
<v Speaker 1>designs themselves are.

611
00:27:26.000 --> 00:27:30.839
<v Speaker 2>Open yeah, which means you could, technically, as the source details,

612
00:27:31.319 --> 00:27:35.799
<v Speaker 2>gather the core components the micro controller chip, crystal capacitors, connectors,

613
00:27:36.200 --> 00:27:39.319
<v Speaker 2>and build your own Arduino compatible circuit right on a

614
00:27:39.359 --> 00:27:39.880
<v Speaker 2>bread board.

615
00:27:39.960 --> 00:27:40.799
<v Speaker 1>Why would you do that?

616
00:27:41.119 --> 00:27:43.400
<v Speaker 2>Well, it can save money if you make many yeah,

617
00:27:43.799 --> 00:27:47.119
<v Speaker 2>But maybe more importantly, it deeply increases your understanding. You

618
00:27:47.160 --> 00:27:49.640
<v Speaker 2>see exactly what makes the Arduino tick. It's not a

619
00:27:49.640 --> 00:27:53.319
<v Speaker 2>black box anymore. Demystifies the whole thing completely, reinforces that

620
00:27:53.319 --> 00:27:55.400
<v Speaker 2>it's all understandable accessible engineering.

621
00:27:55.440 --> 00:27:58.200
<v Speaker 1>Wow. Okay, that was quite the tour from blinking an

622
00:27:58.359 --> 00:28:03.079
<v Speaker 1>LED to sending tweets and controlling things via text message.

623
00:28:03.119 --> 00:28:05.599
<v Speaker 2>It really covers the spectrum, doesn't it. The source builds

624
00:28:05.599 --> 00:28:09.720
<v Speaker 2>things up logically basic components, then programming structures.

625
00:28:09.240 --> 00:28:12.720
<v Speaker 1>And communication protocols like serial IT two CSPI, and.

626
00:28:12.680 --> 00:28:15.599
<v Speaker 2>Finally all those shields and modules, adding advanced capabilities like

627
00:28:15.759 --> 00:28:18.279
<v Speaker 2>DPSSD cards, networking wireless.

628
00:28:18.519 --> 00:28:21.200
<v Speaker 1>It really highlights how you layer these things together, like

629
00:28:21.240 --> 00:28:25.680
<v Speaker 1>that RFID time clock project using RTC, RFID, sd card

630
00:28:25.680 --> 00:28:26.519
<v Speaker 1>and LCD.

631
00:28:26.319 --> 00:28:30.119
<v Speaker 2>All at once exactly, or how a simple transistor and

632
00:28:30.119 --> 00:28:33.920
<v Speaker 2>relay setup lets the low power arduino control something much bigger.

633
00:28:34.039 --> 00:28:37.319
<v Speaker 1>The key takeaway feels like, well, this urdunal platform isn't

634
00:28:37.359 --> 00:28:40.400
<v Speaker 1>just one thing, It's a whole ecosystem designed to make

635
00:28:40.440 --> 00:28:44.519
<v Speaker 1>interacting with the physical world through electronics much much easier.

636
00:28:44.640 --> 00:28:48.640
<v Speaker 2>It lowers that barrier to entry significantly, and the source

637
00:28:48.680 --> 00:28:53.240
<v Speaker 2>showed so many powerful techniques made accessible, logging data, using

638
00:28:53.279 --> 00:28:57.559
<v Speaker 2>interrupts for instant reactions, making projects remember things with EPROM.

639
00:28:57.839 --> 00:29:00.920
<v Speaker 1>It really opens up possibilities. So after hearing all this,

640
00:29:01.079 --> 00:29:04.279
<v Speaker 1>maybe the question for you the listener is what project

641
00:29:04.319 --> 00:29:09.079
<v Speaker 1>that seemed too complicated before now feels well, maybe doable

642
00:29:09.160 --> 00:29:09.920
<v Speaker 1>with these tools.

643
00:29:10.039 --> 00:29:12.400
<v Speaker 2>What idea sensing the world or reacting to it could

644
00:29:12.400 --> 00:29:15.359
<v Speaker 2>you start piecing together now using these building blocks we've

645
00:29:15.359 --> 00:29:15.799
<v Speaker 2>explored
