Member #38730

Member Since: May 3, 2008

Country: United States

  • Oh man, big switch statements…State machines are so much better in C++ with polymorphism. All the child state classes will define a Run method, which will return the next state, or itself. That way, each class only has to deal with the state changes it will change to next. It helps make complicated state machines easier to read, as you won’t have a giant switch statement in the main loop, as it would look like this:

    currentState = new StartState ();
    while(true)
        currentState = currentState.Run ();
    

    My C is really rusty, but I’m sure the pro’s on here can make it work (function pointers in structs?)

  • These things are p*ssin me off. They keep frying my MC PWM pins!!! Why do they try to drive the stepper through the MC’s power? I’ve just got my order of two of these plus a new FEZ Panda and now it’s ruined.
    I’m so angry it’s not even remotely funny. You need to not sell hardware that fries microcontrollers.

No public wish lists :(