Show Posts
Pages: [1] 2 3 4
1  Forum 2005-2010 (read only) / Syntax & Programs / Re: Waveshield not working on: December 09, 2009, 08:01:47 pm
alrighty then

after browsin around a bit, i had the idea to change my SD card to a different one. and it worked. I guess some SD cards are better than others. So i guess for anyone out there that is experiencing this problem, you might want to try other SD cards.

thanks for all the input!
2  Forum 2005-2010 (read only) / Syntax & Programs / Re: Waveshield not working on: December 09, 2009, 01:37:19 pm
i even ran a test an SD_read test and it gave me this error

init time: 38

Card type: SD1

Manufacturer ID: 6F
OEM ID:
Product: SMI  
Version: 1.0
Serial number: 369557504
Manufacturing date: 1/2003
card size: 3920896 (512 byte blocks)
partion,boot,type,start,length
read partition table failedSD error
errorCode: 10
errorData: 0
3  Forum 2005-2010 (read only) / Syntax & Programs / Re: Waveshield not working on: December 09, 2009, 11:06:01 am
hmmm

i went ahead and tried to modify a couple of things in the code itself.

i changed the code from this:
  if (!card.init()) {//play with 8 MHz spi  
to

  if (!card.init(true)) {//play with 4 MHz spi

and i still get

No valid FAT partition!


SD I/O error: 10, 7F

the only thing i can think of is make it a FAT32 which you are NOT suppposed to do...but i am running out of options
4  Forum 2005-2010 (read only) / Syntax & Programs / Re: Waveshield not working on: December 08, 2009, 07:11:58 pm
lol we tried the whole wave shield arduino and code and ran it on the MAC, and the sound system worked perfectly.
5  Forum 2005-2010 (read only) / Syntax & Programs / Re: Waveshield not working on: December 08, 2009, 05:40:32 pm
hmm i have done that...
and the funny part is, we tried it with my friend's mac, with the EXACT configurations and setup and it worked perfectly.

could the problem be my pc laptop then?
6  Forum 2005-2010 (read only) / Syntax & Programs / Re: Waveshield not working on: December 07, 2009, 08:35:42 pm
The SD card is a mini 2 GB and its FAT 16 formatted
i basically followed it according to this site here: http://www.ladyada.net/make/waveshield/formatcard.htm
7  Forum 2005-2010 (read only) / Syntax & Programs / Re: Waveshield not working on: December 07, 2009, 08:12:32 pm
alright update

so i needed to open the file via the arduino shortcut folder, and i avoided that error. Hooray!

now i have it all successfully downloaded, but when i try to execute the code and look through the serial monitor, i keep getting the error:

Wave test!
Free RAM: 1191
No valid FAT partition!


SD I/O error: 10, 80

anyone know what that means?
8  Forum 2005-2010 (read only) / Syntax & Programs / Re: Waveshield not working on: December 07, 2009, 05:01:49 pm
ah yes i apologize. I meant to say its in the Hardware/library.
9  Forum 2005-2010 (read only) / Syntax & Programs / Waveshield not working on: December 07, 2009, 04:15:33 pm
Hello all

i am testing out the code for the Arduino Wave shield. However, whenever i try to compile the code, it tells me that my AF_Wave.h is not in the directory. And i know i copied the AF wave library AND the waveHC  into the hardware of the program. So it should technically work.

Here is my code
Code:
#include <AF_Wave.h>
#include <avr/pgmspace.h>
#include "util.h"
#include "wave.h"

AF_Wave card;
File f;
Wavefile wave;      // only one!

#define redled 9

uint16_t samplerate;

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Wave test!");

  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(redled, OUTPUT);
  
  if (!card.init_card()) {
    putstring_nl("Card init. failed!"); return;
  }
  if (!card.open_partition()) {
    putstring_nl("No partition!"); return;
  }
  if (!card.open_filesys()) {
    putstring_nl("Couldn't open filesys"); return;
  }

 if (!card.open_rootdir()) {
    putstring_nl("Couldn't open dir"); return;
  }

  putstring_nl("Files found:");
  ls();
}

void ls() {
  char name[13];
  int ret;
  
  card.reset_dir();
  putstring_nl("Files found:");
  while (1) {
    ret = card.get_next_name_in_dir(name);
    if (!ret) {
       card.reset_dir();
       return;
    }
    Serial.println(name);
  }
}

uint8_t tracknum = 0;

void loop() {
   uint8_t i, r;
   char c, name[15];


   card.reset_dir();
   // scroll through the files in the directory
   for (i=0; i<tracknum+1; i++) {
     r = card.get_next_name_in_dir(name);
     if (!r) {
       // ran out of tracks! start over
       tracknum = 0;
       return;
     }
   }
   putstring("\n\rPlaying "); Serial.print(name);
   // reset the directory so we can find the file
   card.reset_dir();
   playcomplete(name);
   tracknum++;
}

void playcomplete(char *name) {
  uint16_t potval;
  uint32_t newsamplerate;
  
  playfile(name);
  samplerate = wave.dwSamplesPerSec;
  while (wave.isplaying) {    
 // you can do stuff here!
 delay(500);
   }
  card.close_file(f);
}

void playfile(char *name) {
   f = card.open_file(name);
   if (!f) {
      putstring_nl(" Couldn't open file"); return;
   }
   if (!wave.create(f)) {
     putstring_nl(" Not a valid WAV"); return;
   }
   // ok time to play!
   wave.play();
}

any suggestions?
10  Forum 2005-2010 (read only) / Syntax & Programs / IR remote code for PICO2 projector on: November 20, 2009, 03:05:54 pm
hello all

i am trying to figure out a way to find a "remote IR" signal from the pico 2 projector such that when i use my arduino to flash my IR LED, it will turn on the projector. Any suggestions?
11  Forum 2005-2010 (read only) / Syntax & Programs / Re: getcap error? on: November 20, 2009, 07:40:34 am
ah good catch!

thank you!
12  Forum 2005-2010 (read only) / Syntax & Programs / getcap error? on: November 20, 2009, 07:03:21 am
hi im was just testing out this code
Code:
/*Capacitative Sensing Code for ATMega328 Arduinos*/
// sensor key
#define KEYPORT PORTB
#define KEYDDR  DDRB
#define KEYPIN  PINB
#define KEY0    PB0        // capture input - digital 8
#define KEY1    PB1        // capture input - digital 9
#define KEY2    PB2        // capture input - digital 10
#define KEY3    PB3        // capture input - digital 11
#define KEY4    PB4        // capture input - digital 12
#define KEY5    PB5        // capture input - digital 13



void setup() {

  Serial.begin(9600);      // connect to the serial port
}

void loop () {

  char capval[6];
  char pinval[6] = {1<<PINB0,1<<PINB1,1<<PINB2,1<<PINB3,1<<PINB4,1<<PINB5};
  delay(1000);
  for(char i = 0; i < 6; i++)
  {
    capval[i] = getcap(pinval[i]);
    Serial.print("digital ");
    Serial.print(i+8, DEC);
    Serial.print(": ");
    Serial.println(capval[i], DEC);
  }
  Serial.println("");
}

// returns capacity on one input pin // pin must be the bitmask for the pin e.g. (1<<PB0) char getcap(char pin) {

  char i = 0;
  DDRB &= ~pin;          // input
  PORTB |= pin;          // pullup on
  for(i = 0; i < 16; i++)
    if( (PINB & pin) ) break;
  PORTB &= ~pin;         // low level
  DDRB |= pin;           // discharge
  return i;
}


however, i keep getting this error

 In function 'void loop()':
error: 'getcap' was not declared in this scope At global scope:

i dont know whats up with that?
13  Forum 2005-2010 (read only) / Troubleshooting / wave shield coding issue on: October 28, 2009, 09:26:12 am
hello

i have started to build the aduino wave shield with speakers, and i think i have eveything set up correctly. I entered in this code from the website http://www.ladyada.net/media/wavshield/PlayAllLoop.pde

 and kept getting this error:
21: error: AF_Wave.h: No such file or directory In function 'void setup()':
 In function 'void ls()':
 In function 'void loop()':
 In function 'void playcomplete(char*)':
 In function 'void playfile(char*)':
Bad error line: -6

i dont have any clue as to how this is going to be fixed.
14  Forum 2005-2010 (read only) / Interfacing / Re: Communication between LEDs on: December 09, 2009, 08:03:44 pm
alright an update

the code is correct! Whenever i turn the circuit board containing the accelerometer sideways, the LED lights up!
15  Forum 2005-2010 (read only) / Interfacing / Re: Communication between LEDs on: December 04, 2009, 05:11:49 am
alrighty

so i think ill take this one step at a time:

my first goal would be to have the LED turn on whenever an accelerometer on the board is moved to a certain threshold.

i already made the code for it which i have here:
Code:
/*
    Memsic2125
    
    Read the Memsic 2125 two-axis accelerometer.  Converts the
    pulses output by the 2125 into milli-g's (1/1000 of earth's
    gravity) and prints them over the serial connection to the
    computer.
    
    The circuit:
       * X output of accelerometer to digital pin 2
       * Y output of accelerometer to digital pin 3
       * +V of accelerometer to +5V
       * GND of accelerometer to ground
  
    http://www.arduino.cc/en/Tutorial/Memsic2125
    
    created 6 Nov 2008
    by David A. Mellis
    modified 30 Jun 2009
    by Tom Igoe
  */
 // these constants won't change:
 const int xPin = 2;            // X output of the accelerometer
 const int yPin = 3;            // Y output of the accelerometer
 int LEDpin = 13;   //LED connected to digital pin 13
 int thresholdx= 100;
 int thresholdy= 100;
 // variables to read the pulse widths:
   int pulseX, pulseY;
   // variables to contain the resulting accelerations
   int accelerationX, accelerationY;
 void setup() {
   // initialize serial communications:
   Serial.begin(9600);
   // initialize the pins connected to the accelerometer
   // as inputs:
   pinMode(xPin, INPUT);
   pinMode(yPin, INPUT);
   pinMode(LEDpin, OUTPUT);
   // variables to read the pulse widths:
   int pulseX, pulseY;
   // variables to contain the resulting accelerations
   int accelerationX, accelerationY;
   // read pulse from x- and y-axes:
 }
 void loop() {
  
   // read pulse from x- and y-axes:
   pulseX = pulseIn(xPin,HIGH);  
   pulseY = pulseIn(yPin,HIGH);
   // convert the pulse width into acceleration
   // accelerationX and accelerationY are in milli-g's:
   // earth's gravity is 1000 milli-g's, or 1g.
   accelerationX = ((pulseX / 10) - 500) * 8;
   accelerationY = ((pulseY / 10) - 500) * 8;
  
   if (accelerationX >thresholdx)
   digitalWrite(LEDpin, HIGH);
   else digitalWrite(LEDpin, LOW);
  
   if (accelerationY > thresholdy)
   digitalWrite(LEDpin, HIGH);
   else digitalWrite(LEDpin, LOW);
   // print the acceleration
   Serial.print(accelerationX);
   // print a tab character:
   Serial.print("\t");
   Serial.print(accelerationY);
   Serial.println();
   delay(100);
 }

hopefully this is correct
Pages: [1] 2 3 4