Arduino Programming Basics: Complete Beginner Guide to Your First Sketch
If you have never written Arduino code before, this is where to start. I walk through installing the IDE, explain how setup() and loop() work, and cover the basic building blocks you will use in every sketch. By the end, you will have built three small projects with wiring diagrams and working code.