Save this video free

CE351 lec2 Embedded C examples

Yiyan Li · 57:04 · Watch on YouTube

CE351 lec2 Embedded C examples Watch on YouTube →

Overview

Yiyan Li reviews embedded C through practical Arduino examples, emphasizing fixed-width types, loop behavior, and how software interacts with hardware. The examples cover 8-bit unsigned overflow, polling a pull-up button, Arduino setup and loop functions, UART serial output at 9600 baud, arrays, format specifiers, and converting a digit character to its numeric value.

Key takeaways

Chapters

0:00 Fixed-Width Integer Types and Basic for Loops
4:37 Pull-Up Resistors Set a Button's Idle Logic Level
7:33 Polling a Button and Explaining Software Debouncing
15:08 Tracing uint8_t Overflow Through a Loop
19:40 Arduino setup, loop, and User-Defined Functions
24:39 Serial Debugging with UART at 9600 Baud
31:36 Declaring and Printing a 2-by-2 uint8_t Array
38:47 Choosing C Format Specifiers for Serial Output
43:04 Formatting Values into a Buffer Before Serial Printing
49:22 Sizing a Character Array for Multiple Words
51:25 Converting a Digit Character to an Integer Value

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:00 Very simple, right? Just try to revisit what you learned in C++. And this is uh embedded C language is really similar to C++. But I can say it's relatively easier. Um because the computer is simpler, right? It's not that complicated. Um so how could you get started in the first one? We have to define the type first. The data type. Okay? So in embedded systems, we we do it this way. For example, unsigned integer and _t. So t is type, okay? And then we put I here, for example,

0:48 right? Then it's just a very simple for loop. We could do for I starts with three. So it counts up by five. Um so it's not really counting to five. So whenever it's I know it just counts up by five, which is increment by five, right? But uh before reaching 105, it should be less than 105. So when I less I is less than 105, we'll stop. And then we increment I by five each time. You could also do I equals or I plus five. Right? You assign I plus five to I, but

1:39 usually we just do I plus equals five. It's the same thing in C, similar in C++. Do you need the semicolon here? For loop? No, right? Just follow with the curly bracket. This is the same as uh whatever you learned in C++ And it's you need in there inside the loop. No, it didn't didn't tell you to do anything, right? So, that's it for the first one. It's really simple. I'm just revisit the for loop. The second one It's a for loop that counts down from um 88. So, Oh, sorry. I I missed the one. the

2:26 months of the of the data over here. So,

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Yiyan Li.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.