-
-
Save jeancode/4c58ce690f68079037a150e2ba648fbc to your computer and use it in GitHub Desktop.
Arduino source code for ESP32 internal temperature sensor and hall sensor
This file contains 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
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); | |
} |
This file contains 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
#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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actualizando el código bajo los nuevos estándares de c++