Hello, I need your help. can anyone have an example code for a graphical display

But I guess it's too complicated for my level of knowledge. I'm very sorry sad.

Don't be sad. I guess it is more a learning curve. Working with C or C++ in an embedded environment is complicated.

For the first part of my answer, i looked up some resources on finite state machine design for embedded systems.

This one is nice, because it covers the "creative step":
http://ceit.uq.edu.au/content/finite-state-machine-design-so-whats-problem-why-cant-students-get-it

This tutorial is more related to embedded programming:
http://www.splatco.com/fsm_tute/fsm_tute01.htm

I am not sure how to teach you on embedded software design, but maybe you get some ideas from the above links.

second, more specific answer to your problem follows later...

Oliver