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
| // --- Libraries | |
| #include <Arduino.h> | |
| #include <U8g2lib.h> | |
| #include <Wire.h> | |
| #include <Adafruit_MLX90614.h> // Library to communicate with IR sensors | |
| // --- Variables and settings | |
| U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/U8X8_PIN_NONE); | |
| Adafruit_MLX90614 IR_1 = Adafruit_MLX90614(0x5A); // MLX90614 address is 0x5A | |
| Adafruit_MLX90614 IR_2 = Adafruit_MLX90614(0x2B); // MLX90614 address is 0x2B |
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
| // --- Libraries | |
| #include <Arduino.h> | |
| #include <U8g2lib.h> | |
| #include <Wire.h> | |
| #include <Adafruit_MLX90614.h> // Library to communicate with IR sensors |
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
| void printTemp(Adafruit_MLX90614 sensor) | |
| { | |
| if (i < 1) | |
| { | |
| u8g2.begin(); // initialize OLED screen | |
| } | |
| TEMP = sensor.readObjectTempC(); // store temp in a double | |
| u8g2.clearBuffer(); // clear the internal memory | |
| u8g2.drawStr(0, 50, dtostrf(TEMP, 5, 1, outstr)); // convert double to string | |
| u8g2.drawStr(80, 50, "\xb0"); // hex code for degrees celsius |
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
| void printOLED(const char *t, const char *t2) | |
| { | |
| u8g2.begin(); | |
| u8g2.clearBuffer(); | |
| u8g2.drawStr(0, 20, t); | |
| u8g2.drawStr(0, 60, t2); | |
| u8g2.sendBuffer(); | |
| } |
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
| <div class="some-class"> | |
| <iframe src="YourNotebook.html" width="100%" scrolling="no" frameBorder="0" onload="resizeIframe(this)"></iframe> | |
| </div> |
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
| jupyter nbconvert --to html YourNotebook.ipynb |
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
| pip install nbconvert | |
| # OR | |
| conda install nbconvert |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 pandas as pd #pandas library that supports reading a comma-separated values (csv) file into DataFrame | |
| df = pd.read_csv('https://covid.ourworldindata.org/data/owid-covid-data.csv') #df stands for DataFrame | |
| df2 = df.set_index("location", drop = False) #drop is set to false so it will not be deleted if we set another index later | |
| df3 = df2.loc["Spain","date":"new_cases"].tail(100) |
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 pandas as pd #pandas library that supports reading a comma-separated values (csv) file into DataFrame | |
| df = pd.read_csv('https://covid.ourworldindata.org/data/owid-covid-data.csv') #df stands for DataFrame | |
| df2 = df.set_index("location", drop = False) #drop is set to false so it will not be deleted if we set another index later |
NewerOlder