Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

State machine design for embeded applications in "C&quo

Status
Not open for further replies.

mike2002

Member level 2
Joined
Sep 16, 2002
Messages
47
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
c/c++ programming
Activity points
328
Has anyone good source for designing Finite State machine for embedded applications in "C"? Book? Good code examples etc...
 

State machine design for embeded applications in "C&amp

Yuo can easily make it with a CASE.

example

void main(void) {
int8 Status=0;
LED_OFF(LED1);
LED_OFF(LED2);
LED_OFF(LED3);
while (TRUE)
switch (Status)
{
case 0:
{
If......
Status=3;
}
break;
case 1:
{
LED_ON(LED1);
if........... {Status=0};
else Status=3;
}
break;
case 2:
{
LED_ON(LED2);
Status=1;
}
break;
case 3:
{
LED_ON(LED3);
Status=4;
}
break;
case 4:
{
LED_OFF(LED1);
LED_OFF(LED2);
LED_OFF(LED3);
...........
Status=0;
}
break;
default:
{
Status=0;
}
break;
}
}
}
 

Re: State machine design for embeded applications in "C

I am looking for more advanced methodologies!
 

Re: State machine design for embeded applications in "C

goto :
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top