#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <EEPROM.h>
#define ka_bwhButton 14
#define ka_atsButton 12
#define ki_bwhButton 33
#define ki_atsButton 32
#define Buzz 18
#define OLED_WIDTH 128
#define OLED_HEIGHT 64
#define OLED_RESET -1
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 oled(OLED_WIDTH, OLED_HEIGHT, &Wire, OLED_RESET);
long frekNumber;
void setup() {
if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for (;;);
}
pinMode(ka_bwhButton, INPUT_PULLUP);
pinMode(ka_atsButton, INPUT_PULLUP);
pinMode(ki_bwhButton, INPUT_PULLUP);
pinMode(ki_atsButton, INPUT_PULLUP);
pinMode(Buzz, OUTPUT);
}
void loop() {
oled.setC
oled.print(0,0,"Bud'S menu");
}
void win_Tone(){
for (uint8_t i = 0; i < 10; i++){
frekNumber = random(3000,10000);
tone(Buzz, frekNumber);
// analogWrite(Vib_DC, 250);
delay(115);
}
noTone(Buzz);
// analogWrite(Vib_DC, 0);
}
void bunyi(int freq){
tone(Buzz, freq);
delay(90);
noTone(Buzz);
}