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
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);