Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
samples: fix use of switch input ports
Browse files Browse the repository at this point in the history
It was changed on soletta to be an array port.

Signed-off-by: Bruno Dilly <[email protected]>
  • Loading branch information
bdilly committed Sep 11, 2015
1 parent 138618b commit 3b5c59b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion soletta_module/samples/foosball/foosball.fbp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ red_winner OUT -> INC state
yellow_winner OUT -> STOP time
red_winner OUT -> STOP time

sml PROCESS_END -> IN game_over(switcher/empty)
sml PROCESS_END -> IN[0] game_over(switcher/empty)
game_over OUT[0] -> RESET time
game_over OUT[0] -> INC state
game_over OUT[0] -> RESET yellow_goalkeeper
Expand Down
16 changes: 8 additions & 8 deletions soletta_module/samples/foosball/foosball_machine.fbp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#Foosball SML
INPORT=goalkeeper1.IN:GOAL_KEEPER1
INPORT=striker1.IN:STRIKER1
INPORT=goalkeeper2.IN:GOAL_KEEPER2
INPORT=striker2.IN:STRIKER2
INPORT=winner1.IN:WINNER1
INPORT=winner2.IN:WINNER2
INPORT=goalkeeper1.IN[0]:GOAL_KEEPER1
INPORT=striker1.IN[0]:STRIKER1
INPORT=goalkeeper2.IN[0]:GOAL_KEEPER2
INPORT=striker2.IN[0]:STRIKER2
INPORT=winner1.IN[0]:WINNER1
INPORT=winner2.IN[0]:WINNER2
INPORT=sml.PREDICTION_TRIGGER:PREDICTION_TRIGGER
OUTPORT=predicted_winner1.OUT[0]:PREDICTED_WINNER1
OUTPORT=predicted_winner2.OUT[0]:PREDICTED_WINNER2
Expand Down Expand Up @@ -84,8 +84,8 @@ sml_winner(converter/int-to-float) OUT -> IN tagger(machine-learning/tagger:tag=
tagger OUT -> OUT_ID_VAR sml

sml OUT -> IN FilterSml(machine-learning/filter:tag=winner)
FilterSml OUT -> IN _(converter/float-to-empty:range=min:0.5|max:1.5) OUT -> IN predicted_winner1(switcher/empty)
FilterSml OUT -> IN _(converter/float-to-empty:range=min:1.5|max:2) OUT -> IN predicted_winner2(switcher/empty)
FilterSml OUT -> IN _(converter/float-to-empty:range=min:0.5|max:1.5) OUT -> IN[0] predicted_winner1(switcher/empty)
FilterSml OUT -> IN _(converter/float-to-empty:range=min:1.5|max:2) OUT -> IN[0] predicted_winner2(switcher/empty)

#Phase 1 - start
state_start_phase1 OUT -> IN phase1_goalkeeper1(converter/empty-to-int)
Expand Down
16 changes: 8 additions & 8 deletions soletta_module/samples/foosball/multiple_player_selector.fbp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

INPORT=reset.IN:RESET
INPORT=reset.IN[0]:RESET
INPORT=enabled_hub.IN:ENABLED
INPORT=btn_hub.IN[0]:BTN_CHANGE_PLAYER
INPORT=next_hub.IN[0]:BTN_NEXT
Expand All @@ -41,7 +41,7 @@ OUTPORT=done.OUT:DONE

#inputs
reset(switcher/empty)
_(constant/boolean:value=true) OUT -> IN enabled_hub(switcher/boolean)
_(constant/boolean:value=true) OUT -> IN[0] enabled_hub(switcher/boolean)
btn_hub(boolean/and)
enabled_hub OUT[0] -> IN[1] btn_hub
next_hub(boolean/and)
Expand All @@ -52,15 +52,15 @@ next_hub OUT -> PULSE_IF_TRUE _(converter/boolean-to-empty) OUT -> INC player_se
timer(timer:interval=10) OUT -> INC player_selection
timer OUT -> IN _(converter/empty-to-boolean:output_value=false) OUT -> ENABLED timer
reset OUT[0] -> IN enable_timer(converter/empty-to-boolean:output_value=true) OUT -> ENABLED timer
enable_timer OUT -> IN enabled_hub
enable_timer OUT -> IN[0] enabled_hub

#state machine
player_selection(int/accumulator:setup_value=min:0|max:5)
player_selection OUT -> IN state_player1(converter/int-to-boolean:true_range=min:1|max:1)
player_selection OUT -> IN state_player2(converter/int-to-boolean:true_range=min:2|max:2)
player_selection OUT -> IN state_player3(converter/int-to-boolean:true_range=min:3|max:3)
player_selection OUT -> IN state_player4(converter/int-to-boolean:true_range=min:4|max:4)
player_selection OUT -> IN done(converter/int-to-empty:range=min:5|max:5) OUT -> IN _(converter/empty-to-boolean:output_value=false) OUT -> IN enabled_hub
player_selection OUT -> IN done(converter/int-to-empty:range=min:5|max:5) OUT -> IN _(converter/empty-to-boolean:output_value=false) OUT -> IN[0] enabled_hub
reset OUT[0] -> RESET player_selection

#Player1
Expand Down Expand Up @@ -105,10 +105,10 @@ _(constant/string:value="Player 4: ") OUT -> IN[0] lcd4(string/concatenate)
player4 OUT -> IN _(converter/int-to-string) OUT -> IN[1] lcd4
state_player4 OUT -> PULSE_IF_TRUE _(converter/boolean-to-empty) OUT -> IN _(converter/empty-to-string:output_value="Player 4: 0") OUT -> IN lcd

lcd1 OUT -> IN lcd(switcher/string)
lcd2 OUT -> IN lcd
lcd3 OUT -> IN lcd
lcd4 OUT -> IN lcd
lcd1 OUT -> IN[0] lcd(switcher/string)
lcd2 OUT -> IN[0] lcd
lcd3 OUT -> IN[0] lcd
lcd4 OUT -> IN[0] lcd

#Don't allow multiple players selection
player1 OUT -> IN[0] player2_cmp(int/equal)
Expand Down
2 changes: 1 addition & 1 deletion soletta_module/samples/garden/controller.fbp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

INPORT=acc.IN:IN
INPORT=acc.IN[0]:IN
OUTPORT=acc.OUT:OUT

acc(switcher/float) OUT[0] -> OUTPUT_VALUE acc_flush
Expand Down
4 changes: 2 additions & 2 deletions soletta_module/samples/sml_garden/flower_power_status.fbp
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ ErrorToBoolean(converter/empty-to-boolean:output_value=false)
FlowerPowerPacket(flower-power/get-value) WATER -> IN FloatToBoolean(converter/float-to-boolean:true_range=min:-1000|max:10000)


ErrorToBoolean OUT -> IN LedOutput(switcher/boolean:out_port=0)
FloatToBoolean OUT -> IN LedOutput
ErrorToBoolean OUT -> IN[0] LedOutput(switcher/boolean:out_port=0)
FloatToBoolean OUT -> IN[0] LedOutput

0 comments on commit 3b5c59b

Please sign in to comment.