// Create a "soft" serial port on pins 6(RX) and 7(TX)
SoftwareSerial modem(2,3); //Create a 'fake' serial port. Pin 2 is the Rx pin, pin 3 is the Tx pin.
There is nothing fake about a software serial port. Any example that suggests that the software serial is somehow less than real should be left in the dustbin.
// Test the level again to check it's valid.
sampleLevel();
How can you do something again until you've done it once?
boolean checkForAlarm(void)
{
return ( Serial.println(analogRead(VAL_PROBE)) >= SENSOR_DRY);
}
Serial.println() does not return a boolean. Returning the number of characters that were sent to the serial port as a boolean is stupid.
const int VAL_PROBE = 0; // Moisture Sensor 1.
int moisture = analogRead(VAL_PROBE);
p->print("Water Level: ");
Serial.println(analogRead(0));
If nothing else, you should be consistent. If you need to move the moisture sensor to another pin, you have a lot of work to do. You should need to change only one line of code.
It verifies fine, but errors occur when I run it through "Simulator for Arduino" from arduino.com.au.
I never was very good at guessing games. What errors?