MCPcopy Create free account
hub / github.com/digint/tinyfsm / main

Function main

examples/api/resetting_switch.cpp:86–110  ·  view source on GitHub ↗

---------------------------------------------------------------------------- Main

Source from the content-addressed store, hash-verified

84// Main
85//
86int main()
87{
88 fsm_handle::start();
89
90 while(1)
91 {
92 char c;
93 std::cout << std::endl << "t=Toggle, r=Restart, q=Quit ? ";
94 std::cin >> c;
95 switch(c) {
96 case 't':
97 std::cout << "> Toggling switch..." << std::endl;
98 fsm_handle::dispatch(Toggle());
99 break;
100 case 'r':
101 fsm_handle::reset();
102 fsm_handle::start();
103 break;
104 case 'q':
105 return 0;
106 default:
107 std::cout << "> Invalid input" << std::endl;
108 };
109 }
110}

Callers

nothing calls this directly

Calls 1

ToggleClass · 0.70

Tested by

no test coverage detected