Custom LED blink with 3 bottons & LCD / help a newbie

Hi
I got an arduino mega 2568 as a gift
I have no programming knowledge
For the past week i tried to make something interesting with my arduino

I want to make a led to blink 1/min , 2/min, 3/min, 4/min , 5min & blink now (3’d button)

The buttons:

  • button 1 and 2 selects the blink 1/min , 2/min, 3/min, 4/min , 5min (EDIT: blink [dosent mather how long] once per min … twice a minute …etc)
  • button 3 blinks when pushed and continues the blink 1/min , 2/min, 3/min, 4/min , 5min where he left

The LCD: prints = 1/min , 2/min, 3/min, 4/min , 5min and BLINK NOW

So …i need help with this because i don’t have any programming knowledge and it would take me another 2 weeks to finish this … by then i will hate everything about arduino, and i don’t want that to happen.

The past week i learned a lot, the basics of programming, how to do your pcb and how to solder . Its been a productive week … but this code kills me, every day i wake up and try to find something that i can modify to do what i want … nothing … i don’t even know what to search …

so this is what i managed for the first time … with some help from friends before they stop answering my phone calls :smiley:

EDIT: this is only the starting part of the code
the last part dosent work …so no point of posting it

some code for arduino
(one of many)

#include <LiquidCrystal.h>
LiquidCrystal lcd(13,12,11,10,9,8);


// this constant won't change:

int ledPin = 7;       // the pin that the LED is attached to
int  buttonA = A1;    // the pin that the pushbutton is attached to
int  buttonAval = 0;
int  buttonB = A2;    // the pin that the pushbutton is attached to
int  buttonBval = 0;
int  buttonC = A3;    // the pin that the pushbutton is attached to
int  buttonCval = 0;



// Variables will change:
//int buttonState      = 0;     // current state of the button
//int lastButtonState  = 0;     // previous state of the button
//int ledState         = 0;     // remember current led state
int buttonPushCounter = 0;   // counter for the number of button presses
int buttonState = 0;         // current state of the button
int lastButtonState = 0;     // previous state of the button




void setup() {
  
   pinMode(ledPin, OUTPUT);
   pinMode(buttonA, INPUT);
   pinMode(buttonB, INPUT);
   pinMode(buttonC, INPUT);
}

void loop(){
buttonAval = digitalRead(buttonA);

  if (ledPin ==LOW)
      digitalWrite(ledPin, HIGH);  

   lcd.begin(16,2);
   lcd.setCursor(0,1);
   lcd.print("1/min);
   delay (2000);

sch.jpg

Your code is a bit short and missing some vital elements. Did you forget to copy the rest of it or is that all you have ?

Have you tried any of the examples included with the IDE ? They will show you how to read a button and how to blink an LED which is the basis of what you want to do. Look particularly at the BlinkWithoutDelay example as this will stand you in good stead later in your project when you need read a button whilst blinking an LED.

You will also need to explain what you mean by 'blink 1/min, 2/min' etc. Do you mean once a minute, twice a minute or something else ? How long should the LED remain on and off when it blinks ?

@UKHeliBob

For one week i've done most of examples from IDE, trying to modify them, merge them ... believe me i tried everything

I'm not the type to search help because i'm lazy but i cant learn programming in a couple of weeks ... so thats why i need help, i learn by doing things ... but now i got my first pcb made ..and nothing to put on it and i say it again ... i don't wanna hate programming because it lasted 1 month to make a led blink

So .. if anyone could help me with this code i will be eternal gratefully and pls dont point me to something ... because i tried every code with buttons and led blink out there ( believe me 1 week of googling ) ... and i would probably wont get it ... i just cant make it now alone, maybe with time when i have learn something

and with this code i'm planing to play a lot more .. modifying it and do different things

with this code i'm planing to play a lot more .. modifying it and do different things

So start with the examples in the IDE and modify them towards what you want to do.

Have you managed to get any text on the LCD ? If so, can you make the text change after a while ? Have you tried the BlinkWithoutDelay example ? Can you incorporate parts of the the first program in the second one so that the LED blinks and the test changes independently ?

I think that it is unlikely that anyone will just supply you with code to do what you want, particularly as it is not clear exactly what you want.

Incidentally, what does the circuit on the PCB do ?