I tried to download code for Seeed Studio Relay Shield V1.3 from Seeed Studio's website but the ZIP file is corrupted. How can I use the Relay Shield?
http://www.seeedstudio.com/wiki/images/0/09/RelayShieldDemoCode.zip
Looks like someone put a .zip file without a file extension inside that .zip file. If you add the extension and unzip that file you get:
// RelayShieldDemoCode.pde to control seeed relay shield by arduino.
// Copyright (c) 2010 seeed technology inc.
// Author: Steve Chang
// Version: september 2, 2010
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
unsigned char relayPin[4] = {4,5,6,7};
void setup()
{
int i;
for(i = 0; i < 4; i++)
{
pinMode(relayPin[i],OUTPUT);
}
}
// just an simple demo to close and open 4 relays
// every other 1s.
void loop()
{
int i=0;
for(i = 0; i < 4; i++)
{
digitalWrite(relayPin[i],HIGH);
}
delay(1000);
for(i = 0; i < 4; i++)
{
digitalWrite(relayPin[i],LOW);
}
delay(1000);
}
First Post Ever!!! in here.
Please forgive the noob question, but how do I differentiate for each relay. I seem to be missing something when trying to edit the code to only use one relay. and leave the others ready for other actions.
Thanks!
Here, each is activated for 2 seconds and deactivated, with another immediately following.
const byte Relay1 = 7;
const byte Relay2 = 6;
const byte Relay3 = 5;
const byte Relay4 = 4;
void setup ()
{
pinMode(Relay1, OUTPUT);
pinMode(Relay2, OUTPUT);
pinMode(Relay3, OUTPUT);
pinMode(Relay4, OUTPUT);
}
void loop ()
{
digitalWrite(Relay1, HIGH);
delay(2000);
digitalWrite(Relay1, LOW);
digitalWrite(Relay2, HIGH);
delay(2000);
digitalWrite(Relay2, LOW);
digitalWrite(Relay3, HIGH);
delay(2000);
digitalWrite(Relay3, LOW);
digitalWrite(Relay4, HIGH);
delay(2000);
digitalWrite(Relay4, LOW);
delay(2000);
}
OK ?
I'm going to be using this shield in a dancing bubble wall project; and hope to add another relay shield for a total of 8 channels.
Any tips or sample code offerings? Or, any suggestions on taking advantage of the "Extendible" feature of this product?
I'm noobtastic and the code posted already was very helpful as a starting point.
used your code as a template, thanx.
This should produce a bubble wall swirl pattern and hold it for 32 seconds when using solenoids thru relay.
const byte Relay1 = 7;
const byte Relay2 = 6;
const byte Relay3 = 5;
const byte Relay4 = 4;
void setup ()
{
pinMode(Relay1, OUTPUT);
pinMode(Relay2, OUTPUT);
pinMode(Relay3, OUTPUT);
pinMode(Relay4, OUTPUT);
}
void loop ()
{
digitalWrite(Relay1, HIGH);
delay(2000);
digitalWrite(Relay2, HIGH);
delay(2000);
digitalWrite(Relay3, HIGH);
delay(2000);
digitalWrite(Relay4, HIGH);
delay(32000);
digitalWrite(Relay1, LOW);
digitalWrite(Relay2, LOW);
digitalWrite(Relay3, LOW);
digitalWrite(Relay4, LOW);
delay(2000);
}
Hi i use this xbee bluetooth module
HC-05-Bluetooth-XBee-Master-Slave-Modul-RED
on the RELAY SHIELD v1.3
Relay Shield V1.3 4 Channel Arduino
and i think i make something wrong.
I couldn't been able to get it to work.
could some one explain it step by step. with all jumpers and how to setup the bluetooth module via script or AT-commands or something else.
The script on top work nicely. The relais works.
I use for the BT-Connection a Android-mobile and the "Ardudroid" APP 0$ from Store.
Mobile to HC-05 XBEE is connected and paired.
Thank you in anticipation!
i try also to download the library, but i got the message it is corrupted, i add the zip extension, with the same results.
someone knows a site where to download it?