Back to Arduino Step By Step Course

Lesson 06: Introduction to Arduino Data Types


If you don't like to see ads while video is being played you can purchase this course for $200 from Udemy or purchase YouTube premium Here

Please select other codes for this lecture from the links below.

This code is part of Lecture 06 Data Types: Integer

We learn how to define integers such as 0, 1, 2, 1000, 34500 etc.
Here is what we read on Arduino Official page Integers are your primary data-type for number storage. On the Arduino Uno (and other ATmega based boards) an int stores a 16-bit (2-byte) value. This yields a range of -32,768 to 32,767 (minimum value of -2^15 and a maximum value of (2^15) - 1). On the Arduino Due and SAMD based boards (like MKR1000 and Zero), an int stores a 32-bit (4-byte) value. This yields a range of -2,147,483,648 to 2,147,483,647 (minimum value of -2^31 and a maximum value of (2^31) - 1).

Integer documentation: https://www.arduino.cc/reference/en/language/variables/data-types/int/


 /*
* This code is part of Step by Step Ardunio Course 
   Code: Lecture 06-1
 * Arduino Variable and Data Types: Integer
 
with over 100 lectures Free On  YouTube Watch it here http://robojax.com/L/?id=338
Get the code for the course: http://robojax.com/L/?id=339 
 * Written by Ahmad Shamshiri for Robojax, robojax.com http:youTube.com/robojaxTV
 * Feb 10, 2019  
 Please watch video instruction here https://youtu.be/n0z6fjww8eA
 This code is available at http://robojax.com/course1/?vid=lecture06
 
 */

void setup() {
int age = 36;
int days = age * 365;

	
 Serial.begin(9600);
 Serial.println("Robojax Step By Step Arduino Course");
 	//Robojax Step By Step Arduino Course http://robojax.com/L/?id=338

 Serial.print("Age:");
 Serial.println(age);
 Serial.print("Days:"); 
 Serial.println(days);
 Serial.println();



int temperature = B101101; // binary integer value 45
 Serial.print("B101101:"); 
 Serial.println(temperature);
 Serial.println();


int year = 0x7E3;// hex value for 2019
 Serial.print("0x7E3:"); 
 Serial.println(year);
 Serial.println();




}

void loop() {
  // put your main code here, to run repeatedly:
  //Robojax Step By Step Arduino Course 

}




   

The least I expect from you is to thumb up the video and subscribe to my channel. I appriciate that. .I have spent months making these lectures and writing code. You don't lose anything by subscribging to my channel. Your subscription is stamp of approval to my videos and more people can find them and in it turn it helps me. Thank you

If you found this tutorial helpful, please support me so I can continue creating content like this. support me via PayPal

**** AFFILIATE PROGRAM **** We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.