From c33f620933f46953c7b97faff1c73ab54d5d9b26 Mon Sep 17 00:00:00 2001 From: Bruno Bottazzini Date: Mon, 9 Nov 2015 16:30:17 -0200 Subject: [PATCH] Add demo repository This patch also changes .gitignore Signed-off-by: Bruno Bottazzini --- .gitignore | 1 - repos/singlesession/demo/grove-kit/README | 33 +++++ .../demo/grove-kit/grove-button.fbp | 37 +++++ .../demo/grove-kit/grove-buzzer.fbp | 37 +++++ .../demo/grove-kit/grove-led-accumulator.fbp | 74 ++++++++++ .../grove-kit/grove-led-wave-generator.fbp | 55 +++++++ .../demo/grove-kit/grove-light-sensor.fbp | 39 +++++ .../demo/grove-kit/grove-relay.fbp | 37 +++++ .../grove-kit/grove-rotary-angle-sensor.fbp | 41 ++++++ .../demo/grove-kit/grove-sound-sensor.fbp | 45 ++++++ .../grove-kit/grove-temperature-sensor.fbp | 42 ++++++ .../grove-kit/lcd/grove-lcd-autoscroll.fbp | 83 +++++++++++ .../demo/grove-kit/lcd/grove-lcd-blink.fbp | 54 +++++++ .../demo/grove-kit/lcd/grove-lcd-cursor.fbp | 50 +++++++ .../demo/grove-kit/lcd/grove-lcd-display.fbp | 50 +++++++ .../demo/grove-kit/lcd/grove-lcd-fade.fbp | 73 +++++++++ .../grove-kit/lcd/grove-lcd-hello-world.fbp | 53 +++++++ .../demo/grove-kit/lcd/grove-lcd-scroll.fbp | 68 +++++++++ .../grove-kit/lcd/grove-lcd-set-cursor.fbp | 67 +++++++++ .../lcd/grove-lcd-text-direction.fbp | 65 ++++++++ .../demo/grove-kit/sol-flow-grove-button.json | 16 ++ .../demo/grove-kit/sol-flow-grove-relay.json | 16 ++ .../sol-flow-grove-sound-sensor.json | 19 +++ .../sol-flow-intel-edison-rev-c.json | 113 ++++++++++++++ .../sol-flow-intel-galileo-rev-g.json | 113 ++++++++++++++ .../demo/minnow-calamari/Kconfig | 29 ++++ .../demo/minnow-calamari/Makefile | 24 +++ .../singlesession/demo/minnow-calamari/README | 37 +++++ .../calamari-7seg-segments.fbp | 63 ++++++++ .../minnow-calamari/calamari-7seg-value.fbp | 38 +++++ ...alamari-button-accumulator-persistence.fbp | 59 ++++++++ .../calamari-buttons-rgb-led.fbp | 44 ++++++ .../demo/minnow-calamari/calamari-led.fbp | 38 +++++ .../demo/minnow-calamari/calamari-lever.fbp | 35 +++++ .../demo/minnow-calamari/calamari-rgb-led.fbp | 44 ++++++ ...l-flow-intel-minnow-max-linux_gt_3_17.json | 133 +++++++++++++++++ .../demo/minnow-calamari/sol-flow.json | 139 ++++++++++++++++++ 37 files changed, 1963 insertions(+), 1 deletion(-) create mode 100644 repos/singlesession/demo/grove-kit/README create mode 100755 repos/singlesession/demo/grove-kit/grove-button.fbp create mode 100755 repos/singlesession/demo/grove-kit/grove-buzzer.fbp create mode 100755 repos/singlesession/demo/grove-kit/grove-led-accumulator.fbp create mode 100755 repos/singlesession/demo/grove-kit/grove-led-wave-generator.fbp create mode 100755 repos/singlesession/demo/grove-kit/grove-light-sensor.fbp create mode 100755 repos/singlesession/demo/grove-kit/grove-relay.fbp create mode 100755 repos/singlesession/demo/grove-kit/grove-rotary-angle-sensor.fbp create mode 100755 repos/singlesession/demo/grove-kit/grove-sound-sensor.fbp create mode 100755 repos/singlesession/demo/grove-kit/grove-temperature-sensor.fbp create mode 100755 repos/singlesession/demo/grove-kit/lcd/grove-lcd-autoscroll.fbp create mode 100755 repos/singlesession/demo/grove-kit/lcd/grove-lcd-blink.fbp create mode 100755 repos/singlesession/demo/grove-kit/lcd/grove-lcd-cursor.fbp create mode 100755 repos/singlesession/demo/grove-kit/lcd/grove-lcd-display.fbp create mode 100755 repos/singlesession/demo/grove-kit/lcd/grove-lcd-fade.fbp create mode 100755 repos/singlesession/demo/grove-kit/lcd/grove-lcd-hello-world.fbp create mode 100755 repos/singlesession/demo/grove-kit/lcd/grove-lcd-scroll.fbp create mode 100755 repos/singlesession/demo/grove-kit/lcd/grove-lcd-set-cursor.fbp create mode 100755 repos/singlesession/demo/grove-kit/lcd/grove-lcd-text-direction.fbp create mode 100644 repos/singlesession/demo/grove-kit/sol-flow-grove-button.json create mode 100644 repos/singlesession/demo/grove-kit/sol-flow-grove-relay.json create mode 100644 repos/singlesession/demo/grove-kit/sol-flow-grove-sound-sensor.json create mode 100644 repos/singlesession/demo/grove-kit/sol-flow-intel-edison-rev-c.json create mode 100644 repos/singlesession/demo/grove-kit/sol-flow-intel-galileo-rev-g.json create mode 100644 repos/singlesession/demo/minnow-calamari/Kconfig create mode 100644 repos/singlesession/demo/minnow-calamari/Makefile create mode 100644 repos/singlesession/demo/minnow-calamari/README create mode 100755 repos/singlesession/demo/minnow-calamari/calamari-7seg-segments.fbp create mode 100755 repos/singlesession/demo/minnow-calamari/calamari-7seg-value.fbp create mode 100644 repos/singlesession/demo/minnow-calamari/calamari-button-accumulator-persistence.fbp create mode 100755 repos/singlesession/demo/minnow-calamari/calamari-buttons-rgb-led.fbp create mode 100755 repos/singlesession/demo/minnow-calamari/calamari-led.fbp create mode 100755 repos/singlesession/demo/minnow-calamari/calamari-lever.fbp create mode 100755 repos/singlesession/demo/minnow-calamari/calamari-rgb-led.fbp create mode 100644 repos/singlesession/demo/minnow-calamari/sol-flow-intel-minnow-max-linux_gt_3_17.json create mode 100644 repos/singlesession/demo/minnow-calamari/sol-flow.json diff --git a/.gitignore b/.gitignore index 050414c..87d4732 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -/repos/* /node_modules/* /client/libs/* /sessions diff --git a/repos/singlesession/demo/grove-kit/README b/repos/singlesession/demo/grove-kit/README new file mode 100644 index 0000000..518f9c1 --- /dev/null +++ b/repos/singlesession/demo/grove-kit/README @@ -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. diff --git a/repos/singlesession/demo/grove-kit/grove-button.fbp b/repos/singlesession/demo/grove-kit/grove-button.fbp new file mode 100755 index 0000000..ff173c7 --- /dev/null +++ b/repos/singlesession/demo/grove-kit/grove-button.fbp @@ -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) diff --git a/repos/singlesession/demo/grove-kit/grove-buzzer.fbp b/repos/singlesession/demo/grove-kit/grove-buzzer.fbp new file mode 100755 index 0000000..650fd6b --- /dev/null +++ b/repos/singlesession/demo/grove-kit/grove-buzzer.fbp @@ -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") diff --git a/repos/singlesession/demo/grove-kit/grove-led-accumulator.fbp b/repos/singlesession/demo/grove-kit/grove-led-accumulator.fbp new file mode 100755 index 0000000..77a7bee --- /dev/null +++ b/repos/singlesession/demo/grove-kit/grove-led-accumulator.fbp @@ -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 diff --git a/repos/singlesession/demo/grove-kit/grove-led-wave-generator.fbp b/repos/singlesession/demo/grove-kit/grove-led-wave-generator.fbp new file mode 100755 index 0000000..73011a2 --- /dev/null +++ b/repos/singlesession/demo/grove-kit/grove-led-wave-generator.fbp @@ -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) diff --git a/repos/singlesession/demo/grove-kit/grove-light-sensor.fbp b/repos/singlesession/demo/grove-kit/grove-light-sensor.fbp new file mode 100755 index 0000000..ba358c3 --- /dev/null +++ b/repos/singlesession/demo/grove-kit/grove-light-sensor.fbp @@ -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) diff --git a/repos/singlesession/demo/grove-kit/grove-relay.fbp b/repos/singlesession/demo/grove-kit/grove-relay.fbp new file mode 100755 index 0000000..2a4233a --- /dev/null +++ b/repos/singlesession/demo/grove-kit/grove-relay.fbp @@ -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) diff --git a/repos/singlesession/demo/grove-kit/grove-rotary-angle-sensor.fbp b/repos/singlesession/demo/grove-kit/grove-rotary-angle-sensor.fbp new file mode 100755 index 0000000..15ae2a0 --- /dev/null +++ b/repos/singlesession/demo/grove-kit/grove-rotary-angle-sensor.fbp @@ -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 diff --git a/repos/singlesession/demo/grove-kit/grove-sound-sensor.fbp b/repos/singlesession/demo/grove-kit/grove-sound-sensor.fbp new file mode 100755 index 0000000..1eca5dc --- /dev/null +++ b/repos/singlesession/demo/grove-kit/grove-sound-sensor.fbp @@ -0,0 +1,45 @@ +#!/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-sound-sensor.fbp + +# This is a translation of +# Grove_Sound_Sensor/Grove_Sound_Sensor.ino, from +# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git + +# Our range is 0-4096 for sound sensor's analog reading, so the +# original 50 value maps to ~200 + +threshold(constant/int:value=200) + +sensor(SoundSensor) OUT -> IN[0] compare(int/greater-or-equal) +threshold OUT -> IN[1] compare +compare OUT -> IN led(LED) diff --git a/repos/singlesession/demo/grove-kit/grove-temperature-sensor.fbp b/repos/singlesession/demo/grove-kit/grove-temperature-sensor.fbp new file mode 100755 index 0000000..a368989 --- /dev/null +++ b/repos/singlesession/demo/grove-kit/grove-temperature-sensor.fbp @@ -0,0 +1,42 @@ +#!/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-temperature-sensor.fbp + +# This is a translation of +# Grove_Temperature_Sensor/Grove_Temperature_Sensor.ino, from +# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git + +const_celsius_symbol(constant/string:value= C) + +temperatureSensor(TemperatureSensor) KELVIN -> KELVIN _(temperature/converter) CELSIUS -> IN converter(converter/float-to-string) +converter OUT -> IN[0] concat(string/concatenate) +const_celsius_symbol OUT -> IN[1] concat OUT -> IN screen(LCDString) diff --git a/repos/singlesession/demo/grove-kit/lcd/grove-lcd-autoscroll.fbp b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-autoscroll.fbp new file mode 100755 index 0000000..c1f1762 --- /dev/null +++ b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-autoscroll.fbp @@ -0,0 +1,83 @@ +#!/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 lcd/grove-lcd-autoscroll.fbp + +# This is a translation of +# Grove_RGB_BackLight_LCD/Autoscroll/Autoscroll.ino, from +# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git + +true(constant/boolean:value=true) +false(constant/boolean:value=false) +char_max(constant/int:value=57) +loops_switch(boolean/toggle:initial_state=false) + +initial_color(constant/rgb:value=255|255|255|255|255|255) +initial_color OUT -> COLOR lcd(LCDChar) + +# 48 is decimal value for char '0', 57 is for '9' +acc(int/accumulator:setup_value=min:48|max:57|step:1,initial_value=48) +timer_scroll(timer:interval=500) OUT -> INC acc + +acc OUT -> IN accumulator_to_char(converter/int-to-byte) + +accumulator_to_char OUT -> PUT_CHAR lcd + +#take off +true OUT -> RESET timer_scroll +false OUT -> ENABLED timer_delay(timer:interval=500) + +acc OUT -> IN[0] comp_max(int/equal) +char_max OUT -> IN[1] comp_max + +comp_max OUT -> PULSE_IF_TRUE bool_to_pulse0(converter/boolean-to-empty) OUT -> IN loops_switch + +loops_switch OUT -> IN end_of_loop(boolean/filter) + +end_of_loop TRUE -> IN set_col(converter/boolean-to-int:true_value=16) +end_of_loop TRUE -> IN set_row(converter/boolean-to-int:true_value=1) +end_of_loop TRUE -> AUTO_SCROLL lcd +set_row OUT -> ROW lcd +set_col OUT -> COL lcd + +end_of_loop FALSE -> ENABLED timer_scroll +end_of_loop FALSE -> RESET timer_delay + +timer_delay OUT -> IN unset_autoscroll(converter/empty-to-boolean:output_value=false) +unset_autoscroll OUT -> AUTO_SCROLL lcd + +# this mimics the line 'acc OUT -> IN accumulator_to_char', where we +# put a char into the LCD before we delay 500ms +timer_delay OUT -> INC acc + +timer_delay OUT -> CLEAR lcd +timer_delay OUT -> RESET timer_scroll +timer_delay OUT -> IN end_of_delay(converter/empty-to-boolean:output_value=false) OUT -> ENABLED timer_delay diff --git a/repos/singlesession/demo/grove-kit/lcd/grove-lcd-blink.fbp b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-blink.fbp new file mode 100755 index 0000000..3740376 --- /dev/null +++ b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-blink.fbp @@ -0,0 +1,54 @@ +#!/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_FLOW_MODULE_RESOLVER_CONFFILE=galileo-grove-kit.json sol-fbp-runner lcd/grove-lcd-blink.fbp + +# This is a translation of +# Grove_RGB_BackLight_LCD/Blink/Blink.ino, from +# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git + +true(constant/boolean:value=true) +false(constant/boolean:value=false) +state_switch(boolean/toggle:initial_state=false) + +lcd(LCDChar) + +initial_string(constant/string:value="hello, world!") +initial_string OUT -> PUT_STRING lcd + +false OUT -> ENABLED timer(timer:interval=3000) +true OUT -> ENABLED timer_delay(timer:interval=1000) + +timer_delay OUT -> IN delay_off(converter/empty-to-boolean:output_value=false) +delay_off OUT -> ENABLED timer_delay +delay_off OUT -> IN not(boolean/not) OUT -> ENABLED timer + +timer OUT -> IN state_switch OUT -> BLINK_CURSOR lcd diff --git a/repos/singlesession/demo/grove-kit/lcd/grove-lcd-cursor.fbp b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-cursor.fbp new file mode 100755 index 0000000..7655c2c --- /dev/null +++ b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-cursor.fbp @@ -0,0 +1,50 @@ +#!/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 lcd/grove-lcd-cursor.fbp + +# This is a translation of +# Grove_RGB_BackLight_LCD/Cursor/Cursor.ino, from +# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git + +lcd(LCDChar) + +true(constant/boolean:value=true) +state_switch(boolean/toggle:initial_state=false) + +initial_string(constant/string:value="hello, world!") +initial_string OUT -> PUT_STRING lcd + +state_switch OUT -> UNDERLINE_CURSOR lcd + +timer(timer:interval=500) + +timer OUT -> IN state_switch diff --git a/repos/singlesession/demo/grove-kit/lcd/grove-lcd-display.fbp b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-display.fbp new file mode 100755 index 0000000..8376d80 --- /dev/null +++ b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-display.fbp @@ -0,0 +1,50 @@ +#!/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 lcd/grove-lcd-display.fbp + +# This is a translation of +# Grove_RGB_BackLight_LCD/Display/Display.ino, from +# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git + +lcd(LCDChar) + +true(constant/boolean:value=true) +state_switch(boolean/toggle:initial_state=false) + +initial_string(constant/string:value="hello, world!") +initial_string OUT -> PUT_STRING lcd + +state_switch OUT -> DISPLAY_ON lcd + +timer(timer:interval=500) + +timer OUT -> IN state_switch diff --git a/repos/singlesession/demo/grove-kit/lcd/grove-lcd-fade.fbp b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-fade.fbp new file mode 100755 index 0000000..2d579b2 --- /dev/null +++ b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-fade.fbp @@ -0,0 +1,73 @@ +#!/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.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 + +# one picture explains what's happening: +# ___ +# / \ +# / \_______________________ +# ___ +# / \ +# __________/ \_____________ +# ___ +# / \ +# ____________________/ \___ + +timer(timer:interval=5) +converter(converter/float-to-rgb) +lcd(LCDChar) + +initial_string(constant/string:value="fade demo") OUT -> PUT_STRING lcd +initial_color(constant/rgb:value=0|0|0|255|255|255) OUT -> COLOR lcd + +# 1520 = 2 * (2 * 100 + 2 * 255) + 100 + +red_wave(float/wave-generator-trapezoidal:tick_start=1520,min=0,max=255,ticks_inc=255,ticks_dec=255,ticks_at_min=1520,ticks_at_max=100) + +# 1520 - (2 * 100 + 2 * 255) = 810 +green_wave(float/wave-generator-trapezoidal:tick_start=810,min=0,max=255,ticks_inc=255,ticks_dec=255,ticks_at_min=1520,ticks_at_max=100) + +# 1520 - 2 * (2 * 100 + 2 * 255) = 100 +blue_wave(float/wave-generator-trapezoidal:tick_start=100,min=0,max=255,ticks_inc=255,ticks_dec=255,ticks_at_min=1520,ticks_at_max=100) + +timer OUT -> TICK red_wave OUT -> RED converter +timer OUT -> TICK green_wave OUT -> GREEN converter +timer OUT -> TICK blue_wave OUT -> BLUE converter + +converter OUT -> COLOR lcd diff --git a/repos/singlesession/demo/grove-kit/lcd/grove-lcd-hello-world.fbp b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-hello-world.fbp new file mode 100755 index 0000000..4e4050d --- /dev/null +++ b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-hello-world.fbp @@ -0,0 +1,53 @@ +#!/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 lcd/grove-lcd-hello-world.fbp + +# This is a translation of +# Grove_RGB_BackLight_LCD/HelloWorld/HelloWorld.ino, from +# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git + +# The example prints the string on row 0 and keeps printing a number +# (starting from 1) at each second at the beginning of row 1 + +lcd(LCDChar:color=255|0|0|255|255|255) + +initial_string(constant/string:value="hello, world!") OUT -> PUT_STRING lcd + +timer(timer:interval=1000) + +timer OUT -> IN _(converter/empty-to-int:output_value=1) OUT -> ROW lcd +timer OUT -> IN _(converter/empty-to-int:output_value=0) OUT -> COL lcd + +# filter node needed to bypass accumulator's initial packet, which +# would override the initial string we put +timer OUT -> INC acc(int/accumulator) OUT -> IN filter(int/filter:min=1) +filter OUT -> IN _(converter/int-to-string) OUT -> PUT_STRING lcd diff --git a/repos/singlesession/demo/grove-kit/lcd/grove-lcd-scroll.fbp b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-scroll.fbp new file mode 100755 index 0000000..cde970f --- /dev/null +++ b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-scroll.fbp @@ -0,0 +1,68 @@ +#!/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-lc-scroll.fbp + +# This is a translation of +# Grove_RGB_BackLight_LCD/Scroll/Scroll.ino, from +# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git + +# This will start with the string at the display's origin, move it +# past the boundaries to the left, back again to the right, till it +# vanishes again and finally back to the initial position, just to +# loop again. + +false(constant/boolean:value=false) +string(constant/string:value="hello, world!") # strlen = 13 +string OUT -> PUT_STRING lcd(LCDChar) + +# zero output will be ignored at the start (1st_loop_filter's min is 1) +acc(int/accumulator:setup_value=min:0|max:56|step:1) + +1st_loop_filter(int/filter:min=1,max=12) # strlen +2nd_loop_filter(int/filter:min=13,max=40) # strlen + column span = 28 +3rd_loop_filter(int/filter:min=41,max=56) # column span = 16 + +timer_delay(timer:interval=1000) +false OUT -> ENABLED timer(timer:interval=150) + +start_loop(converter/empty-to-boolean:output_value=true) +start_loop OUT -> ENABLED timer + +timer OUT -> INC acc +acc OUT -> IN 1st_loop_filter OUT -> SCROLL_LEFT lcd +acc OUT -> IN 2nd_loop_filter OUT -> SCROLL_RIGHT lcd +acc OUT -> IN 3rd_loop_filter OUT -> SCROLL_LEFT lcd + +acc OVERFLOW -> IN loop_pause(converter/empty-to-boolean:output_value=true) +loop_pause OUT -> ENABLED timer_delay +loop_pause OUT -> IN _(boolean/not) OUT -> ENABLED timer +timer_delay OUT -> IN start_loop diff --git a/repos/singlesession/demo/grove-kit/lcd/grove-lcd-set-cursor.fbp b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-set-cursor.fbp new file mode 100755 index 0000000..7506eb6 --- /dev/null +++ b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-set-cursor.fbp @@ -0,0 +1,67 @@ +#!/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-lc-set-cursor.fbp + +# This is a translation of +# Grove_RGB_BackLight_LCD/setCursor/setCursor.ino, from +# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git + +# This will loop from 'a' to 'z', filling in the whole display with +# each single letter before changing to the next (to start again) + +timer_cols(timer:interval=200) + +timer_chars(timer:interval=6400) +timer_chars OUT -> INC chars + +timer_rows(timer:interval=3200) +timer_rows OUT -> INC rows + +lcd(LCDChar) + +cols(int/accumulator:setup_value=min:0|max:15|step:1) +rows(int/accumulator:setup_value=min:0|max:1|step:1) + +# 'a' to 'z' +chars(int/accumulator:setup_value=min:97|max:122|step:1,initial_value=97) +chars OUT -> IN to_byte(converter/int-to-byte) + +# trick to keep a 'current char' state +to_byte OUT -> OUTPUT_VALUE curr_char(converter/empty-to-byte:output_value=97) +_(constant/empty) OUT -> IN curr_char +curr_char OUT -> PUT_CHAR lcd + +timer_cols OUT -> INC cols +timer_cols OUT -> IN curr_char + +cols OUT -> COL lcd +rows OUT -> ROW lcd diff --git a/repos/singlesession/demo/grove-kit/lcd/grove-lcd-text-direction.fbp b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-text-direction.fbp new file mode 100755 index 0000000..5d6b7f1 --- /dev/null +++ b/repos/singlesession/demo/grove-kit/lcd/grove-lcd-text-direction.fbp @@ -0,0 +1,65 @@ +#!/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-lc-text-direction.fbp + +# This is a translation of +# Grove_RGB_BackLight_LCD/TextDirection/TextDirection.ino, from +# https://github.com/Seeed-Studio/Sketchbook_Starter_Kit_for_Arduino.git + +# In this sample, we start to print the alphabet from left to right, +# switch the direction after m and then again after s, just to start +# from the origin again. + +timer(timer:interval=1000) +lcd(LCDChar:underline_cursor=true) + +# 'a' to 'z' +chars(int/accumulator:initial_value=97,setup_value=min:97|max:122|step:1) +chars OUT -> IN to_byte(converter/int-to-byte) + +chars OUT -> IN[0] comp_m(int/equal) +_(constant/int:value=109) OUT -> IN[1] comp_m + +to_byte OUT -> OUTPUT_VALUE curr_char(converter/empty-to-byte:output_value=97) +curr_char OUT -> PUT_CHAR lcd + +timer OUT -> IN curr_char +timer OUT -> INC chars + +comp_m OUT -> IN _(boolean/filter) TRUE -> IN _(boolean/not) OUT -> LEFT_TO_RIGHT lcd + +chars OUT -> IN[0] comp_s(int/equal) +_(constant/int:value=115) OUT -> IN[1] comp_s + +comp_s OUT -> IN _(boolean/filter) TRUE -> LEFT_TO_RIGHT lcd + +chars OVERFLOW -> IN _(converter/empty-to-int:output_value=0) OUT -> COL lcd diff --git a/repos/singlesession/demo/grove-kit/sol-flow-grove-button.json b/repos/singlesession/demo/grove-kit/sol-flow-grove-button.json new file mode 100644 index 0000000..d54a48d --- /dev/null +++ b/repos/singlesession/demo/grove-kit/sol-flow-grove-button.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://solettaproject.github.io/soletta/schemas/config.schema", + "nodetypes": [ + { + "name": "Button", + "type": "gtk/pushbutton" + }, + { + "name": "LED", + "options": { + "rgb": "255|0|0" + }, + "type": "gtk/led" + } + ] +} diff --git a/repos/singlesession/demo/grove-kit/sol-flow-grove-relay.json b/repos/singlesession/demo/grove-kit/sol-flow-grove-relay.json new file mode 100644 index 0000000..7eb849a --- /dev/null +++ b/repos/singlesession/demo/grove-kit/sol-flow-grove-relay.json @@ -0,0 +1,16 @@ +{ + "$schema": "http://solettaproject.github.io/soletta/schemas/config.schema", + "nodetypes": [ + { + "name": "Button", + "type": "gtk/pushbutton" + }, + { + "name": "Relay", + "options": { + "rgb": "255|0|0" + }, + "type": "gtk/led" + } + ] +} diff --git a/repos/singlesession/demo/grove-kit/sol-flow-grove-sound-sensor.json b/repos/singlesession/demo/grove-kit/sol-flow-grove-sound-sensor.json new file mode 100644 index 0000000..77419cf --- /dev/null +++ b/repos/singlesession/demo/grove-kit/sol-flow-grove-sound-sensor.json @@ -0,0 +1,19 @@ +{ + "$schema": "http://solettaproject.github.io/soletta/schemas/config.schema", + "nodetypes": [ + { + "name": "SoundSensor", + "options": { + "range": "400|0" + }, + "type": "gtk/slider" + }, + { + "name": "LED", + "options": { + "rgb": "255|0|0" + }, + "type": "gtk/led" + } + ] +} diff --git a/repos/singlesession/demo/grove-kit/sol-flow-intel-edison-rev-c.json b/repos/singlesession/demo/grove-kit/sol-flow-intel-edison-rev-c.json new file mode 100644 index 0000000..5e33650 --- /dev/null +++ b/repos/singlesession/demo/grove-kit/sol-flow-intel-edison-rev-c.json @@ -0,0 +1,113 @@ +{ + "$schema": "http://solettaproject.github.io/soletta/schemas/config.schema", + "nodetypes": [ + { + "name": "LCDString", + "options": { + "bus": 6 + }, + "type": "grove/lcd-string" + }, + { + "name": "LCDChar", + "options": { + "bus": 6 + }, + "type": "grove/lcd-char" + }, + { + "name": "RotaryAngleSensor", + "options": { + "pin": "A0", + "poll_timeout": 50 + }, + "type": "grove/rotary-sensor" + }, + { + "name": "LightSensor", + "options": { + "pin": "A1", + "poll_timeout": 50 + }, + "type": "grove/light-sensor" + }, + { + "name": "TemperatureSensor", + "options": { + "pin": "A2", + "poll_timeout": 50 + }, + "type": "grove/temperature-sensor" + }, + { + "name": "SoundSensor", + "options": { + "pin": "A3", + "poll_timeout": 50 + }, + "type": "aio/reader" + }, + { + "name": "Button", + "options": { + "active_low": false, + "edge_falling": true, + "edge_rising": true, + "pin": "3" + }, + "type": "gpio/reader" + }, + { + "name": "TouchSensor", + "options": { + "active_low": false, + "edge_falling": true, + "edge_rising": true, + "pin": "6" + }, + "type": "gpio/reader" + }, + { + "name": "LED", + "options": { + "active_low": false, + "pin": "7" + }, + "type": "gpio/writer" + }, + { + "name": "Relay", + "options": { + "active_low": false, + "pin": "7" + }, + "type": "gpio/writer" + }, + { + "name": "Servo", + "options": { + "duty_cycle_range": "min:544|max:2400", + "period": 22000, + "pin": "5" + }, + "type": "servo-motor" + }, + { + "name": "Buzzer", + "options": { + "pin": "5" + }, + "type": "piezo-speaker/sound" + }, + { + "name": "LED_PWM", + "options": { + "duty_cycle": 0, + "enabled": true, + "period": 2040816, + "pin": "6" + }, + "type": "pwm" + } + ] +} diff --git a/repos/singlesession/demo/grove-kit/sol-flow-intel-galileo-rev-g.json b/repos/singlesession/demo/grove-kit/sol-flow-intel-galileo-rev-g.json new file mode 100644 index 0000000..7791c20 --- /dev/null +++ b/repos/singlesession/demo/grove-kit/sol-flow-intel-galileo-rev-g.json @@ -0,0 +1,113 @@ +{ + "$schema": "http://solettaproject.github.io/soletta/schemas/config.schema", + "nodetypes": [ + { + "name": "LCDString", + "options": { + "bus": 0 + }, + "type": "grove/lcd-string" + }, + { + "name": "LCDChar", + "options": { + "bus": 0 + }, + "type": "grove/lcd-char" + }, + { + "name": "RotaryAngleSensor", + "options": { + "pin": "A0", + "poll_timeout": 50 + }, + "type": "grove/rotary-sensor" + }, + { + "name": "LightSensor", + "options": { + "pin": "A1", + "poll_timeout": 50 + }, + "type": "grove/light-sensor" + }, + { + "name": "TemperatureSensor", + "options": { + "pin": "A2", + "poll_timeout": 50 + }, + "type": "grove/temperature-sensor" + }, + { + "name": "SoundSensor", + "options": { + "pin": "A3", + "poll_timeout": 50 + }, + "type": "aio/reader" + }, + { + "name": "Button", + "options": { + "active_low": false, + "edge_falling": true, + "edge_rising": true, + "pin": "3" + }, + "type": "gpio/reader" + }, + { + "name": "TouchSensor", + "options": { + "active_low": false, + "edge_falling": true, + "edge_rising": true, + "pin": "6" + }, + "type": "gpio/reader" + }, + { + "name": "LED", + "options": { + "active_low": false, + "pin": "7" + }, + "type": "gpio/writer" + }, + { + "name": "Relay", + "options": { + "active_low": false, + "pin": "7" + }, + "type": "gpio/writer" + }, + { + "name": "Servo", + "options": { + "duty_cycle_range": "min:544|max:2400", + "period": 22000, + "pin": "5" + }, + "type": "servo-motor" + }, + { + "name": "Buzzer", + "options": { + "pin": "5" + }, + "type": "piezo-speaker/sound" + }, + { + "name": "LED_PWM", + "options": { + "duty_cycle": 0, + "enabled": true, + "period": 2040816, + "pin": "6" + }, + "type": "pwm" + } + ] +} diff --git a/repos/singlesession/demo/minnow-calamari/Kconfig b/repos/singlesession/demo/minnow-calamari/Kconfig new file mode 100644 index 0000000..54699ab --- /dev/null +++ b/repos/singlesession/demo/minnow-calamari/Kconfig @@ -0,0 +1,29 @@ +config FLOW_CALAMARI_7SEG_SEGMENTS_SAMPLE + bool + depends on FLOW_FBP_GENERATOR_SAMPLES && FLOW_NODE_TYPE_CALAMARI + default y + +config FLOW_CALAMARI_7SEG_VALUE_SAMPLE + bool + depends on FLOW_FBP_GENERATOR_SAMPLES && FLOW_NODE_TYPE_CALAMARI + default y + +config FLOW_CALAMARI_BUTTONS_RGB_LED_SAMPLE + bool + depends on FLOW_FBP_GENERATOR_SAMPLES && FLOW_NODE_TYPE_CALAMARI + default y + +config FLOW_CALAMARI_LED_SAMPLE + bool + depends on FLOW_FBP_GENERATOR_SAMPLES && FLOW_NODE_TYPE_CALAMARI + default y + +config FLOW_CALAMARI_LEVER_SAMPLE + bool + depends on FLOW_FBP_GENERATOR_SAMPLES && FLOW_NODE_TYPE_CALAMARI + default y + +config FLOW_CALAMARI_RGB_LED_SAMPLE + bool + depends on FLOW_FBP_GENERATOR_SAMPLES && FLOW_NODE_TYPE_CALAMARI + default y diff --git a/repos/singlesession/demo/minnow-calamari/Makefile b/repos/singlesession/demo/minnow-calamari/Makefile new file mode 100644 index 0000000..af83d95 --- /dev/null +++ b/repos/singlesession/demo/minnow-calamari/Makefile @@ -0,0 +1,24 @@ +sample-$(FLOW_CALAMARI_7SEG_SEGMENTS_SAMPLE) += calamari-7seg-segments +sample-calamari-7seg-segments-$(FLOW_CALAMARI_7SEG_SEGMENTS_SAMPLE) := calamari-7seg-segments.fbp +sample-calamari-7seg-segments-$(FLOW_CALAMARI_7SEG_SEGMENTS_SAMPLE)-conffile := sol-flow-intel-minnow-max-linux_gt_3_17.json + +sample-$(FLOW_CALAMARI_7SEG_VALUE_SAMPLE) += calamari-7seg-value +sample-calamari-7seg-value-$(FLOW_CALAMARI_7SEG_VALUE_SAMPLE) := calamari-7seg-value.fbp +sample-calamari-7seg-value-$(FLOW_CALAMARI_7SEG_VALUE_SAMPLE)-conffile := sol-flow-intel-minnow-max-linux_gt_3_17.json + +sample-$(FLOW_CALAMARI_BUTTONS_RGB_LED_SAMPLE) += calamari-buttons-rgb-led +sample-calamari-buttons-rgb-led-$(FLOW_CALAMARI_BUTTONS_RGB_LED_SAMPLE) := calamari-buttons-rgb-led.fbp +sample-calamari-buttons-rgb-led-$(FLOW_CALAMARI_BUTTONS_RGB_LED_SAMPLE)-conffile := sol-flow-intel-minnow-max-linux_gt_3_17.json + +sample-$(FLOW_CALAMARI_LED_SAMPLE) += calamari-led +sample-calamari-led-$(FLOW_CALAMARI_LED_SAMPLE) := calamari-led.fbp +sample-calamari-led-$(FLOW_CALAMARI_LED_SAMPLE)-conffile := sol-flow-intel-minnow-max-linux_gt_3_17.json + +sample-$(FLOW_CALAMARI_LEVER_SAMPLE) += calamari-lever +sample-calamari-lever-$(FLOW_CALAMARI_LEVER_SAMPLE) := calamari-lever.fbp +sample-calamari-lever-$(FLOW_CALAMARI_LEVER_SAMPLE)-conffile := sol-flow-intel-minnow-max-linux_gt_3_17.json + +sample-$(FLOW_CALAMARI_RGB_LED_SAMPLE) += calamari-rgb-led +sample-calamari-rgb-led-$(FLOW_CALAMARI_RGB_LED_SAMPLE) := calamari-rgb-led.fbp +sample-calamari-rgb-led-$(FLOW_CALAMARI_RGB_LED_SAMPLE)-conffile := sol-flow-intel-minnow-max-linux_gt_3_17.json + diff --git a/repos/singlesession/demo/minnow-calamari/README b/repos/singlesession/demo/minnow-calamari/README new file mode 100644 index 0000000..46d1d5e --- /dev/null +++ b/repos/singlesession/demo/minnow-calamari/README @@ -0,0 +1,37 @@ +This showcases the Intel MinnoBoard Max using the Calamari Lure. + +http://elinux.org/Minnowboard:MaxLures +http://www.minnowboard.org/ + +sol-fbp-runner will read the options from sol-flow.json. + +### Special note if your Linux Kernel version is >= 3.18. + +The following samples make use of GPIOs and require special attention: + * calamari-7seg-segments.fbp + * calamari-7seg-value.fbp + * calamari-buttons-rgb-led.fbp + * calamari-rgb-led.fbp + * calamari-lever.fbp + +### Why? + +The GPIO pins numbers have changed in Linux Kernel 3.18, +the original pin numbers were added by 256. + +sol-flow.json contains the original numbers, prior to Linux Kernel 3.18. + +sol-flow-intel-minnow-max-linux_gt_3_17.json contains the same content, +but with the GPIO pin numbers added by 256. So, if your Linux Kernel > 3.17, +please, use this file. + +If for any given reason the correct config files is not being autodetect, +there are two methods of enforce the use of a specific config file: + + * Method 1 [recommended] - Run: + SOL_FLOW_MODULE_RESOLVER_CONFFILE=sol-flow-intel-minnow-max-linux_gt_3_17.json sol-fbp-runner example.fbp + + * Method 2 - Update the sol-flow.json file manually. You can edit it manually or copy the +contents from sol-flow.json: + cp sol-flow-intel-minnow-max-linux_gt_3_17.json sol-flow.json + sol-fbp-runner example.fbp diff --git a/repos/singlesession/demo/minnow-calamari/calamari-7seg-segments.fbp b/repos/singlesession/demo/minnow-calamari/calamari-7seg-segments.fbp new file mode 100755 index 0000000..29cc24d --- /dev/null +++ b/repos/singlesession/demo/minnow-calamari/calamari-7seg-segments.fbp @@ -0,0 +1,63 @@ +#!/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. + +# Write 'Play' on Intel MinnowBoard's Calamari Lure 7-segment display. + +Led(SevenSegments) +Timer(timer:interval=2000) +Switcher(switcher/byte) +Index(int/accumulator:setup_value=min:0|max:4) + +True(converter/empty-to-boolean:output_value=true) +False(converter/empty-to-boolean:output_value=false) + +ByteOff(converter/empty-to-byte:output_value=0) +ByteP(led-7seg/char-to-byte) +ByteL(led-7seg/char-to-byte) +ByteA(led-7seg/char-to-byte) +ByteY(led-7seg/char-to-byte) + + +Timer OUT -> INC Index OUT -> IN_PORT Switcher +Switcher OUT[0] -> SEGMENTS Led +Timer OUT -> IN ByteOff +Timer OUT -> IN True +Timer OUT -> IN False + +ByteOff OUT -> IN[0] Switcher +_(constant/string:value="P") OUT -> IN ByteP +ByteP OUT -> IN[1] Switcher +_(constant/string:value="l") OUT -> IN ByteL +ByteL OUT -> IN[2] Switcher +_(constant/string:value="a") OUT -> IN ByteA +ByteA OUT -> IN[3] Switcher +_(constant/string:value="y") OUT -> IN ByteY +ByteY OUT -> IN[4] Switcher diff --git a/repos/singlesession/demo/minnow-calamari/calamari-7seg-value.fbp b/repos/singlesession/demo/minnow-calamari/calamari-7seg-value.fbp new file mode 100755 index 0000000..40d4bd2 --- /dev/null +++ b/repos/singlesession/demo/minnow-calamari/calamari-7seg-value.fbp @@ -0,0 +1,38 @@ +#!/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. + +# Uses a timer to loop an accumulator from 0 to 15 and display using +# Intel MinnowBoard's Calamari Lure 7-segment display. + +accumulator(int/accumulator:setup_value=min:0|max:15|step:1) + +timer(wallclock/second) OUT -> INC accumulator +accumulator OUT -> VALUE seg(SevenSegments) diff --git a/repos/singlesession/demo/minnow-calamari/calamari-button-accumulator-persistence.fbp b/repos/singlesession/demo/minnow-calamari/calamari-button-accumulator-persistence.fbp new file mode 100644 index 0000000..a7407c8 --- /dev/null +++ b/repos/singlesession/demo/minnow-calamari/calamari-button-accumulator-persistence.fbp @@ -0,0 +1,59 @@ +#!/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. + +# This example showcases persistence usage. By clicking on Buttons 1 & 2, +# one can increase/decrease a counter, that is displayed on 7 seg display. +# Each change is also persisted to Calamari EEPROM, so this sample will, on +# a second run, remembers counter last value. +# Note that on sol-flow.json in this directory is defined the memory map used +# to store information on EEPROM. Property 'path' contains the instructions +# to 'create' the i2c device. Alternatively, it could be a path to EEPROM file +# on sysfs, considering it's already created. In this case, path would be +# '/sys/bus/i2c/devices/7-0050/eeprom' +# Note that to handle EEPROM initial value being 0xff (255), we catch accumulator +# ERROR packet to reset value to zero. Accumulator will send an error packet +# because it will receive a value (255) out of its range [0-15], so we can +# handle properly. + +btn1(Button1) +btn2(Button2) +accumulator(int/accumulator:send_initial_packet=false,setup_value=min:0|max:15|step:1) +seg(SevenSegments) +persistence(persistence/int:storage="memmap",name="accumulated",default_value=0) + +persistence OUT -> SET accumulator +persistence OUT -> VALUE seg + +btn1 OUT -> IN _(boolean/filter) TRUE -> INC accumulator +btn2 OUT -> IN _(boolean/filter) TRUE -> DEC accumulator + +accumulator OUT -> IN persistence +accumulator ERROR -> RESET accumulator diff --git a/repos/singlesession/demo/minnow-calamari/calamari-buttons-rgb-led.fbp b/repos/singlesession/demo/minnow-calamari/calamari-buttons-rgb-led.fbp new file mode 100755 index 0000000..0ce7437 --- /dev/null +++ b/repos/singlesession/demo/minnow-calamari/calamari-buttons-rgb-led.fbp @@ -0,0 +1,44 @@ +#!/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. + +# This example links Buttons 1, 2 and 3 from calamari to Red, Green +# and Blue leds, accessed directly over GPIO as defined in +# sol-flow.json in the current directory. +# +# The button presses will also go to console on stdout. + +btn1(Button1) OUT -> RED led(RGBLed) +btn1 OUT -> IN log(console:prefix="btn1_pressed ") +btn2(Button2) OUT -> GREEN led +btn2 OUT -> IN log2(console:prefix="btn2_pressed ") +btn3(Button3) OUT -> BLUE led +btn3 OUT -> IN log3(console:prefix="btn3_pressed ") + diff --git a/repos/singlesession/demo/minnow-calamari/calamari-led.fbp b/repos/singlesession/demo/minnow-calamari/calamari-led.fbp new file mode 100755 index 0000000..ae62fa3 --- /dev/null +++ b/repos/singlesession/demo/minnow-calamari/calamari-led.fbp @@ -0,0 +1,38 @@ +#!/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. + +# This example links the Calamari lever (SPI) to intensity light of +# Led1 and Led2 (PWM leds), as defined in sol-flow.json in this +# directory. + +lever(LedLever) OUT -> INTENSITY led1(Led1) +lever OUT -> INTENSITY led2(Led2) + diff --git a/repos/singlesession/demo/minnow-calamari/calamari-lever.fbp b/repos/singlesession/demo/minnow-calamari/calamari-lever.fbp new file mode 100755 index 0000000..54d9858 --- /dev/null +++ b/repos/singlesession/demo/minnow-calamari/calamari-lever.fbp @@ -0,0 +1,35 @@ +#!/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. + +# This example links the Calamari lever (SPI) to the 7segment display, +# displaying the level from 0-15 (in hexadecimal) + +lever(SegmentsLever) OUT -> VALUE seven_segments(SevenSegments) diff --git a/repos/singlesession/demo/minnow-calamari/calamari-rgb-led.fbp b/repos/singlesession/demo/minnow-calamari/calamari-rgb-led.fbp new file mode 100755 index 0000000..29d829f --- /dev/null +++ b/repos/singlesession/demo/minnow-calamari/calamari-rgb-led.fbp @@ -0,0 +1,44 @@ +#!/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. + +# This example will blink each of the Red, Green and Blue LEDs in the +# calamari/rgb-led. It does so by incrementing the accumulator every +# second, then converting the accumulator integer value to bits, the +# first bit goes to Red, the second to Green and the third to Blue. + +accumulator(int/accumulator:setup_value=min:0|max:255|step:1) + +timer(wallclock/second) OUT -> INC accumulator +accumulator OUT -> IN int_to_byte(converter/int-to-byte) +int_to_byte OUT -> IN byte_to_bits(converter/byte-to-bits) +byte_to_bits OUT[0] -> RED led(RGBLed) +byte_to_bits OUT[1] -> GREEN led +byte_to_bits OUT[2] -> BLUE led diff --git a/repos/singlesession/demo/minnow-calamari/sol-flow-intel-minnow-max-linux_gt_3_17.json b/repos/singlesession/demo/minnow-calamari/sol-flow-intel-minnow-max-linux_gt_3_17.json new file mode 100644 index 0000000..82bced0 --- /dev/null +++ b/repos/singlesession/demo/minnow-calamari/sol-flow-intel-minnow-max-linux_gt_3_17.json @@ -0,0 +1,133 @@ +{ + "$schema": "http://solettaproject.github.io/soletta/schemas/config.schema", + "nodetypes": [ + { + "name": "RGBLed", + "options": { + "blue_pin": 464, + "green_pin": 339, + "red_pin": 338 + }, + "type": "calamari/rgb-led" + }, + { + "name": "SevenSegments", + "options": { + "clear_pin": 473, + "clock_pin": 340, + "data_pin": 474, + "latch_pin": 475 + }, + "type": "calamari/7seg" + }, + { + "name": "LedRed", + "options": { + "pin": 338 + }, + "type": "gpio/writer" + }, + { + "name": "LedGreen", + "options": { + "pin": 339 + }, + "type": "gpio/writer" + }, + { + "name": "LedBlue", + "options": { + "pin": 464 + }, + "type": "gpio/writer" + }, + { + "name": "Button1", + "options": { + "active_low": true, + "edge_falling": true, + "edge_rising": true, + "pin": 472, + "pull": "up" + }, + "type": "gpio/reader" + }, + { + "name": "Button2", + "options": { + "active_low": true, + "edge_falling": true, + "edge_rising": true, + "pin": 482, + "pull": "up" + }, + "type": "gpio/reader" + }, + { + "name": "Button3", + "options": { + "active_low": true, + "edge_falling": true, + "edge_rising": true, + "pin": 483, + "pull": "up" + }, + "type": "gpio/reader" + }, + { + "name": "Led1", + "options": { + "address": 1, + "period": 10000, + "range": "min:0|max:10000|step:1" + }, + "type": "calamari/led" + }, + { + "name": "Led2", + "options": { + "address": 2, + "period": 10000, + "range": "min:0|max:10000|step:1" + }, + "type": "calamari/led" + }, + { + "name": "LedLever", + "options": { + "bus": 0, + "chip_select": 0, + "poll_interval": 100, + "range": "min:0|max:1000|step:1" + }, + "type": "calamari/lever" + }, + { + "name": "SegmentsLever", + "options": { + "bus": 0, + "chip_select": 0, + "poll_interval": 100, + "range": "min:0|max:15|step:1" + }, + "type": "calamari/lever" + } + ], + "maps": [ + { + "version": 1, + "path": "create,i2c,platform/80860F41:05,0x50,24c256", + "entries": [ + { + "name": "_version", + "offset": 200, + "size": 1 + }, + { + "name": "accumulated", + "size": 16 + } + ] + } + ] +} diff --git a/repos/singlesession/demo/minnow-calamari/sol-flow.json b/repos/singlesession/demo/minnow-calamari/sol-flow.json new file mode 100644 index 0000000..0e87609 --- /dev/null +++ b/repos/singlesession/demo/minnow-calamari/sol-flow.json @@ -0,0 +1,139 @@ +{ + "$schema": "http://solettaproject.github.io/soletta/schemas/config.schema", + "nodetypes": [ + { + "name": "RGBLed", + "options": { + "blue_pin": "208", + "green_pin": "83", + "red_pin": "82" + }, + "type": "calamari/rgb-led" + }, + { + "name": "SevenSegments", + "options": { + "clear_pin": "217", + "clock_pin": "84", + "data_pin": "218", + "latch_pin": "219" + }, + "type": "calamari/7seg" + }, + { + "name": "LedRed", + "options": { + "pin": "82", + "raw": true + }, + "type": "gpio/writer" + }, + { + "name": "LedGreen", + "options": { + "pin": "83", + "raw": true + }, + "type": "gpio/writer" + }, + { + "name": "LedBlue", + "options": { + "pin": "208", + "raw": true + }, + "type": "gpio/writer" + }, + { + "name": "Button1", + "options": { + "active_low": true, + "edge_falling": true, + "edge_rising": true, + "pin": "216", + "raw": true, + "pull": "up" + }, + "type": "gpio/reader" + }, + { + "name": "Button2", + "options": { + "active_low": true, + "edge_falling": true, + "edge_rising": true, + "pin": "226", + "raw": true, + "pull": "up" + }, + "type": "gpio/reader" + }, + { + "name": "Button3", + "options": { + "active_low": true, + "edge_falling": true, + "edge_rising": true, + "pin": "227", + "raw": true, + "pull": "up" + }, + "type": "gpio/reader" + }, + { + "name": "Led1", + "options": { + "address": 1, + "period": 10000, + "range": "min:0|max:10000|step:1" + }, + "type": "calamari/led" + }, + { + "name": "Led2", + "options": { + "address": 2, + "period": 10000, + "range": "min:0|max:10000|step:1" + }, + "type": "calamari/led" + }, + { + "name": "LedLever", + "options": { + "bus": 0, + "chip_select": 0, + "poll_interval": 100, + "range": "min:0|max:1000|step:1" + }, + "type": "calamari/lever" + }, + { + "name": "SegmentsLever", + "options": { + "bus": 0, + "chip_select": 0, + "poll_interval": 100, + "range": "min:0|max:15|step:1" + }, + "type": "calamari/lever" + } + ], + "maps": [ + { + "version": 1, + "path": "create,i2c,platform/80860F41:05,0x50,24c256", + "entries": [ + { + "name": "_version", + "offset": 200, + "size": 1 + }, + { + "name": "accumulated", + "size": 16 + } + ] + } + ] +}