Pre-Lecture Prep and Pre-Quiz

Please read up to "in class work" and complete the pre-quiz before class. Link on Moodle.

Announcements

Learning Objectives / Outcomes

In this lecture, you will...

By the end of this lecture, you should be able to...

Introduction to Computation

Last time in class we completed an example where we counted button presses on the neopixels. We introduced comparisons (>,<,==,!=) and the incrementer/decrementer operators ++ and --. In order to use comparisons on values other than booleans, we introduced the byte variable. Bytes are small variables that can store values from 0 to 255. If we want to store larger values or use negative numbers, we need to use another variable type called an integer (int). The int type can store values between -32,768 to 32,767 (if we want, we can also use an unsigned int to store 0 to 65,535).

<aside> 🗣 We'll discuss why these values are the ranges for byte,int and unsigned int and what happens if you perform a computation outside those ranges in the next lecture.

</aside>

In class we're going to create a simple calculator using the left and right buttons as inputs to the calculator. In order to perform the operations of the calculator, we need to discuss a few new operators: