Show Posts
Pages: [1] 2 3
1  Using Arduino / Programming Questions / Re: Rogue mp3 Shield not working.... on: September 21, 2014, 06:21:02 am
Thanks but i fixed it.

I think it was a combination of using SoftwareSerial and this library -

http://www.interactiondesign.se/wiki/arduino:rmp3_audio_shield

Apparently there is a 'rogue' library out there.

FTL
2  Using Arduino / Programming Questions / Rogue mp3 Shield not working.... on: September 21, 2014, 04:35:31 am
Hi folks.

All of a sudden my well tried and tested sketch for my Rogue mp3 shield will not up load. Any help would be wonderful.... Code and error messages below.

Code:
#include <NewSoftSerial.h>
#include <RogueMP3.h>
 
NewSoftSerial rmp3_serial(6, 7);
RogueMP3 rmp3(rmp3_serial);
 
void setup()
{
 // Serial.begin(9600); //
  rmp3_serial.begin(9600);
  rmp3.setloop(0);
  rmp3.sync();
  rmp3.playfile("/track016.mp3");
 
}
 
void loop()
{
}

In file included from working_on_a_buidling.ino:1:
/Users/fasterthanlight/Documents/Arduino/libraries/NewSoftSerial/NewSoftSerial.h:71: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)'
/Users/fasterthanlight/Downloads/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'
In file included from working_on_a_buidling.ino:2:
/Users/fasterthanlight/Documents/Arduino/libraries/RogueMP3/RogueMP3.h:155: error: conflicting return type specified for 'virtual void RogueMP3::write(uint8_t)'
/Users/fasterthanlight/Downloads/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Print.h:48: error:   overriding 'virtual size_t Print::write(uint8_t)'
working_on_a_buidling:5: error: no matching function for call to 'RogueMP3::RogueMP3(NewSoftSerial&)'
/Users/fasterthanlight/Documents/Arduino/libraries/RogueMP3/RogueMP3.h:110: note: candidates are: RogueMP3::RogueMP3(Stream&)
/Users/fasterthanlight/Documents/Arduino/libraries/RogueMP3/RogueMP3.h:103: note:                 RogueMP3::RogueMP3(const RogueMP3&)
3  Using Arduino / Programming Questions / Where to add delay?? on: June 13, 2014, 10:20:31 am
Hi folks

I have a system on the the go that uses a pir to activate a relay that switches on a light for a specific amount of time.

What i want to do now is add some delay so that when the light goes off. It can't be activated again for 15s.

The question is where do i add the delay -

Code -
Code:
const int pirPin = 2;     
const int relayPin =  13;     

int pirState = 0;         

void setup() {
 
  pinMode(relayPin, OUTPUT);     
 
  pinMode(pirPin, INPUT);     
}

void loop(){

  pirState = digitalRead(pirPin);

 
  if (pirState == HIGH) {     
    digitalWrite(relayPin, LOW);
    delay(110200);
    digitalWrite(relayPin, HIGH);

  }
  else {
    digitalWrite(relayPin, HIGH);
   

  }
}
4  Using Arduino / Project Guidance / Re: PIR controlled relay - timing issues on: June 10, 2014, 05:01:45 am
Thanks everyone.

If i use the BWD approach... would it be possible to then have more that one pir controling more that one relay that can be activated even if one or more relay is open?

Hope that makes sense.

FTL
5  Using Arduino / Project Guidance / Re: PIR controlled relay - timing issues on: June 10, 2014, 04:51:53 am
I see. it must be then a fast trigger after the delay time.

Thank you.

6  Using Arduino / Project Guidance / Re: PIR controlled relay - timing issues on: June 10, 2014, 04:44:51 am
So the problem is that if the pir detects movement again within the 30000ms that the relay is told to be open it seems to reset the count to the last time that the movement was detected.

7  Using Arduino / Project Guidance / PIR controlled relay - timing issues on: June 10, 2014, 04:24:13 am
Hi Folks.

I'm sure that more questions will come up along the line but for now i could do with one answer in particular.

I'm making a controlled relay that when movement it detected the relay opens for a certain amount of time. The problem is if movement is always detected the relay stays open where as i need it to close after the aloted time no matter if there is motion or not.

Any suggestions?

My code -

Code:
const int pirPin = 2;    
const int relayPin =  13;      

int pirState = 0;        

void setup() {
  
  pinMode(relayPin, OUTPUT);      
  
  pinMode(pirPin, INPUT);    
}

void loop(){
  
  pirState = digitalRead(buttonPin);

  
  if (pirState == HIGH) {    
    digitalWrite(relayPin, LOW);
    delay(30000);
    digitalWrite(relayPin, HIGH);

  }
  else {
    digitalWrite(relayPin, HIGH);
  }
}

8  Topics / Home Automation and Networked Objects / Re: 433mhz & RC Switch Woes.... on: February 28, 2013, 12:02:54 pm
Thanks Riva... but im almost ready to give up on this... think i will pull wires instead.

smiley-sad

FTL
9  Using Arduino / Audio / Re: two mp3 players on: February 28, 2013, 11:55:17 am
Alternatively, if all the audio comes out of the same speakers, you could just overlay the audio in Audacity or so and export it as one stereo track.  Perfectly synced with only one MP3 shield needed. 

By the way, my code above loops the playing of the track endlessly.

FTL
10  Using Arduino / Audio / Re: two mp3 players on: February 28, 2013, 11:50:26 am
I believe its not possible with the sparkfun shields. But i have done exactly what you are asking with the Rogue MP3 shield - http://www.roguerobotics.com/products/electronics/rmp3 they are a little bit pricey but VERY good quality. I was more than happy with my setup.

Just stack two shields on top of one arduino. You'll need to name the tracks on each SD exactly the same and then edit your code to include that track name, but it works like a charm...

Here is my code -

Code:
#include <SoftwareSerial.h>
#include <RogueMP3.h>
 
SoftwareSerial rmp3_serial(6, 7);
RogueMP3 rmp3(rmp3_serial);
 
void setup()
{
 // Serial.begin(9600); //
  rmp3_serial.begin(9600);
  rmp3.setloop(0);
  rmp3.sync();
  rmp3.playfile("/track016.mp3");
 
}
 
void loop()
{
}

I seem to remember that the Rogue MP3 library has not been updated for 1.0 but i have an edited, working version, just PM me your email and i'll send it.

FTL.
11  Topics / Home Automation and Networked Objects / Re: 433mhz & RC Switch Woes.... on: February 24, 2013, 03:13:53 pm
Image 2.
12  Topics / Home Automation and Networked Objects / Re: 433mhz & RC Switch Woes.... on: February 24, 2013, 03:13:15 pm
First image is when each module is powered by its designated Arduino. The 2nd image is when the transmitter is powered via the reciever arduino.

1st image setup does nothing.

2nd image (2ns post) works as is to be expected... i.e. The transmitter transmits and the receiver receives exactly what i programmed the transmitter to send.

Both powered via usb.

I don't think its random RF noise considering the receiver's serial  monitor shows exactly what i programmed the reciver to transmit and with the delay i programmed too.

Very odd.

FTL

13  Topics / Home Automation and Networked Objects / Re: 433mhz & RC Switch Woes.... on: February 20, 2013, 03:26:53 pm
Ok... here is what i know.

I can only get the transmitter to transmit when it is powered by the 'receive' arduino and only when BOTH are powered via USB.

:/

FTL
14  Topics / Home Automation and Networked Objects / Re: 433mhz & RC Switch Woes.... on: February 20, 2013, 03:15:41 pm
Ah yes, but i now know (from the manufacturer) that i have it wired right. And earlier today i got it to transmit.

I can't seem to replicate that now. Perhaps a dodgy transmitter??

FTL

15  Topics / Home Automation and Networked Objects / Re: make code smaller on: February 20, 2013, 01:49:12 pm
I had a similar problem... it was easily solved by getting rid of a few 'serial print' commands. Don't keep them unless SUPER necessary. 

FTL
Pages: [1] 2 3