String versus Number in Blocky
Posted: Monday 16 October 2017 22:51
I use a selector to input the desired temperature.
I have a temperature sensor connected to a ESP8266 that gives the temperature in the room.
I want to compare both to decide if the heater must switch on or off.
Can I covert a number to a string and/or can I convert a string to a number in Blocky?
Looking forward to a solution.
=======================================================================================================
The error code is:
2017-10-16 22:36:04.885 Error: EventSystem: Lua script error (Blockly), Name: Thermostaat_3 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to compare string with number
My Blocky is:
My Selector is:
I have a temperature sensor connected to a ESP8266 that gives the temperature in the room.
I want to compare both to decide if the heater must switch on or off.
Can I covert a number to a string and/or can I convert a string to a number in Blocky?
Looking forward to a solution.
=======================================================================================================
The error code is:
2017-10-16 22:36:04.885 Error: EventSystem: Lua script error (Blockly), Name: Thermostaat_3 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: attempt to compare string with number
My Blocky is:
My Selector is: