I have written a code to display a value read from a potentiometer
// include the library code:
#include <LiquidCrystal.h>// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);int potpin = 0;
int val;void setup() {
lcd.begin(16, 2); // set up the LCD's number of columns and rows:
}
void loop() {
lcd.print("Pot Value");lcd.setCursor(0, 1);
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 120); // prints number from 0 to 120lcd.print(val); // prints the value read from the pot
delay(70);
lcd.clear();}
Now what I want to do is I have connected an LED to PIN 9 and I want to control the blink of the LED with the same potentiometer...
Here the value which is printed on the LCD should be the seconds at which interval the led will blink like a heart beat pulse...
Please help me in doing this...