update mqtt block
@@ -6,8 +6,17 @@ goog.require('Blockly.Arduino');
Blockly.Arduino.WIFI_info = function() {
var SSID = Blockly.Arduino.valueToCode(this, 'SSID', Blockly.Arduino.ORDER_ATOMIC);
var PWD = Blockly.Arduino.valueToCode(this, 'PWD', Blockly.Arduino.ORDER_ATOMIC);
- Blockly.Arduino.definitions_['include_ESP8266WiFi'] ='#include <ESP8266WiFi.h>';
+
Blockly.Arduino.setups_['WiFi.begin'] = 'WiFi.begin('+SSID+', '+PWD+');';
+ if(JSFuncs.getPlatform()=="ESP8266_Boards_(2.5.2)")
+ {
+ Blockly.Arduino.definitions_['include_ESP8266WiFi'] ='#include <ESP8266WiFi.h>';
+ }
+ else if(JSFuncs.getPlatform()=="ESP32_Arduino")
+ {
+ Blockly.Arduino.definitions_['include_WiFi'] ='#include <WiFi.h>';
+
+ }
return "";
};
