NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include <LiquidCrystal.h>
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 7, d5 = 6, d6 = 5, d7 = 4;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

int led1 = 8; // the number of the LED which is green
int led2 = 9; // the number of the LED which is green
int ledRed = 10; // the number of the LED which is red
int Button1 = 2; // the number of the pushbutton which is used to change correctly to in correctly mount
int interruptButton = 3; // the number of the pushbutton which is used as a interrupt
int count = 0; // used as a counter
int count2 = 0; // used as a counter

const unsigned long SECOND = 1000; // constants wont change. the unsigned long is used to extended size variables for number storage
const unsigned long HOUR = 3600*SECOND;

void setup() {
// put your setup code here, to run once:
lcd.begin(16, 2);
pinMode (led1,OUTPUT); // set as output
pinMode (led2,OUTPUT); // set as output
pinMode (Button1,INPUT_PULLUP); // set as input and uses the arduino resistor.
pinMode (interruptButton,INPUT_PULLUP); // set as input and uses the arduino resistor.
attachInterrupt(digitalPinToInterrupt(interruptButton),interrupt,HIGH);
}

void loop() {
batch(); // this is used so the loop isnt long so no error will happen.
// put your main code here, to run repeatedly:
int buttonState = digitalRead (Button1); // read the state of the pushbutton value
if (buttonState == HIGH)// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
{
count = count + 1; // the counter will start counting in intervalls of 1
digitalWrite(led1,HIGH); // the green led will turn on
digitalWrite(ledRed,LOW); // the red led will turn off
lcd.setCursor(0,0); // this is set to show on the lcd what to print
lcd.print(" ");
lcd.setCursor(2,0);
lcd.print("crct");
lcd.setCursor(0,1);
lcd.print(count); // this will show the counter
delay(1000); // delay is used to the counter doesnt go to fast


} else {
count2 = count2 + 1; // the counter will start counting in intervalls of 1
digitalWrite(led1,LOW); // the green led will trun off
digitalWrite(ledRed,HIGH); // the red led will turn on
lcd.setCursor(0,0); // this is set to show on the lcd what to print
lcd.print("in");
lcd.setCursor(13,1);
lcd.print(count2);// this will show the counter
delay(1000);// delay is used so the counter doesnt go to fast
}

}
void batch () { // this will happen when the counter hits any interval of 10.
if (count == 10){ // if count equals 10
digitalWrite(led2,HIGH);// green led 2 will go high
delay(3000); // delay is used to indicate the batch
digitalWrite(led2,LOW); // the green led 2 will turn off
}

if (count == 20){ // if count equals 20
digitalWrite(led2,HIGH);// green led 2 will go high
delay(3000); // delay is used to indicate the batch
digitalWrite(led2,LOW);// the green led 2 will turn off
}

if (count == 30){ // if count equals 30
digitalWrite(led2,HIGH);// green led 2 will go high
delay(3000); // delay is used to indicate the batch
digitalWrite(led2,LOW);// the green led 2 will turn off
}

if (count == 40){ // if count equals 40
digitalWrite(led2,HIGH);// green led 2 will go high
delay(3000); // delay is used to indicate the batch
digitalWrite(led2,LOW);// the green led 2 will turn off
}
if (count == 50){ // if count equals 50
digitalWrite(led2,HIGH);// green led 2 will go high
delay(3000); // delay is used to indicate the batch
digitalWrite(led2,LOW);// the green led 2 will turn off
}
if (count == 60){ // if count equals 60
digitalWrite(led2,HIGH);// green led 2 will go high
delay(3000); // delay is used to indicate the batch
digitalWrite(led2,LOW);// the green led 2 will turn off
}
if (count == 70){ // if count equals 70
digitalWrite(led2,HIGH);// green led 2 will go high
delay(3000); // delay is used to indicate the batch
digitalWrite(led2,LOW);// the green led 2 will turn off
}
if (count == 80){ // if count equals 80
digitalWrite(led2,HIGH);// green led 2 will go high
delay(3000); // delay is used to indicate the batch
digitalWrite(led2,LOW);// the green led 2 will turn off
}
if (count == 90){ // if count equals 90
digitalWrite(led2,HIGH);// green led 2 will go high
delay(3000); // delay is used to indicate the batch
digitalWrite(led2,LOW);// the green led 2 will turn off
}
if (count == 100){ // if count equals 100
digitalWrite(led2,HIGH);// green led 2 will go high
delay(3000); // delay is used to indicate the batch
digitalWrite(led2,LOW);// the green led 2 will turn off
}
}
void interrupt () { // this void will happen when the interput pin is pressed
count = count + 0; // the counter will stop
count2 = count2 + 0; // the counter will stop
digitalWrite(led1,HIGH); // the led will turn on
digitalWrite(led2,HIGH); // the led will turn on
digitalWrite(ledRed,HIGH); // the led will turn on
delay(7*HOUR); // the delay is used to delay the interrupt for 7 hours.

}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.