Go Down

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


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()

void loop()
 Serial.println(" cm.");

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


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:
I'm from Norway!


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!

via Egeo 16
Torino, 10131