Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /********* Pleasedontcode.com **********
- Pleasedontcode thanks you for automatic code generation! Enjoy your code!
- - Terms and Conditions:
- You have a non-exclusive, revocable, worldwide, royalty-free license
- for personal and commercial use. Attribution is optional; modifications
- are allowed, but you're responsible for code maintenance. We're not
- liable for any loss or damage. For full terms,
- please visit pleasedontcode.com/termsandconditions.
- - Project: "Digital Setup"
- - Source Code compiled for: Arduino Nano
- - Source Code created on: 2024-01-28 15:43:57
- ********* Pleasedontcode.com **********/
- /****** SYSTEM REQUIREMENTS *****/
- /****** SYSTEM REQUIREMENT 1 *****/
- /* On LCD1602_LCD1602I2C_I2C in the first line, show */
- /* the value "1000 PLN" and give it a name: bank RED. */
- /* On LCD1602_LCD1602I2C_I2C in the second line show */
- /* the value "1000 PLN" and give it a name: */
- /* bankZOLTY. */
- /****** END SYSTEM REQUIREMENTS *****/
- /****** DEFINITION OF LIBRARIES *****/
- #include <Arduino.h>
- #include <Wire.h>
- #include <EasyButton.h>
- #include <LiquidCrystal_I2C.h>
- /************************************************************************
- * FUNCTION PROTOTYPES
- ************************************************************************/
- void setup(void);
- void loop(void);
- /************************************************************************
- * DEFINITION OF DIGITAL INPUT PINS
- ************************************************************************/
- const uint8_t zielonyP_PushButton_PIN_D2 = 2;
- const uint8_t czerwonyP_PushButton_PIN_D3 = 3;
- /************************************************************************
- * DEFINITION OF DIGITAL OUTPUT PINS
- ************************************************************************/
- const uint8_t ledZ_LED_PIN_D4 = 4;
- const uint8_t ledC_LED_PIN_D5 = 5;
- /************************************************************************
- * DEFINITION OF I2C PINS
- ************************************************************************/
- const uint8_t LCD1602_LCD1602I2C_I2C_PIN_SDA_A4 = A4;
- const uint8_t LCD1602_LCD1602I2C_I2C_PIN_SCL_A5 = A5;
- const uint8_t LCD1602_LCD1602I2C_I2C_SLAVE_ADDRESS = 0x27;
- /************************************************************************
- * DEFINITION OF LIBRARY CLASS INSTANCES
- ************************************************************************/
- EasyButton zielonyP_PushButton(zielonyP_PushButton_PIN_D2);
- EasyButton czerwonyP_PushButton(czerwonyP_PushButton_PIN_D3);
- LiquidCrystal_I2C lcd(LCD1602_LCD1602I2C_I2C_SLAVE_ADDRESS, 16, 2);
- void setup(void)
- {
- // Configure digital input pins
- pinMode(zielonyP_PushButton_PIN_D2, INPUT_PULLUP);
- pinMode(czerwonyP_PushButton_PIN_D3, INPUT_PULLUP);
- // Configure digital output pins
- pinMode(ledZ_LED_PIN_D4, OUTPUT);
- pinMode(ledC_LED_PIN_D5, OUTPUT);
- // Initialize EasyButton instances
- zielonyP_PushButton.begin();
- czerwonyP_PushButton.begin();
- // Initialize LCD display
- lcd.begin(16, 2);
- lcd.backlight();
- // Show "1000 PLN" on the first line of the LCD and give it a name: bank RED
- lcd.setCursor(0, 0);
- lcd.print("bank RED: 1000 PLN");
- // Show "1000 PLN" on the second line of the LCD and give it a name: bankZOLTY
- lcd.setCursor(0, 1);
- lcd.print("bankZOLTY: 1000 PLN");
- }
- void loop(void)
- {
- // Read button states
- zielonyP_PushButton.read();
- czerwonyP_PushButton.read();
- }
- /************************************************************************
- * END OF CODE
- ************************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement