the script below used to work with Arduino 0016.Now with hardware the Arduino UNO and Arduino 1.0 I get the error:
/Applications/Arduino.app/Contents/Resources/Java/libraries/E24C1024/E24C1024.h:47:24: error: WConstants.h: No such file or directory
that you see in attached image.
Can you please advise what changes I should do - probably with the libraries..many thanks
#include <WProgram.h>
#include <Wire.h>
#include <E24C1024.h>
#include <EEPROM.h>
byte inByte; // Where to store the Bytes read
int ledPin = 13; // Set the pin to digital I/O
int index = 0;
int addr = 0;
int pass = 0;
void setup()
{
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
if(Serial.available() > 0)
{
inByte = Serial.read(); // Read a Byte
int val = inByte;
EEPROM1024.write(addr, val);
addr = addr + 1;
if (addr == 676)
addr = 0;
Serial.print("At the position ");
Serial.print(index);
Serial.print(" arduino received: ");
Serial.println(inByte,DEC);
index++;
Serial.print("At the position ");
Serial.print(addr-1);
Serial.print(" of EEPROM I wrote: ");
Serial.print(val,DEC);
Serial.println();
}
}
many thanks!!!this is fixed but I still get many errors.
They has to do with the replacement of send() and receive() with read() and write().
But in which file do I substitute this code?In which file should I substitute send() for read()?
I also don't understand the first error:
/Applications/Arduino.app/Contents/Resources/Java/libraries/E24C1024/E24C1024.cpp: In static member function 'static void E24C1024::write(long unsigned int, uint8_t)':
Below is the code of wire.h but where are the files inttypes.h & Stream.h located? Are in these files the send() & receive() that have to be replaced?thx!
"When compile an Arduino Library, it fails to compile with the message: error: WConstants.h: No such file or directory The solution is to delete the line #include "WConstants.h" and then in the .h file, add the following: #if ARDUINO >= 100 #include "Arduino.h" #else #include "WProgram.h" #endif This way, the code will compile, and it will be compatible to Arduino 0023 and 1.0 versions."
Yes you have to type #include <Arduino.h> instead #include <WProgram.h> or #include <WStructure.h>
I did this modifications in JArduino projects, that's amazing ....
The file revisions.txt in the top level of the Arduino distribution chronicals all the changes
between versions - normally you would glance through this when you install a newer
version to see what's changed - you'll see all these changes are mentioned.
their has problem with ps2dev library
C:\Users\COMPAQ\Documents\Arduino\libraries\ps2dev/ps2dev.h:12:24: fatal error: WConstants.h: No such file or directory what should i do
thank u