Hi there all,
Afraid this is my first thread so I am quite new to Arduino but confess, I enjoy playing around and doing electrical projects ad for a 44 year old, goes a long way.....lol
With Halloween looming, my plan is to make a smoke machine triggered by Ultrasonic. I confess, I managed to get a sketch along with the parts on another website but I cannot for the life of me to compile, no matter what I do.
This is the sketch Ive typed in
#include <Ultrasonic.h>
Ultrasonic ultrasonic(12,13); //12 is trigger and 13 is echo
int fogPin=11; //This is where you plug your signal pin into.
void setup() {
Serial.begin(9600);
pinMode(fogPin,OUTPUT);
}
//This is distance in Centimeters
void loop() {
Serial.print1n(ultrasonic.Ranging(CM));
Serial.print(" cm");
if(ultrasonic.Ranging(CM)<180);
{
digitalWrite(fogPin,HIGH);
delay(20000);
digitalWrite(fogPin,LOW);
delay(200);
}
else {
if(ultrasonic.Ranging(CM)>100)
{
digitalWrite(fogPin,LOW);
delay(250);
}
}
}
It goes as far as Serial.print1n thread and then it chuckes out an error stating "class HardwearSerial" has no member named "print1n"
If anyone can help, that would be great please.
Bit lost on this one.
Many thanks
Dyf