/* Arduino Projects for Dummies * by Brock Craft * * Chapter 11: Building a Tweeting Pet Door * A system that uses hall effect sensors to * detect the movement of a pet flap and then * posts a message to your (or your pet's) twitter account * * Use this code to test and calibrate your Hall Effect sensors * without posting a tweet * * v0.1 30.04.2013 */ const int entryPin = A0; // Define the input pin for entry sensor const int exitPin = A1; // Define the input pin for the exit sensor int entryReading = 0; // Define variable to store the entry value int exitReading = 0; // Define variable to store the exit value void setup() { Serial.begin(9600); // Open a serial connection to display the data } void loop() { entryReading = analogRead(entryPin); // Read the value from entry sensor exitReading = analogRead(exitPin); // Read the value from exit sensor Serial.print("Sensor values: "); Serial.print(entryReading); // Print the entry sensor value Serial.print(", "); Serial.println(exitReading); // Print the exit delay(500); // Wait a moment, so we can read what's been printed }