Hi
How to make changing frequency 10 times faster?
(10 * Sum++); is not working.
//https://create.arduino.cc/projecthub/abdullahaliali/the-eeprom-keeps-the-last-number-of-the-counter-7e6912
#include <EEPROM.h> //Call the instructions of the EEPROM library ,if I need them in this code.
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int buzzer = A5;
unsigned long AddressRom = 100; //The address of a location on the rom memory. I choose the(100).
unsigned long Sum = 0;//The variable of a sum.
void setup()//to run once.
{
lcd.begin(16, 2);
pinMode(buzzer, OUTPUT);
pinMode(A3, INPUT_PULLUP);
pinMode(A4, INPUT_PULLUP);
EEPROM.get(AddressRom, Sum);
}
void loop()//to run repeatedly.
{
if (digitalRead(A3) == 0) {
(10*Sum++);
EEPROM.put(AddressRom, Sum);
}
if (digitalRead(A4) == 0) {
Sum--;
EEPROM.put(AddressRom, Sum);
}
tone(buzzer, Sum);
lcd.setCursor(0, 0);
lcd.print("Hz ");
lcd.setCursor(3, 0);
lcd.print(Sum);
lcd.print(' ');
delay(20);
}