send note in play_note() function

This commit is contained in:
Vineet K 2024-04-21 22:21:24 -04:00 committed by Shokara Kou
parent 21a33a8cdc
commit 4644a4b0ae

View File

@ -192,6 +192,8 @@ play_note(unsigned char _note, unsigned short _cycles)
{ {
note = _note; note = _note;
usart_send(note);
if (note != 255) { if (note != 255) {
for (unsigned short i = 0; i < _cycles; i++) for (unsigned short i = 0; i < _cycles; i++)
playtone(); playtone();
@ -247,9 +249,6 @@ main(void)
// if a button was released, then send note and cycles played // if a button was released, then send note and cycles played
if (cycles > 0) { if (cycles > 0) {
usart_send(tmp); usart_send(tmp);
usart_send(HIGH(cycles));
usart_send(LOW(cycles));
usart_send(0xff);
cycles = 0; cycles = 0;
} }
continue; continue;