Introduction to Programming
Hello There, Let’s Get Started:
You’re here because you want to learn how to code. Even better, you want to learn how to code using robots! Cool. You’ve come to the right place. This section of the Arcbotics website is great for beginners who want to learn about the basics of writing code and for people who have some experience writing code who want to brush up. (It’s also great for really experienced coders who have never seen an if statement explained by a robot buying ice cream.) First off- don’t expect to learn everything by reading the following pages. Just like most things in life, you need to put in some time writing code in order to be good at it. These pages will help you understand the basics, but they won’t put the experience in your head. Only practice can do that. Practice, practice, practice. Luckily practice is fun and exciting when you use robots!What We’ll Cover:
Here are the larger concepts you will be learning about:- SparkiDuino Interface– The program you will use to write code
- Basic Sparki Code– The code that all Sparkies need to get started
- Variables– How Sparki keeps track of information
- Functions– Chunks of code you can use over and over
- Controls– The ways that Sparki makes decisions
- Code Writing Strategies– Ways to think about writing code to help you out
- Inputs & Outputs– Ways that computers get information and effect the world
- Beyond Basic Coding– What are the next steps?
Recap Pages:
As you complete these pages there will be links to Recap Pages that cover the key points each page explained. There are also some activities you can do with Sparki, if you if you want. There are completely optional, but we suggest that you take advantage of the opportunities to practice. After all, if you want to get good at something you have to practice! The links to these Recap Pages will always look something like this:Recap of What We’ve Covered So Far
This link doesn’t go anywhere, but when you see this in the future you’ll know that you can click on it to take you to a Recap Page as well as questions and activities.Code to Download:
Sometimes we’ll offer you code that you can either copy and paste or download. The code that you can copy and paste will look something like this:
1 2 3 4 5 6 7 8 9 10 11 |
#include <Sparki.h> // include the sparki library void setup() // code inside these brackets runs first, and only once { } void loop() // code inside these brackets runs over and over forever { } |
This link doesn’t download any code, but when you see this button in the future you can just click on it to download the example code.
The Silliness:
There’s going to be a lot of times when we use a silly example to help you understand concepts. Things like robots eating ice cream, driving race cars and cooking chicken. Things that the robots don’t really do in real life. We use these examples because they help you learn and… well… because they are silly! It never hurts to have a laugh every once in a while and coding can be very serious for some people- so we wanted to make it more fun by adding breakdancing robots and hamburgers.The Complete List of Concepts We’ll Cover:
We’ll start with what you’re looking at when you write code:- SparkiDuino Interface– The program you will use to write code
- Basic Sparki Code– The code that all Sparkies need to get started
- Comments & Syntax– What do all those slashes, semicolons and parentheses mean?
- A Couple More Things– Some tips and tricks to help you write and understand code
- Variables– How Sparki keeps track of information
- Boolean Variables– Yes or no variables
- Integer Numbers– Whole numbers
- Floating Point Numbers– Numbers with a decimal point
- Characters– Letters, punctuation marks and sometimes even smiley faces!
- Arrays– How Sparki stores a bunch of variables all at once
- Functions– Chunks of code you can use over and over
- Controls– The ways that Sparki makes decisions
- If Statements– Sparki asks a simple yes or no question
- Conditions– The questions that Sparki asks
- While Statements– How to make Sparki do something over and over again
- Switch Statements– How Sparki makes a decision among several options
- For Loops– Another way to make Sparki do something over and over again
- Code Writing Strategies– Ways to think about writing code to help you out
- Inputs & Outputs– Ways that computers get information and effect the world
- Analog & Digital Signals– Two different ways to look at the world
- Beyond Basic Coding– What are the next steps?
Next Step:
Getting started with learning about the SparkiDuino interface is the first step on your journey to learn about writing code for robots!