Skip to content

Commit

Permalink
Day08
Browse files Browse the repository at this point in the history
  • Loading branch information
JosepMartiElias committed Dec 8, 2024
1 parent a31a746 commit bfeed47
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
3 changes: 1 addition & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ hide:
1. Play me!

!!! tip annotate "8. Will you get the lowest temperature? (1)"
Day 08
[](solutions/08/08.md)
[Day 08](solutions/08/08.md)
1. Challenge accepted

!!! bug annotate "9. LED's get artistic (1)"
Expand Down
41 changes: 41 additions & 0 deletions docs/solutions/08/08.md
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)
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ nav:
- Day 5: solutions/05/05.md
- Day 6: solutions/06/06.md
- Day 7: solutions/07/07.md
#- Day 8: solutions/08/08.md
- Day 8: solutions/08/08.md
#- Day 9: solutions/09/09.md
#- Day 10: solutions/10/10.md
#- Day 11: solutions/11/11.md
Expand Down

0 comments on commit bfeed47

Please sign in to comment.