commit
						31efce44e7
					
				| @ -330,7 +330,6 @@ Blockly.Blocks["sensebox_button"] = { | |||||||
|         new Blockly.FieldDropdown([ |         new Blockly.FieldDropdown([ | ||||||
|           [Blockly.Msg.senseBox_button_isPressed, "isPressed"], |           [Blockly.Msg.senseBox_button_isPressed, "isPressed"], | ||||||
|           [Blockly.Msg.senseBox_button_wasPressed, "wasPressed"], |           [Blockly.Msg.senseBox_button_wasPressed, "wasPressed"], | ||||||
|           [Blockly.Msg.senseBox_button_switch, "Switch"], |  | ||||||
|           [Blockly.Msg.senseBox_button_longPress, "longPress"], |           [Blockly.Msg.senseBox_button_longPress, "longPress"], | ||||||
|         ]), |         ]), | ||||||
|         "FUNCTION" |         "FUNCTION" | ||||||
|  | |||||||
| @ -13,9 +13,9 @@ Blockly.Arduino.sensebox_mqtt_setup = function () { | |||||||
|   service = this.getFieldValue("service"); |   service = this.getFieldValue("service"); | ||||||
|   Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>"; |   Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>"; | ||||||
|   Blockly.Arduino.libraries_["library_adafruitmqtt"] = |   Blockly.Arduino.libraries_["library_adafruitmqtt"] = | ||||||
|     '#include "Adafruit_MQTT.h //http://librarymanager/All#Adafruit_MQTT_Library"'; |     '#include <Adafruit_MQTT.h> //http://librarymanager/All#Adafruit_MQTT_Library"'; | ||||||
|   Blockly.Arduino.libraries_["library_adafruitmqttclient"] = |   Blockly.Arduino.libraries_["library_adafruitmqttclient"] = | ||||||
|     '#include "Adafruit_MQTT_Client.h"'; |     '#include <Adafruit_MQTT_Client.h>'; | ||||||
|   Blockly.Arduino.definitions_["mqtt_server"] = |   Blockly.Arduino.definitions_["mqtt_server"] = | ||||||
|     '#define SERVER      "' + server + '"'; |     '#define SERVER      "' + server + '"'; | ||||||
|   Blockly.Arduino.definitions_["mqtt_port"] = |   Blockly.Arduino.definitions_["mqtt_port"] = | ||||||
|  | |||||||
| @ -13,7 +13,7 @@ Blockly.Arduino.sensebox_display_beginDisplay = function () { | |||||||
|     "define_display_size" |     "define_display_size" | ||||||
|   ] = `#define SCREEN_WIDTH 128\n#define SCREEN_HEIGHT 64`; |   ] = `#define SCREEN_WIDTH 128\n#define SCREEN_HEIGHT 64`; | ||||||
|   Blockly.Arduino.definitions_["define_display"] = |   Blockly.Arduino.definitions_["define_display"] = | ||||||
|     "#define OLED_RESET 4\nAdafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);"; |     "#define OLED_RESET -1\nAdafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);"; | ||||||
| 
 | 
 | ||||||
|   Blockly.Arduino.setupCode_["sensebox_display_begin"] = |   Blockly.Arduino.setupCode_["sensebox_display_begin"] = | ||||||
|     "senseBoxIO.powerI2C(true);\ndelay(2000);\ndisplay.begin(SSD1306_SWITCHCAPVCC, 0x3D);\ndisplay.display();\ndelay(100);\ndisplay.clearDisplay();"; |     "senseBoxIO.powerI2C(true);\ndelay(2000);\ndisplay.begin(SSD1306_SWITCHCAPVCC, 0x3D);\ndisplay.display();\ndelay(100);\ndisplay.clearDisplay();"; | ||||||
|  | |||||||
| @ -408,8 +408,6 @@ Blockly.Arduino.sensebox_button = function () { | |||||||
|   var code = ""; |   var code = ""; | ||||||
|   if (dropown_function === "isPressed") { |   if (dropown_function === "isPressed") { | ||||||
|     code = "button_" + dropdown_pin + ".isPressed()"; |     code = "button_" + dropdown_pin + ".isPressed()"; | ||||||
|   } else if (dropown_function === "Switch") { |  | ||||||
|     code = "button_" + dropdown_pin + ".getSwitch()"; |  | ||||||
|   } else if (dropown_function === "wasPressed") { |   } else if (dropown_function === "wasPressed") { | ||||||
|     code = "button_" + dropdown_pin + ".wasPressed()"; |     code = "button_" + dropdown_pin + ".wasPressed()"; | ||||||
|   } else if (dropown_function === "longPress") { |   } else if (dropown_function === "longPress") { | ||||||
|  | |||||||
| @ -46,7 +46,7 @@ Blockly.Arduino.sensebox_wifi_rssi = function () { | |||||||
| Blockly.Arduino.sensebox_get_ip = function () { | Blockly.Arduino.sensebox_get_ip = function () { | ||||||
|   Blockly.Arduino.definitions_["define_ipadress"] = "IPAddress ip;"; |   Blockly.Arduino.definitions_["define_ipadress"] = "IPAddress ip;"; | ||||||
|   Blockly.Arduino.setupCode_["sensebox_get_ip"] = " ip = WiFi.localIP();"; |   Blockly.Arduino.setupCode_["sensebox_get_ip"] = " ip = WiFi.localIP();"; | ||||||
|   var code = ""; |   var code = "ip"; | ||||||
|   return [code, Blockly.Arduino.ORDER_ATOMIC]; |   return [code, Blockly.Arduino.ORDER_ATOMIC]; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user