Grace's Blog

This is documentation of my work and questions throughout the semester

View the Project on GitHub gracethorn/gracesblog

Jan 23 In Class Notes

Coding Topics

Intro

Low level language- closer to what chip and computer understand (C++)

High level language- easier to understand (arduino)

ASCII number system- ex. A=41

Storing Data

bit

byte

How we store information of any kind

Variables and Datatypes

Bit Chart

4 - nibble 8 - byte

16 - word (0 ~ 65,000) 32 - long

32 - float 64 - double long

Stay in realm of 8 bits, same as micro controller

-Actual chip does addition, subtraction, multiplication, but not division (x .5 rather than divide by 2)

“cont”-variable that doesn’t change

How To Declare Vlaue

“byte sensorValue=0;”

Functions

“name()” parenthesis = function

-there are functions that just do something

AND

-functions that just give something back

-; (semicolon) at end of statement

Variety in Functions

-some don’t need info, just ()

-some need parameters (#,#) (upper, lower)

-while others optional

Scope of Variables

Global

Local

If, Then, Else Statement

AKA Boolean Expression

ex. “if (age > 16)”

Longer Boolean

“if (age > 16 && age < 55)”

“else {“

-Also called “conditional”

-Be sure to define functions and variables