Pointers
A variable that holds an address: declaring one, reading and writing through it with *, swap done right, NULL and the check before you follow it, and a button that fires at whatever the pointer aims at.
Open it in the simulatorWhat is really in 2 KB of RAM, and the idea that makes C what it is: addresses, pointers, arrays and strings by hand, structs, the stack, function pointers. Ends with a serial command line built from all of it.
0 of 8 done
8 lessons in 4 chapters, about 5 hours on a simulated Arduino Uno R3. Free, in your browser, every step checked by the simulator.
A variable that holds an address: declaring one, reading and writing through it with *, swap done right, NULL and the check before you follow it, and a button that fires at whatever the pointer aims at.
Open it in the simulatorA C string is chars and a zero byte: length, upper case and reverse written with pointers, a buffer overflow you can watch trample its neighbor, the bounded copy that stops it, and a compare that lights a lamp.
Open it in the simulatorWhere things live in 2 KB: globals low, the stack high and growing down with every call, a local that forgets against a static that remembers, and a buffer that eats the free RAM.
Open it in the simulatorEverything in one program: a bounded line buffer, a tokenizer that splits in place into argv, a number parser, lamps found by name through a table, and a table of commands with function pointers. Add your own command, then make it yours.
Open it in the simulatorEach lesson opens when the one before it is done, and each chapter ends in a project.
Addresses in the Uno's 2 KB, then pointers that hold them.
Every variable lives at a numbered byte: where globals sit in the Uno's 2 KB, neighbors in an array, the bytes of a number stored little end first, and the map from 0x100 to 0x8FF.
0 of 6 steps
A variable that holds an address: declaring one, reading and writing through it with *, swap done right, NULL and the check before you follow it, and a button that fires at whatever the pointer aims at.
0 of 6 steps
Arrays as pointers, then strings walked by hand.
An array's name turns into the address of its first element: pointer arithmetic that counts in elements, a[i] as *(a + i), walking an array with a pointer, the sizeof trap in a function, and a lamp chaser that is a moving pointer.
0 of 6 steps
A C string is chars and a zero byte: length, upper case and reverse written with pointers, a buffer overflow you can watch trample its neighbor, the bounded copy that stops it, and a compare that lights a lamp.
0 of 6 steps
Structs and the arrow, then where locals and statics live.
A fleet of ships in an array of structs: sizeof with no padding on the AVR, the arrow operator, a copy against a pointer, a search that returns NULL, a button that flies, and a fourth ship.
0 of 6 steps
Where things live in 2 KB: globals low, the stack high and growing down with every call, a local that forgets against a static that remembers, and a buffer that eats the free RAM.
0 of 5 steps
Function pointers, then a command parser built from everything.
A pointer to code: one call that runs add or multiply, a sort that takes its order as a function, a callback for each element, and a table of lamp modes, with a police mode you add yourself.
0 of 6 steps
Everything in one program: a bounded line buffer, a tokenizer that splits in place into argv, a number parser, lamps found by name through a table, and a table of commands with function pointers. Add your own command, then make it yours.
0 of 7 steps
All 8 lessons, in order, each with what it covers. Any of them opens in the editor right away.
Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.
Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kitYes. All 8 lessons of Pointers and memory in C are free and run in your browser, with nothing to install and no parts to buy before you start.
No. Every lesson runs on a simulated Arduino Uno R3 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.
About 5 hours: 8 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.
Each chapter ends in a project that puts it together: Pointers, Strings by hand, Stack and static and Project: a command parser.
With "Addresses", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.