[Feb 13 20:51:19.925] mgos_app_init c-code dual core ver 0.1
[Feb 13 20:51:19.925] mgos_app_init CPU Speed: 240
[Feb 13 20:51:19.925] mgos_app_init Interrupt attached
[Feb 13 20:51:21.942] task_toggle_led core: 1task_other_core
[Feb 13 20:51:21.942] mgos_app_init core: 0app_init done
[Feb 13 20:51:21.942]
[Feb 13 20:51:21.942] mgos_init Init done, RAM: 307692 total, 267056 free, 267056 min free
[Feb 13 20:51:22.934] mongoose_poll New heap free LWM: 267016
[Feb 13 20:51:26.005] interupt_handler_gpi core: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.eclipse.paho.client.mqttv3.MqttClient; | |
import org.eclipse.paho.client.mqttv3.MqttConnectOptions; | |
import org.eclipse.paho.client.mqttv3.MqttException; | |
import org.eclipse.paho.client.mqttv3.MqttMessage; | |
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken; | |
import org.eclipse.paho.client.mqttv3.MqttCallback; | |
public class HelloMQTT implements MqttCallback { | |
MqttClient client; | |
private MqttConnectOptions conOpt; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var blueLEDOn = false; | |
var pushbuttonCounter = 0; | |
setInterval(function () { | |
blueLEDOn = !blueLEDOn; | |
LED3.write(blueLEDOn); | |
}, 1000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{ | |
"C_Cpp.intelliSenseEngineFallback": "Enabled", | |
"files.associations": { | |
"mgos.h": "c" | |
}, | |
"C_Cpp.intelliSenseEngine": "Tag Parser" | |
}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{ | |
"includePath": [ | |
"${workspaceFolder}/**", | |
"/your path/git/mongoose-os/", | |
"/your path/git/esp-idf/", | |
"/your path/git/mjs/" | |
] | |
}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool mgos_adc_enable(int pin) { | |
struct esp32_adc_channel_info *ci = esp32_adc_get_channel_info(pin); | |
if (ci == NULL) return false; | |
/* TODO(rojer): Allow changing? */ | |
ci->atten = ADC_ATTEN_11db; | |
return esp32_update_channel_settings(ci); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef enum { | |
ADC_ATTEN_DB_0 = 0, /*!<The input voltage of ADC will be reduced to about 1/1 */ | |
ADC_ATTEN_DB_2_5 = 1, /*!<The input voltage of ADC will be reduced to about 1/1.34 */ | |
ADC_ATTEN_DB_6 = 2, /*!<The input voltage of ADC will be reduced to about 1/2 */ | |
ADC_ATTEN_DB_11 = 3, /*!<The input voltage of ADC will be reduced to about 1/3.6*/ | |
ADC_ATTEN_MAX, | |
} adc_atten_t; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let MYADC = { | |
cfg: ffi('int adc1_config_channel_atten(int, int)'), // that function must be in the SDK | |
}; | |
let db6 = 2; // whatever the numeric value for 6 dB is 2 | |
MYADC.cfg(pin, db6); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include "esp32/esp32_adc.h" | |
#include "esp_adc_cal.h" | |
#include "mgos.h" | |
#include "mgos_adc.h" | |
#include "mgos_system.h" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import obd | |
connection = obd.OBD("/dev/rfcomm0") | |
cmd = obd.commands.RPM | |
response = connection.query(cmd) | |
print(response.value) | |
print(connection.protocol_name()) |
OlderNewer