diff --git a/Homework/Homework4/Homework4.ino b/Homework/Homework4/Homework4.ino new file mode 100644 index 0000000..43d874a --- /dev/null +++ b/Homework/Homework4/Homework4.ino @@ -0,0 +1,38 @@ +#include "SoftwareSerial.h" +#include "U8glib.h" + +const byte bt_tx_connected_to = 11; +const byte bt_rx_connected_to = 12; + +String pass = "0721"; +String recovery_pass + +SoftwareSerial bt_serial(bt_tx_connected_to, bt_rx_connected_to); +U8GLIB_SSD1306_128X32 u8g(U8G_I2C_OPT_NONE); + +void setup() { + Serial.begin(9600); + bt_serial.begin(9600); + u8g.setFont(u8g_font_courR08); +} + +void loop() { + draw_locked(); + delay(1000); + draw_unlocked(); + delay(1000); +} + +void draw_unlocked() { + u8g.firstPage(); + do { + u8g.drawStr(0, 16, "Unlocked"); + } while (u8g.nextPage()); +} + +void draw_locked() { + u8g.firstPage(); + do { + u8g.drawStr(0, 8, "Locked"); + } while (u8g.nextPage()); +} \ No newline at end of file