Skip to content
Snippets Groups Projects
Commit 3eb3dece authored by ft-Demo's avatar ft-Demo
Browse files

commit by robo pro coding

parents
Branches master
No related tags found
No related merge requests found
{"name":"IoT_Indoor_Climate","mode":"ADVANCED","uuid":"70df319e-8306-f6c2-1be5-df84a2ba4b08"}
\ No newline at end of file
<xml xmlns="https://developers.google.com/blockly/xml" version="12">
<variables>
<variable id="D4KO}rCHAZ%pnvWtH2*w">temperature</variable>
<variable id="ovjwehpF6fy.`P}}0i1M">humidity</variable>
</variables>
<block type="start_block" id="Lar_VB35P#GBaq#=M)V@" deletable="false" x="-871" y="-73">
<statement name="statement">
<block type="loop_endless" id="I5clQU?)1.9c8Yt?$4Z*">
<statement name="DO">
<block type="variables_set" id="oC[RYw2MOcPr.$hu.$8?">
<field name="VAR" id="D4KO}rCHAZ%pnvWtH2*w">temperature</field>
<value name="VALUE">
<block type="i2c_environment_sensor_get_temperature" id="[Vr,xCqN$=z#[X{vPk/B">
<field name="instance_name">TXT_M_I2C_1_environment_sensor</field>
</block>
</value>
<next>
<block type="variables_set" id="Yi~BC!%o`;}(oHxMyEI;">
<field name="VAR" id="ovjwehpF6fy.`P}}0i1M">humidity</field>
<value name="VALUE">
<block type="i2c_environment_sensor_get_humidity" id="OHBunOnf$[1%i?FMFqk9">
<field name="instance_name">TXT_M_I2C_1_environment_sensor</field>
</block>
</value>
<next>
<block type="display_set_label_text" id="R|(dvcp2o/({La4|o0Kb">
<field name="instance_name">humidity</field>
<value name="value">
<shadow type="text" id="XO}3%b{[H$hwv=-uH1#|">
<field name="TEXT">abc</field>
</shadow>
<block type="text_join" id="Xmdy7f(%8q2(a[It8bew">
<mutation items="3"/>
<value name="ADD0">
<block type="text" id="ThzX,#/HbPp3gx1pLWt2">
<field name="TEXT">Humidity: </field>
</block>
</value>
<value name="ADD1">
<block type="math_round" id="{d/YS=]66my(T,.:u8Ki">
<field name="OP">ROUND</field>
<field name="DECIMALS">1</field>
<value name="NUM">
<block type="variables_get" id="5E(hV?$|o^KGAd#bO+sh">
<field name="VAR" id="ovjwehpF6fy.`P}}0i1M">humidity</field>
</block>
</value>
</block>
</value>
<value name="ADD2">
<block type="text" id=")cl1r{{Y/ZyQi85%G=EZ">
<field name="TEXT"> %</field>
</block>
</value>
</block>
</value>
<next>
<block type="display_set_label_text" id="H#WViUUrxnwwji,~p(9L">
<field name="instance_name">temperature</field>
<value name="value">
<shadow type="text" id="hR~KW[w9v+Jm|gaIY{_)">
<field name="TEXT">abc</field>
</shadow>
<block type="text_join" id="!O^R0+@3x4;|XJzX9y|7">
<mutation items="3"/>
<value name="ADD0">
<block type="text" id="Tr]Tk|M8I-psA!xRL;s#">
<field name="TEXT">Temperature: </field>
</block>
</value>
<value name="ADD1">
<block type="math_round" id="ab66qka8NI$Ta*D7|vXT">
<field name="OP">ROUND</field>
<field name="DECIMALS">1</field>
<value name="NUM">
<block type="variables_get" id="3L~6y2xxw,}xQU/#H$J3">
<field name="VAR" id="D4KO}rCHAZ%pnvWtH2*w">temperature</field>
</block>
</value>
</block>
</value>
<value name="ADD2">
<block type="text" id="~7-@`[]#^IJF65k8R!YV">
<field name="TEXT"> °C</field>
</block>
</value>
</block>
</value>
<next>
<block type="util_wait_for" id="J3[Ct=p|-%G(_m)rs7]f">
<field name="format">s</field>
<value name="value">
<shadow type="math_number" id="fL^Sd;H_,ZOZ2ztJ.VhJ">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</xml>
\ No newline at end of file
import math
import time
from lib.controller import *
from lib.display import *
temperature = None
humidity = None
while True:
temperature = TXT_M_I2C_1_environment_sensor.get_temperature()
humidity = TXT_M_I2C_1_environment_sensor.get_humidity()
display.set_attr("humidity.text", str(''.join([str(x) for x in ['Humidity: ', round(humidity, 1), ' %']])))
display.set_attr("temperature.text", str(''.join([str(x2) for x2 in ['Temperature: ', round(temperature, 1), ' °C']])))
time.sleep(1)
<xml xmlns="https://developers.google.com/blockly/xml" version="12">
<block type="txt4_controller" id="bx`~@dS+oeG-#2C{_P6k" x="0" y="0">
<mutation>
<arg type="Input" name="Input-0" value="I3"/>
<arg type="Input" name="Input-1" value="-"/>
<arg type="Output" name="Output-0" value="-"/>
<arg type="Motor" name="Motor-0" value="-"/>
<arg type="Servomotor" name="Servomotor-0" value="-"/>
<arg type="Counter" name="Counter-0" value="-"/>
<arg type="I2C" name="I2C-0" value="I2C_1"/>
<arg type="I2C" name="I2C-1" value="-"/>
<arg type="USB" name="USB-0" value="USB1_1"/>
<arg type="USB" name="USB-1" value="-"/>
</mutation>
<field name="mode">0</field>
<field name="controller_name">TXT</field>
<field name="Input-0">I3</field>
<field name="Input-1">-</field>
<field name="Output-0">-</field>
<field name="Motor-0">-</field>
<field name="Servomotor-0">-</field>
<field name="Counter-0">-</field>
<field name="I2C-0">I2C_1</field>
<field name="I2C-1">-</field>
<field name="USB-0">USB1_1</field>
<field name="USB-1">-</field>
<value name="Input-0">
<block type="photo_resistor" id="7=O2mllI@egutXUTI6W+"/>
</value>
<value name="I2C-0">
<block type="environment_sensor" id="^[+fFmp-$M]:Q@3|$^i]"/>
</value>
<value name="USB-0">
<block type="microphone" id="!V1pl.[^Be)59Y~2J3#R"/>
</value>
</block>
</xml>
\ No newline at end of file
import fischertechnik.factories as txt_factory
txt_factory.init()
txt_factory.init_input_factory()
txt_factory.init_i2c_factory()
txt_factory.init_usb_factory()
TXT_M = txt_factory.controller_factory.create_graphical_controller()
TXT_M_I3_photo_resistor = txt_factory.input_factory.create_photo_resistor(TXT_M, 3)
TXT_M_I2C_1_environment_sensor = txt_factory.i2c_factory.create_environment_sensor(TXT_M, 1)
TXT_M_USB1_1_microphone = txt_factory.usb_factory.create_microphone(TXT_M, 1)
txt_factory.initialized()
\ No newline at end of file
import os
import time
import threading
import signal
import ftgui
display = ftgui.fttxt2_gui_connector("app")
display.open()
def display_monitoring():
while display.is_open():
time.sleep(1)
os.kill(os.getpid(), signal.SIGTERM)
exit()
threading.Thread(target=display_monitoring, daemon=True).start()
// auto generated content from display configuration
import QtQuick 2.2
import QtQuick.Window 2.0
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1
import QtQuick.Extras 1.4
TXTWindow {
Rectangle {
id: rect
color: "grey"
anchors.fill: parent
}
TXTLabel {
id: txt_label
text: "Indoor Climate"
font.pixelSize: 16
elide: Text.ElideRight
x: 20
y: 20
width: 200
height: 20
}
TXTLabel {
id: humidity
text: "Humidity: - %"
font.pixelSize: 16
elide: Text.ElideRight
x: 20
y: 60
width: 200
height: 20
}
TXTLabel {
id: temperature
text: "Temperature: - °C"
font.pixelSize: 16
elide: Text.ElideRight
x: 20
y: 100
width: 200
height: 20
}
}
<xml type="display" version="2"><item id="2" class="TXTLabel"><name>txt_label</name><text>Indoor Climate</text><geometry><x>20</x><y>20</y><width>200</width><height>20</height></geometry></item><item id="3" class="TXTLabel"><name>humidity</name><text>Humidity: - %</text><geometry><x>20</x><y>60</y><width>200</width><height>20</height></geometry></item><item id="4" class="TXTLabel"><name>temperature</name><text>Temperature: - °C</text><geometry><x>20</x><y>100</y><width>200</width><height>20</height></geometry></item></xml>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment