Go Down

Topic: [SOLVED] HC-SR04 & Arduino 1.0 with Ultrasonic library error compiling (Read 2642 times) previous topic - next topic

Stigern

Well, I've just downloaded the Ultrasonic library for the HC-SR04: http://iteadstudio.com/produce/cheap-cheap-ultrasonic-ranging-modulehc-sr04/

And in Arduino 022 it compiles perfectly with no errors, but when using the library in Arduino 1.0 I get this error:

Code: [Select]

In file included from UltrasonicDemoMod.cpp:1:
D:\Programming\Arduino\Arduino\libraries\Ultrasonic/Ultrasonic.h:11:22: error: WProgram.h: No such file or directory


My project code is the following:
Code: [Select]

#include "Ultrasonic.h"
Ultrasonic ultrasonic(12,13);

void setup()
{
 Serial.begin(9600);
 Serial.print("testing...");
}

void loop()
{
 Serial.print(ultrasonic.Ranging(CM));
 Serial.println(" cm.");
 delay(100);
}



How come WProgram.h is no more in Arduino 1.0? or maybe it has been renamed?
I'm from Norway!

Stigern

Ah, found the solution here http://arduino.cc/pipermail/developers_arduino.cc/2011-September/005668.html

So I updated the library to work with 1.0. Get it here:
http://stigern.net/forum/viewtopic.php?f=5&t=34
I'm from Norway!

Sergegsx

can this be used with Parallax sensor? the one with only one echo/Trigger pin? maybe with a small modification of the code?

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy