Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita23b579

Browse files
committed
modified: README.md
modified: examples/AuCP_Fan-Control-With-A-Thermostat/AuCP_Fan-Control-With-A-Thermostat.inomodified: src/FiniteState.h
1 parent5fdd8a4 commita23b579

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

‎README.md‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ Finite-State provides a bounded state machine that combines `state transitions`,
1414

1515
```C
1616
typedefstruct {
17-
StateFunc stateFunc; // State Function
1817
PredicateFunc predicateFunc; // Predicate Function
1918
id_t current; // Current State
2019
id_t next; // Next State
20+
StateFunc stateFunc; // State Function
2121
EventFunc eventFunc; // Event Function
22-
}StateTransition;
22+
}Transition;
2323
```
2424
##Initial State
2525
The Finite-State require to initial with an initial id.
@@ -28,6 +28,10 @@ The Finite-State require to initial with an initial id.
2828
voidbegin(const id_t id);
2929
```
3030
31+
Example:
32+
```C
33+
objectName.begin(3); // FSM begins with Initial Transition Id 3
34+
```
3135

3236
##Predicate Function (Input)
3337

@@ -72,7 +76,7 @@ State:
7276
```C
7377
typedefstruct {
7478
id_t id; // State id
75-
bool firstScan; // First Scan when Activated
79+
bool firstScan; // First Scan whenStateActivated
7680
} State;
7781
```
7882
NOTE: The Id can also be obtained from`objectName.id`.
@@ -173,7 +177,6 @@ void FanControl(id_t id);
173177
long temperature;
174178

175179
void setup() {
176-
Serial.begin(115200);
177180
for (uint8_t index = 0; index < numberOfStatus; index++) {
178181
pinMode(statusPins[index], OUTPUT);
179182
digitalWrite(statusPins[index], LOW);

‎examples/AuCP_Fan-Control-With-A-Thermostat/AuCP_Fan-Control-With-A-Thermostat.ino‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ void FanControl(id_t id);
3333
long temperature;
3434

3535
voidsetup() {
36-
Serial.begin(115200);
3736
for (uint8_t index =0; index < numberOfStatus; index++) {
3837
pinMode(statusPins[index], OUTPUT);
3938
digitalWrite(statusPins[index], LOW);

‎src/FiniteState.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ typedef struct {
3030

3131
typedefstruct {
3232
id_t id;// State id
33-
bool firstScan;// First Scan when Activated
33+
bool firstScan;// First Scan whenStateActivated
3434
} State;
3535

3636
typedefbool (*PredicateFunc)(id_t);// Predicate Function Pointer
@@ -51,7 +51,7 @@ class FiniteState {
5151
Transition *_transitions;// Tranistion Pointer
5252
uint8_t _numberOfTransitions;// Number of Transitions
5353
State _state;// State
54-
EventArgs _eventArgs;// Eventargument
54+
EventArgs _eventArgs;// EventArgument
5555
bool _initial;// Initial State
5656

5757
voidInternalTransition();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp