// 2009 mlab.uiah.fi/paja // Understanding variable types /* To create an array int myInts[6] = {}; //is equal to {0,0,0,0,0,0}; char myChars[6] = {'H', 'e', 'l', 'l', 'o', '\0'}; char myChars = "Hello"; //As each letter is stored as ASCII. */ int myInts[5] = {0, 1, 0, -1, 0}; /* Note: Strings are terminated with a null character (ASCII code 0), therefore you need to add one more character than the text you want it to contain. This is needed to tell where the end of a string is. Strings are always defined inside double quotes ("Abc"). Characters are always defined inside single quotes('A'). */ char myChars[6] = "Hello"; void setup(){ Serial.begin(9600); // To assign a value to an array // myInts[0] = 10; //First value in the array is replaced by 10. myInts[0] = 2; myInts[4] = -2; } void loop(){ // Send valuses of myInts array to your PC int i; int x; for (i = 0; i < 5; i = i + 1) { // To retrieve a value from an array // x = myInts[0]; //First value in the array is stored in variable x. x = myInts[i]; Serial.println(myInts[i]); } // Send myChars to your PC Serial.println(myChars); Serial.println(); delay(3000); }