relay on off on the basis of others relay operation condition
i want on/off 1 relay on basis of other relay operation condition.
i trued in way.but if loop doesn't work.please me
#define relay2 46
#define relay4 30
#define relay3 31
pinmode(relay2, output);
pinmode(relay3, output);
pinmode(relay4, output);
if(relay3==low)
{
digitalwrite(relay4,low);
if(current01>0.50)
{
digitalwrite(relay3,high);
}
}
i trued in way.but if loop doesn't work.please me
#define relay2 46
#define relay4 30
#define relay3 31
pinmode(relay2, output);
pinmode(relay3, output);
pinmode(relay4, output);
if(relay3==low)
{
digitalwrite(relay4,low);
if(current01>0.50)
{
digitalwrite(relay3,high);
}
}
try:
code: [select]
#define relay2 46
#define relay4 30
#define relay3 31
void setup()
{
pinmode(relay2, output);
pinmode(relay3, output);
pinmode(relay4, output);
}
void loop()
{
if (digitalread(relay3) == low)
{
digitalwrite(relay4, low);
if (current01 > 0.50)
{
digitalwrite(relay3, high);
}
}
}
Arduino Forum > Using Arduino > Programming Questions > relay on off on the basis of others relay operation condition
arduino
Comments
Post a Comment