void DialogRecepti::beep() {//функция за звук при натискане на бутон QTime tme; GPIO *buzzer; buzzer = new GPIO(PIN31); buzzer->openPin(); buzzer->setDirection(GPIO::Out); tme.restart(); buzzer->setState(true); while(tme.elapsed()<25){qApp->processEvents();} buzzer->setState(false); buzzer->closePin(); delete buzzer; }
void DialogMenu::beep() { // qApp->beep(); QTime tme; GPIO *buzzer; buzzer = new GPIO(PIN31); buzzer->openPin(); buzzer->setDirection(GPIO::Out); tme.restart(); buzzer->setState(true); while(tme.elapsed()<25){qApp->processEvents();} buzzer->setState(false); buzzer->closePin(); delete buzzer; }