you should post your code as one single code-section
This thread describes very detaild how can re-edit your postings
never used UnoArduSim
What do you expect the program to do?
The things you have posted still make the impression
You want your homework done by others.
I tested your code in UnoArduSim the code works as expected