Arduino Programming Language: UnsignedLong

Name

unsigned long

Description

Datatype 'unsigned long' occupies four byte(32bit) and it stores an unsigned integer number between 0 and 4.294.967.295.

Syntax

unsigned long var
unsigned long var = value

Parameters

  • var: variable name
  • value: any unsigned integer number between 0 and 4.294.967.265

Usage

Application

Examples

unsigned long a; // It declares an integer variable 'a'

a = 2323131; // It assigns to 'a' the value 2323131

unsigned long b = 123987546; // It declares integer variable 'b' and it assigns the value
123987546

unsigned long c = a + b; // It declares a variable 'c' as the sum between other two integer variables


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc