Skip to content

Instantly share code, notes, and snippets.

@jeancode
Forked from xxlukas42/esp32_internal_hall.ino
Last active December 8, 2020 18:52
Show Gist options
  • Save jeancode/4c58ce690f68079037a150e2ba648fbc to your computer and use it in GitHub Desktop.
Save jeancode/4c58ce690f68079037a150e2ba648fbc to your computer and use it in GitHub Desktop.
Arduino source code for ESP32 internal temperature sensor and hall sensor
void setup() {
Serial.begin(115200);
}
void loop() {
//creamos una variable bajo c++14
auto measurement = 0;
measurement = hallRead();
Serial.print("Hall sensor measurement: ");
Serial.println(measurement);
delay(1000);
}
#ifdef __cplusplus
extern "C" {
#endif
uint8_t temprature_sens_read();
#ifdef __cplusplus
}
#endif
//creamos una variable bajo c++14
auto temprature_sens_read();
void setup() {
Serial.begin(115200);
}
void loop() {
Serial.print("Temperature: ");
// Convert raw temperature in F to Celsius degrees
Serial.print((temprature_sens_read() - 32) / 1.8);
Serial.println(" C");
delay(5000);
}
@jeancode
Copy link
Author

jeancode commented Dec 8, 2020

Actualizando el código bajo los nuevos estándares de c++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment