POT value incriments by a value
would possible increase vale of pot steps of value 50.
from above code wish increase value of value steps of 50. such every value pot value shoult increase 50, 150, 200, 250.....450
code: [select]
const int relay = 4;
const int weldbtn = 2;
const int pot = a0;
int potvalue = 0;
const int preweldbtn_ms = 10;
const int pause_ms = 500;
const int weld_step = 50;
int value = 0;
int buttonstate = 0;
void setup()
{
pinmode (relay, output);
pinmode (weldbtn, input_pullup);
serial.begin(9600);
}
void loop()
{
buttonstate = digitalread(weldbtn);
if (buttonstate == low)
{
potvalue = analogread(pot);
value = map(potvalue,0,1023,50,450);
digitalwrite(relay,high);
delay(preweldbtn_ms);
serial.print("relay on: ");
serial.println(preweldbtn_ms);
digitalwrite(relay,low);
delay(pause_ms);
serial.print("relay off: ");
serial.println(pause_ms);
digitalwrite(relay,high);
delay(value);
serial.print("relay on: ");
serial.println(value);
serial.println("");
}
else
{
digitalwrite(relay,low);
}
}
from above code wish increase value of value steps of 50. such every value pot value shoult increase 50, 150, 200, 250.....450
how multiplication operator?
(what happened 100?)
(what happened 100?)
Arduino Forum > Using Arduino > Project Guidance > POT value incriments by a value
arduino
Comments
Post a Comment