Commit 5171633e authored by Erik Strand's avatar Erik Strand
Browse files

More README updates

parent 8ae9bef9
# Fundamentals
These examples demonstrate C's basic types, how to use control structures like branches and loops,
and how to write functions.
and how to write functions. These things can get you pretty far. Some more advanced topics that
aren't (yet) covered here are pointers, and the difference between values and references. These
would be good next steps if you want to gain a deeper understanding of the language.
```
demo@linux:02_fundamentals$ make
......
# Basic Input
# Inputs and Outputs
These examples illustrate command line arguments, and reading a file.
So far we haven't interacted with our programs, except to read what they print to the terminal.
These examples illustrate how to make them accept command line arguments and read a file. Keep in
mind that this only applies on your computer -- I/O on a microcontroller will happen through its
peripherals, rather than the C standard library functions we use here.
```
demo@linux:03_inputs_and_outputs$ make
......
......@@ -4,6 +4,17 @@ Microcontrollers are great and all, but if you're new to programming it can help
about the software tools on their own before diving into the hardware as well. This repo has some
example programs in C and C++, along with Makefiles that help you build them.
There are a lot of great tutorials out there, from this class and elsewhere.
- [last year's slides](https://gitlab.cba.mit.edu/classes/863.19/site/blob/master/doc/programming_rec/programming_rec_slides.pdf)
- [a few](https://www.tutorialspoint.com/cprogramming/index.htm)
[of many](https://www.cprogramming.com/tutorial/c-tutorial.html)
[online](https://beginnersbook.com/2014/01/c-tutorial-for-beginners-with-examples/)
[tutorials](https://www.learn-c.org/)
This repo is meant to be more of a hands on reference. So clone it, build it, and play with it.
## The Basics
C is a programming language. It was created in the early 70s at Bell Labs by Dennis Ritchie and Ken
......@@ -44,10 +55,17 @@ run gcc, you'll actually get clang. This is bad because not all the options are
sometimes it just won't work to switch between the two. So if you do install gcc with homebrew,
you'll want to run gcc-8 or gcc-9 (or whatever specific version you got).
On Windows... honestly I'm not sure. I haven't set up a development environment there in years.
On Windows... things are trickier. Most Windows applications assume you'll always use the graphical
user interface (GUI) and not the command line. You could install the [Windows Subsystem for
Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10). This will work great for
compiling C to run on your own computer, but it might lead you into trouble when programming
microcontrollers (people often complain of USB errors in WSL). Before WSL,
[MinGW](http://www.mingw.org/) was the go-to command line environment. Overall you'll probably have
a smoother experience if you bite the bullet and find/install Linux up front.
## Examples
- [hello world](./01_hello_world)
- [fundamentals](./02_fundamentals)
- [inputs and outputs](./03_inputs_and_outputs)
- [inputs and outputs (on your computer)](./03_inputs_and_outputs)
- [bit twiddling](./04_bit_twiddling)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment