Is this an Ubuntu problem? Waveshield errors

Hi,

I am running

I want the Arduino to play sound through the waveshield when I push buttons.
This is the example sketch for that:

http://www.ladyada.net/make/waveshield/libraryhcplay6.html

Test Test
—> To test whether the waveshield works with the sd-card - there is a testsketch foreseen called SdReadTest, which is where I have errors all over the place

// this sketch will do a read stress test on a SD card.
// set SD_CARD_INFO_SUPPORT to 1 in SdReader.h
// delete all .o files in the WaveHC library to force a rebuild.
// run time is about 25 seconds

#include <avr/pgmspace.h>
#include "FatReader.h"
#include "WaveUtil.h"
SdReader card;

uint8_t cidDmp(void)
{
  cid_t cid;
  if (!card.readCID(cid)) {
    putstring("readCID failed");
    sdError();
    return 0;
  }
  putstring("\nManufacturer ID: ");
  Serial.println(cid.mid, HEX);
  putstring("OEM ID: ");
  Serial.print(cid.oid[0]);
  Serial.println(cid.oid[1]);
  putstring("Product: ");
  for (uint8_t i = 0; i < 5; i++)Serial.print(cid.pnm[i]);
  putstring("\nVersion: ");
  Serial.print(cid.prv_n, DEC);
  Serial.print('.');
  Serial.println(cid.prv_m, DEC);
  putstring("Serial number: ");
  Serial.println(cid.psn);
  putstring("Manufacturing date: ");
  Serial.print(cid.mdt_month);
  Serial.print('/');
  Serial.println(2000 + cid.mdt_year_low + (cid.mdt_year_high <<4));
  Serial.println();
  return 1;
}
// print partition table
uint8_t partDmp(void)
{
  part_t pt;
  putstring_nl("partion,boot,type,start,length");  
  for (uint8_t ip = 1; ip < 5; ip++) {
      if (!card.readData(0, PART_OFFSET + 16*(ip-1), (uint8_t *)&pt, 16)) {
        putstring("read partition table failed");
        sdError();
        return 0;
      }
      Serial.print(ip, DEC); Serial.print(',');
      Serial.print(pt.boot,HEX);Serial.print(',');
      Serial.print(pt.type, HEX);Serial.print(',');
      Serial.print(pt.firstSector);Serial.print(',');
      Serial.println(pt.totalSectors); 
  }
  return true;
}

void sdError(void)
{
  putstring_nl("SD error");
  putstring("errorCode: ");Serial.println(card.errorCode(), HEX);
  putstring("errorData: ");Serial.println(card.errorData(), HEX);  
  return;
}
void setup(void)
{
  Serial.begin(9600);
}

void loop(void)
{
  putstring_nl("\ntype any character to start");
  while (!Serial.available());
  Serial.flush();
  uint32_t t0 = millis();
  uint8_t r = card.init(0);
  uint32_t d = millis()- t0;
  if (!r) {
    putstring_nl("\ncard.init failed");
    sdError();
    return;
  }
  putstring("\ninit time: ");Serial.println(d);
    putstring("\nCard type: ");
  switch(card.type()) {
    case SD_CARD_TYPE_SD1:
      putstring_nl("SD1");
      break;
    case SD_CARD_TYPE_SD2:
      putstring_nl("SD2");
      break;
    case SD_CARD_TYPE_SDHC:
      putstring_nl("SDHC");
      break;
    default:
      putstring_nl("Unknown");
  }
  
  if(!cidDmp()) return;
  uint32_t size = card.cardSize();
  if (size == 0) {
    putstring("cardSize failed");
    sdError();
    return;
  }
  putstring("card size: ");
  Serial.print(size);
  putstring(" (512 byte blocks)\n");
  if(!partDmp()) return;
  uint16_t nTest = 20000;
  uint16_t nRead = 0;
  uint8_t buf[2];
  d = size/nTest;
  uint32_t b;
  putstring_nl("Read test starting. Please Wait.");
  uint32_t m0 = millis();
  for (nRead = 0; nRead < nTest; nRead++){
    b = nRead*d;
    if (!(r = card.readData(b, 510, buf, 2))) break;
    if (nRead == 0 && (buf[0] != 0X55 || buf[1] != 0XAA)) {
      putstring("Invalid block zero signature: ");
      Serial.print(buf[0], HEX);
      Serial.print(',');
      Serial.println(buf[1], HEX);
    }
  }
  uint32_t m1 = millis();
  putstring("\nRead ");
  Serial.print(nRead);putstring_nl(" blocks");
  putstring("mills: ");Serial.println(m1 - m0);
  if(r) {
    putstring_nl("\nDone");
  }
  else {
    putstring_nl("\nRead Failure");
    putstring("lbn: ");Serial.println(b);  
    sdError();
  }
}

Error Error Error!
when I compile the SdReadTest I get this Error readout:

   /home/constant/sketchbook/libraries/WaveHC/FatReader.cpp:21:22: error: Wprogram.h: No such file or directory

    /home/constant/sketchbook/libraries/WaveHC/FatReader.cpp: In function 'void printEntryName(dir_t&)':

    /home/constant/sketchbook/libraries/WaveHC/FatReader.cpp:48: error: 'Serial' was not declared in this scope

    /home/constant/sketchbook/libraries/WaveHC/FatReader.cpp:49: error: 'Serial' was not declared in this scope

    /home/constant/sketchbook/libraries/WaveHC/FatReader.cpp:53: error: 'Serial' was not declared in this scope

    /home/constant/sketchbook/libraries/WaveHC/FatReader.cpp: In member function 'void FatReader::lsR(dir_t&, uint8_t, uint8_t)':

    /home/constant/sketchbook/libraries/WaveHC/FatReader.cpp:74: error: 'Serial' was not declared in this scope

    /home/constant/sketchbook/libraries/WaveHC/FatReader.cpp:95: error: 'Serial' was not declared in this scope

    /home/constant/sketchbook/libraries/WaveHC/FatReader.cpp:99: error: 'Serial' was not declared in this scope

    /home/constant/sketchbook/libraries/WaveHC/FatReader.cpp:102: error: 'Serial' was not declared in this scope

To be absolutely clear: the old Waveshield library works, I have sound, my sd card works like a charm - so there is nothing going wrong on that level

I have also posted this on the excellent Adafruit forum - but there was the suggestion that it would be because I use Linux, and that I should try Window$$ instead.
Which makes me sad (because I really like my Linux)

Greetz

Wendy

Your library appears to be incompatible with the current version of the Arduino software: it uses Wprogram.h, which hasn't been part of the package since some time before I started using Arduinos over a year ago.

but there was the suggestion that it would be because I use Linux, and that I should try Window$$ instead.

Well, you know what they say: in the country of the blind, the one-eyed man is burned as a heretic ;D

ide 18 does have WProgram.h, it doesn't look like it does much but it is definitely there.

But note the capitalization, it's WProgram.h, not Wprogram.h - maybe this could explain why it works on Windows and not Linux, Linux has case sensitive filenames.

I suggest editing WaveHC/FatReader.cpp , look for a line containing Wprogram.h, change it to WProgram.h , see if that works?

Stimmer, you are a GENIOUS

(this deserves capitals)

I changed the small p into a big P from WaveHC/FatReader.cpp

Wprogram.h became ----> WProgram.h

:smiley:

q(^-^q)(p^-^)p q(^-^q)(p^-^)p q(^-^q)(p^-^)p

I'll post it on the Adafruit forum