drewfish / arduino-trimwright Goto Github PK
View Code? Open in Web Editor NEWUML State Machines for Arduino
License: MIT License
UML State Machines for Arduino
License: MIT License
I observed in the blink example (blink/main.cpp) that the state machine first processes "ENTER" before processing "INIT".
blink.init((State) &Blink::stateON);
In the init() code below from TrimWright.cpp, what is the purpose of having it sending the SIG_ENTER before sending SIG_INIT? One would think that init() should only cause a SIG_INIT event.
FSM::init(State initial) { m_stateCurrent = initial; _TW_PSEUDO(m_stateCurrent, SIG_ENTER);
Is there a way to initialize the state machine without entering the state?
Eddie
FYI
I got a linker error when trying to build a android library using another library that has the TrimWright .h and .cpp in it.
The error is:
out/target/product/myExperiment/obj_arm/SHARED_LIBRARIES/libneorender_intermediates/src/UsRenderer.o:UsRenderer.cpp:typeinfo for gfx::UsRenderer: error: undefined reference to 'typeinfo for StateMachineTrimWright::FSM'
The error was resolved by making the function below non virtual (it doesn't make sense to me why this would be a linker issue).
// This dispatches an event to the current state.
// It doesn't generally need to be overridden by child classes.
//virtual void dispatch(const Event* event);
void dispatch(const Event* event);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.