ProgrammingData types When variables are made to exceed their maximum capacity they "roll over" back to their minimum capacity, note that this happens in both directions. int x x = -32,768; x = x - 1; // x now contains 32,767 - rolls over in neg. direction x = 32,767; x = x + 1; // x now contains -32,768 - rolls overFloat & casting:
ProgrammingFloat & casting: int x; int y; float z; x = 1; y = x / 2; // y now contains 0, ints cant hold fractions z = (float)x / 2.0; // z now contains .5 (you have to use 2.0, not 2)
Resources• Language reference: • http://www.arduino.cc/en/Reference/HomePage • http://arduino.cc/en/Reference/Extended • General code library: • http://arduino.cc/en/Reference/Libraries• Interfacing with hardware: • http://www.arduino.cc/playground/Main/InterfacingWithHardware• Examples • http://arduino.cc/en/Tutorial/HomePage
This session of the workshop willshow you some ways of doing that.
Arduino to the world• Arduino direct to Pachube via ethernet/wiﬁ shield• Or Arduino to PC via serial, then to Pachube/Twitter• We’re taking the second approach in this workshop, since the kits we provided don’t include ethernet/wiﬁ shields