-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a31a746
commit bfeed47
Showing
3 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Day eight: | ||
|
||
Challenge!! Who will get the lowest temperature? | ||
|
||
Use the temperature sensor to win, upload a picture of the temperature printed on Serial and a picture of the situation. It's not allowed to put the Barduino in the fridge... 😜 Give it some time for the temperature to stabilize, it can take up to 15 minutes. | ||
|
||
Tip, you can power the board with you phone and read the Serial there with an app in [Android](https://play.google.com/store/apps/details?id=de.kai_morich.serial_usb_terminal&hl=en&gl=US&pli=1) (I don't know if that's possible with iPhones). | ||
|
||
## Possible solution! | ||
|
||
### Arduino code | ||
|
||
```c++ | ||
#include <Temperature_LM75_Derived.h> | ||
|
||
TI_TMP102 temperature; | ||
|
||
const int push = 0; | ||
bool pressed = false; | ||
|
||
void setup() { | ||
pinMode(push, INPUT); | ||
Serial.begin(115200); | ||
Wire.begin(); | ||
} | ||
|
||
void loop() { | ||
if (!digitalRead(push) && !pressed) { | ||
pressed = true; | ||
Serial.print("Temperature = "); | ||
Serial.print(temperature.readTemperatureC()); | ||
Serial.println(" C"); | ||
} else if (digitalRead(push)) { | ||
pressed = false; | ||
} | ||
} | ||
``` | ||
|
||
## Hero shot | ||
|
||
![Day06](../../images/Day08.png) |
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