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

Commit

Permalink
Add demo repository
Browse files Browse the repository at this point in the history
This patch also changes .gitignore

Signed-off-by: Bruno Bottazzini <bruno.bottazzini@intel.com>
  • Loading branch information
Bruno Bottazzini committed Nov 10, 2015
1 parent 4a2d17f commit c33f620
Show file tree
Hide file tree
Showing 37 changed files with 1,963 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/repos/*
/node_modules/*
/client/libs/*
/sessions
33 changes: 33 additions & 0 deletions repos/singlesession/demo/grove-kit/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
This showcases the Intel boards using the Grove Starter Kit

http://www.seeedstudio.com/depot/Grove-starter-kit-plus-Intel-IoT-Edition-for-Intel-Galileo-Gen-2-and-Edison-p-1978.html
http://www.intel.com/content/www/us/en/embedded/products/galileo/galileo-overview.html

Grove Starter Kit Plus - Intel IoT Edition for Intel Galileo Gen 2
Developer Kit is a complete hardware & software solution to help you
explore the IoT space and create innovative projects. It is a starter
kit for Intel Galileo Gen2 providing a collection of sensors,
actuators and shields.

Most of the samples are translations of Arduino Sketches, these are
listed inside each script.

Since the components may be assembled on different hardware I/O, one
need to declare its configuration file with the correct pins to use.
For instance, say your board already has a configuration file or you have
written your own, then run:

$ ./grove-button.fbp

Same for other files with associated ".json". If you fail to do so,
you may receive an error such as:

$ ./grove-button.fbp
./grove-button.fbp:37:1 Couldn't resolve type name 'Button'

This is because there is no Button group in one
configuration file supported by the system, you can define one using
the environment variable.

Alternatively you can define all your entries in a file called
'sol-flow.json' and it will be looked up in the current folder.
37 changes: 37 additions & 0 deletions repos/singlesession/demo/grove-kit/grove-button.fbp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env sol-fbp-runner
# This file is part of the Soletta Project
#
# Copyright (C) 2015 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# sol-fbp-runner grove-button.fbp

# This is a translation of Grove_Button/Grove_Button.ino, from
# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git

button(Button) OUT -> IN led(LED)
37 changes: 37 additions & 0 deletions repos/singlesession/demo/grove-kit/grove-buzzer.fbp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env sol-fbp-runner
# This file is part of the Soletta Project
#
# Copyright (C) 2015 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# sol-fbp-runner grove-buzzer.fbp

# This is a translation of Grove_Buzzer/Grove_Buzzer.ino, from
# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git

init_val(constant/boolean:value=true) OUT -> ENABLED buzzer(Buzzer:tune="ccggaagffeeddc |111111211111124|300")
74 changes: 74 additions & 0 deletions repos/singlesession/demo/grove-kit/grove-led-accumulator.fbp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/usr/bin/env sol-fbp-runner
# This file is part of the Soletta Project
#
# Copyright (C) 2015 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# sol-fbp-runner grove-led-accumulator.fbp

# This is one of the translations of Grove_LED/Grove_LED.ino, from
# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git
# Here we exemplify the usage of the accumulator node type in order to
# do the original file's looping. There's a more direct, less verbose
# way of doing that, though -- check grove-led-wave-generator.fbp

# We split the duty_cycle of 2040816 ns (490 Hz for full intensity),
# into 256 slices of 7971, mimicking analogWrite()'s range: 0 to 255

false(constant/boolean:value=false)
constant_max(constant/int:value=255)
constant_min(constant/int:value=0)

timer_mid_delay(timer:interval=100) OUT -> RESET timer_dec
false OUT -> ENABLED timer_mid_delay

timer_final_delay(timer:interval=500) OUT -> RESET timer_inc
false OUT -> ENABLED timer_final_delay

timer_inc(timer:interval=5)
timer_inc OUT -> INC acc(int/accumulator:setup_value=min:0|max:2032605|step:7971)
timer_inc OUT -> IN _(converter/empty-to-boolean:output_value=false) OUT -> ENABLED timer_final_delay

timer_dec(timer:interval=5)
timer_dec OUT -> DEC acc
timer_dec OUT -> IN _(converter/empty-to-boolean:output_value=false) OUT -> ENABLED timer_mid_delay
false OUT -> ENABLED timer_dec

acc OUT -> DUTY_CYCLE led(LED_PWM)

acc OUT -> IN[0] comp_max(int/equal)
constant_max OUT -> IN[1] comp_max
comp_max OUT -> PULSE_IF_TRUE _(converter/boolean-to-empty) OUT -> IN at_max(converter/empty-to-boolean:output_value=true)
at_max OUT -> IN _(boolean/not) OUT -> ENABLED timer_inc
at_max OUT -> RESET timer_mid_delay

acc OUT -> IN[0] comp_min(int/equal)
constant_min OUT -> IN[1] comp_min
comp_min OUT -> PULSE_IF_TRUE _(converter/boolean-to-empty) OUT -> IN at_min(converter/empty-to-boolean:output_value=true)
at_min OUT -> IN _(boolean/not) OUT -> ENABLED timer_dec
at_min OUT -> RESET timer_final_delay
55 changes: 55 additions & 0 deletions repos/singlesession/demo/grove-kit/grove-led-wave-generator.fbp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env sol-fbp-runner
# This file is part of the Soletta Project
#
# Copyright (C) 2015 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# sol-fbp-runner grove-led-generator.fbp

# This is one of the translations of Grove_LED/Grove_LED.ino, from
# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git
# Here we exemplify the usage of the wave generator node type in order
# to do the original file's looping. There's another example doing
# that by means of the accumulator node -- check
# grove-led-accumulator.fbp

# We split the duty_cycle of 2040816 ns (490 Hz for full intensity),
# into 256 slices of 7971, mimicking analogWrite()'s range: 0 to 255

constant_duty_cycle_step(constant/float:value=7971)

timer(timer:interval=5)

# min_ticks: 100 * 5 ms = 500 ms. max_ticks: 20 * 5 ms = 100 ms
wave(float/wave-generator-trapezoidal:min=0,max=255,ticks_inc=255,ticks_dec=255,ticks_at_min=100,ticks_at_max=20,tick_start=100)

timer OUT -> TICK wave

constant_duty_cycle_step OUT -> OPERAND[1] mult(float/multiplication)
wave OUT -> OPERAND[0] mult
mult OUT -> IN conv(converter/float-to-int) OUT -> DUTY_CYCLE led(LED_PWM)
39 changes: 39 additions & 0 deletions repos/singlesession/demo/grove-kit/grove-light-sensor.fbp
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env sol-fbp-runner
# This file is part of the Soletta Project
#
# Copyright (C) 2015 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# sol-fbp-runner grove-light-sensor.fbp

# This is a translation of Grove_Light_Sensor/Grove_Light_Sensor.ino, from
# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git

# The original 400 value maps to LUX ~6

lightSensor(LightSensor) LUX -> IN analogToBool(converter/float-to-boolean:true_range=min:6) OUT -> IN led(LED)
37 changes: 37 additions & 0 deletions repos/singlesession/demo/grove-kit/grove-relay.fbp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env sol-fbp-runner
# This file is part of the Soletta Project
#
# Copyright (C) 2015 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# sol-fbp-runner grove-relay.fbp

# This is a translation of Grove_Relay/Grove_Relay.ino, from
# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git

button(Button) OUT -> IN relay(Relay)
41 changes: 41 additions & 0 deletions repos/singlesession/demo/grove-kit/grove-rotary-angle-sensor.fbp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env sol-fbp-runner
# This file is part of the Soletta Project
#
# Copyright (C) 2015 Intel Corporation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Intel Corporation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# sol-fbp-runner grove-rotary-angle-sensor.fbp

# This is a translation of
# Grove_Rotary_Angle_Sensor/Grove_Rotary_Angle_Sensor.ino, from
# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git,
# but showing degrees instead.

sensor(RotaryAngleSensor) DEG -> IN converter(converter/float-to-string) OUT -> IN screen(LCDString)

initial_color(constant/rgb:value=255|255|255|255|255|255) OUT -> COLOR screen
Loading

0 comments on commit c33f620

Please sign in to comment.