GLOBAL SITE AUSTRALIAN SITE

Lesson 9 Worksheet 9.1 – Understanding variables

A variable is small piece of computer memory for storing data. What makes variables so useful is that this data can change while the program is running, hence the name variable.

Variables store numbers like 10, 106, 1,482 etc. and allow a computer program to do maths, this is something that computers are very good at.

Edison-robot-variables

The Edison robot has two types of variables that are called ‘bytes’ and ‘words’. Byte variables can store numbers that range from 0 to 255. Word variables can store numbers that range from -32,767 to +32,767.

To make variables easy to use we give them names. This helps us humans remember what type of information is stored in them. In EdWare, you can name your variables just about anything you like. You could name one ‘Fred’, but that might not be a very helpful name for remembering what type of information is stored in Fred. A better name might be ‘Light_Level’. This type of name makes it very easy to remember what the variable is used for and what type of data to find there.

Now that you know about variables let’s create one in EdWare for our next programs.

Click the ‘Add Variable’ button in the top left corner and a pop up box will appear.

Edison-robot-add-variable-1
Edison-robot-add-variable-2

Type in the name of your variable as ‘Light_Level’, select the variable range as +/-32767 (word) and set the initial value to zero. Now click OK and your variable will be added to the variables table in the bottom right corner.

What type of variable would you use for storing the following numbers (byte or word)?

 

12 _________, 192 _________, 801 _________, -42 _________, 27,901_________

  • Keep up with Edison

    Sign up for our newsletter to get all things Edison delivered straight to your inbox.

  • This field is for validation purposes and should be left unchanged.

Heads up

The Australian Federal Parliament has passed a law that extends goods and services tax (GST) to low value imports of physical goods imported by consumers from 1 July 2018.

This means that all customers purchasing Edison robots and accessories with an Australian shipping address must now pay GST. The GST will be automatically added to your purchase and show as a line item on your invoice.

We've detected that you are in Australia, so we wanted to let you know that we have changed your settings to view our Australian site, which displays GST inclusive pricing.

You can change back to the GLOBAL SITE at any time using the link in the top left of the page.

OK got it!    Take me to the GLOBAL SITE instead

Pin It on Pinterest

Share This