LOGBOOK

HELP

1 / 67
time's up — finish this card
Other keys: show • Space: good • 1-4: rate • 0: skip • 5: flag
Topic IoT Boards, Sensors and Development Tools

Question

Why is Visual Studio Code with the C/C++ extension a practical environment for IoT firmware development?

Answer

It is a free, lightweight, cross-platform editor that adds IntelliSense, code navigation, formatting and GDB debugging for C/C++ through an extension, and integrates Git.

Embedded C development can be done in a heavy IDE (Visual Studio, Eclipse) or a plain text editor (Vim, Emacs). VS Code sits between them: it is an editor, but extensions give it the IDE features that matter:

  • Code editing: go to definition, peek definition, auto-complete (IntelliSense), code formatting. In a firmware project with hundreds of vendor headers this is how you find out what a function like gpio_set_level actually takes.
  • Debugging: breakpoints, stepping, inspecting variables, core-dump analysis and raw GDB commands. With a hardware debug probe the same UI can step through code running on the microcontroller.
  • Git integration and the ability to call external tasks, so the build and flash commands of a toolchain such as ESP-IDF can be run from the editor.
  • Other languages via extensions, all free, open source and cross-platform.

The key point is that VS Code does not compile anything itself. It calls the external cross-compiler toolchain that produces code for the target chip, and a debugger that talks to it.

Go deeper:

or press any other key
Topic IoT Boards, Sensors and Development Tools

Question

How do you read the value of a four-band through-hole resistor, for example yellow, violet, red, gold?

Answer

Bands 1 and 2 are digits, band 3 is the power-of-ten multiplier and band 4 is the tolerance, so yellow (4), violet (7), red (×100), gold (±5%) is 47 × 100 = 4700 Ω = 4.7 kΩ, ±5%.

Two digits, one multiplier, one tolerance: 4, 7, ×100, ±5%.

* Two digits, one multiplier, one tolerance: 4, 7, ×100, ±5%. *

A resistor limits the flow of electrons through a circuit, and its resistance is measured in ohms (Ω). Through-hole resistors are too small to print a number on, so they use coloured bands:

Colour Digit Multiplier
Black 0 ×1
Brown 1 ×10
Red 2 ×100
Orange 3 ×1,000
Yellow 4 ×10,000
Green 5 ×100,000
Blue 6 ×1,000,000
Violet 7 ×10,000,000
Grey 8 ×100,000,000
White 9 ×1,000,000,000

Tolerance band: gold ±5%, silver ±10%. The tolerance band is set apart, usually with a larger gap, which tells you which end to start reading from. The digit and multiplier columns follow the same order, so the multiplier is simply "add that many zeros": red = 2 zeros, so 47 becomes 4700.

The 330 Ω resistor used for an LED is orange (3), orange (3), brown (×10).

Tip: the classic mnemonic for black-to-white is "Bad Beer Rots Our Young Guts But Vodka Goes Well".

Go deeper:

or press any other key