Piano Project - How to explain the Code.

Hello Everybody,

I am currently doing my exams and I choose arduino as my topic.
I am doing an piano Project. -> (My Current Project. (Link 1))
And I have to explain the code. (what everything exactly means and so)
The only thing is that it is a bit hard to explain.
I would put the code in different parts, so that I say: in this part it happens that and that, the most important code in this is that. And so on. What do you think?
Could you tell me how you would explain the Project Code ?

-=-=-=-=-=-=-=-=-=-=-=-=-
-=-=-=-=-=-=-=-=-=-=-=-=-

Link 1
My Project:
https://create.arduino.cc/projecthub/lindsi8784/electronic-piano-keyboard-with-preset-songs-74ee7c?f=1

-=-=-=-=-=-=-=-=-=-=-=-=-
-=-=-=-=-=-=-=-=-=-=-=-=-

You´ll find the code in Link 1

Thanks for everybody who helps me.

[If i would insert the code here it would say:
The message has the following error or errors that must be corrected before continuing:
The message exceeds the maximum allowed length (9000 characters).]

Could you tell me how you would explain the Project Code ?

Did you write the code ? I note that it has had over 83,000 views so is presumably not that new

The project you linked to has a section entitled "How the code works". Do you understand that section ?

Were you supposed to create your own project or is it permissible to "borrow" an existing one ?

No. Ita is not my own project i had to hurry so i wrote this post as fast as possible and didn't had enough time to readit once more. Sorry for that.
I didn't noticed that section before.

It is very helpfull for sure. But i have to explain it really good.

Do you know any commands in the code which are very important, they would be helpfull.

Thanks for ur help. Really Appreciate it.

u-cqhlul:
Do you know any commands in the code which are very important, they would be helpfull.

Probably all of them.

Will you be presenting this project as your original work? Or, will you state that you're simply explaining someone else's work?

And, if you need someone from the Forum to explain it to you, what exactly will be your original contribution to the effort?

i had to hurry

As a matter of interest, how long have you had to prepare for this assignment ?

u-cqhlul:
No. Ita is not my own project i had to hurry so i wrote this post as fast as possible and didn't had enough time to readit once more. Sorry for that.
I didn't noticed that section before.

It is very helpfull for sure. But i have to explain it really good.

Do you know any commands in the code which are very important, they would be helpfull.

Thanks for ur help. Really Appreciate it.

Code is always better explained with a flow chart (per method/algorithm) or a uml activity diagram (class interaction), than with plain text.

If you have to "explain it really good" you're first going to have to understand it really good. If you don't understand what you are trying to explain then you should expect to fail.

And I can assure you that all of the commands are very important. If you take any one of them out it will stop working.

Steve

The OP will probably never read this - too busy with assignment.

But, in the future when you know you will have to explain the program code, write the program using as many general functions as you can. Then you only need to explain the functions, not each line of code, which will put everyone in the audience to sleep or will take days to complete.

Paul

when you know you will have to explain the program code, write the program using as many general functions as you can. Then you only need to explain the functions, not each line of code, which will put everyone in the audience to sleep or will take days to complete.

Good advice when you actually write the code that you are trying to explain. However, in this case the OP did not write the code

UKHeliBob:
Good advice when you actually write the code that you are trying to explain. However, in this case the OP did not write the code

After two weeks, I can't even explain the code in programs I wrote!

Paul

u-cqhlul:
And I have to explain the code. (what everything exactly means and so)

Bravo! Bravo that teacher, that institution!

Back in the day, an examination would involve you sitting down with four professors and a blackboard, and they would proceed to examine you. They would evaluate if you really did in fact know what you were supposed to. It's the only way to prevent academic fraud.

It seems they are rediscovering this. People like OP just honestly don't get the very idea of learning a subject. They have this idea that all that matters is getting that bit of sheepskin, however it might be done. They are just so corrupt that they don't get the idea of passing their courses by means of actually learning the stuff.

OP: I have bad news for you. To pass your course, you actually have to be able to program. And indications are that you cannot. Even if we did help you out and write out an explanation of the code, all that would happen is that your prof would ask more and more detailed questions about what you purport to have done until it becomes obvious that you just don't know because you didn't write it. Writing out a full explanation would take hours of my time. And understanding what I had written would be every bit as difficult as understanding the code itself, because it would amount to the same thing.

As Euclid reputedly said: δεν υπάρχει κανένας βασιλικός δρόμος για τη γεωμετρία .

I actually just rebuild that project, made an box for it and have to explain it in two weeks on thursday.
And yes i know how the code works, what it does and i know like 70% of the commands. so i guess i am good prepared.

Thank you guys.

Another problem came up just right now. when i upload the code i can just play the first song. The Display shows up just this. 1. What Song would you like to play? Then. 2. Playing: Super Mario Bros Theme Song.
When i just do nothing it makes an scratch sound. Also i can't use the piano keys. when i press them nothing happens. :slight_smile: is it becouse of the code?

btw. When the first song plays there is no scratch sound.

is it becouse of the code?

i know how the code works

So you should be able to find the problem

Add some Serial.print()s to your the code to see which sections are being called and the value of pertinent variables at those points. Are you sure that you don't have a hardware problem ?

u-cqhlul:
And yes i know how the code works, what it does and i know like 70% of the commands.

Personally, when I write code I know what all of it does.