Pages: [1]   Go Down
Author Topic: [SOLVED] HC-SR04 & Arduino 1.0 with Ultrasonic library error compiling  (Read 2003 times)
0 Members and 1 Guest are viewing this topic.
Norway
Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
<3 Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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:
#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?
« Last Edit: December 03, 2011, 09:26:15 am by Stigern » Logged

I'm from Norway!

Norway
Offline Offline
Jr. Member
**
Karma: 0
Posts: 79
<3 Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

I'm from Norway!

0
Offline Offline
Edison Member
*
Karma: 17
Posts: 1413
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

* Si preguntas, pon el código de tu programa, hace mucho mas fácil ayudarte. Y me ahorro un mensaje pidiendo que lo hagas.
* Si consigues solucionar tu problema, dedica unos minutos a explicar en tu post como lo conseguiste para beneficio de todos.
* Cambia el 'Subject' de tu hilo y añade 'SOLUCIONADO' cuando hayas llegado a una solución al problema que planteaste.
* Utiliza un 'Subject' para tu hilo que explique de que va el hilo.
Si estas empezando:
* Comienza a usar Arduino
* Guías de iniciación a Arduino
* Ejemplos
* Referencia del Lenguaje
* Conceptos básicos
Guia de usuario de arduino
Tutoriales en Ingles
Si necesitas que alguien te escriba el código: http://www.freelancer.com/  o esta  http://www.guru.com/

Pages: [1]   Go Up
Jump to: