Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/FirebaseRoom_ESP8266/FirebaseRoom_ESP8266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ void setup() {
Serial.println(WiFi.localIP());

Firebase.begin("example.firebaseio.com", "secret_or_token");
Firebase.set("pushbutton", 0);
Firebase.set("sunlight", 0);
Firebase.set("redlight", 0);
Firebase.set("cooldown", 0);
Firebase.set("brrr", 0);
}

int button = 0;
Expand Down
54 changes: 54 additions & 0 deletions examples/FirebaseRoom_ESP8266/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Firebase Room

## Software setup

1. Install [Arduino 1.6.9](https://www.arduino.cc/en/Main/Software)
1. Install [Arduino ESP8266 core](https://github.com/esp8266/Arduino#installing-with-boards-manager)
1. Download [FirebaseArduino library](https://github.com/googlesamples/firebase-arduino/archive/master.zip)
1. Start Arduino
1. Click `Sketch > Include Library > Add .ZIP Library...`
1. Choose `firebase-arduino-master.zip` downloaded in step `3.`

## Hardware setup

1. Get a [Wio Link](http://www.seeedstudio.com/wiki/Wio_Link)
1. Connect:
- a [Grove - Vibration Motor](http://www.seeedstudio.com/wiki/Grove_-_Vibration_Motor) on `pin 5`
- a [Grove - Light Sensor](http://www.seeedstudio.com/wiki/Grove_-_Light_Sensor) on `pin A0`
- a [Grove - Red LED](http://www.seeedstudio.com/wiki/Grove_-_Red_LED) on `pin 12`
- a [Grove - Button](http://www.seeedstudio.com/wiki/Grove_-_Button) on `pin 14`
- a [Grove - Mini Fan](http://www.seeedstudio.com/wiki/Grove_-_Mini_Fan) on `pin 13`

## Configuration

1. Go to https://www.firebase.com/ and create a new Firebase
1. Copy the `Firebase Hostname`
1. Go to `Secrets`
1. Click `Firebase Secrets > Shows`
1. Copy the `Firebase Secret`
1. Start Arduino
1. Click `File > Examples > firebase-arduino > FirebaseRoom_ESP8266`
1. Replace `example.firebaseio.com` with the `Firebase Hostname` from step `2.`
1. Replace `secret_or_token` with `Firebase Secret` from step `5.`
1. Click `Sketch > Upload`

## Play

1. Go to the Firebase console `Data` section
1. Set `redlight` to `1` then `0`
1. Watch the Red LED turn on and off in the room
1. Same for `cooldown` and `brrr`
1. Press the push button in the room
1. Watch the `pushbutton` value change in the Firebase console
1. Put your hand on the light sensor
1. Watch the `sunlight` value change in the Firebase console

## Homeworks

- Build a [Firebase web app](https://www.firebase.com/docs/web/) that interacts with the room.
- Connect other Grove modules to the room and submit new [PRs](https://github.com/googlesamples/firebase-arduino/pulls)
- Reduce the number of Firebase API calls using `FirebaseObject` or `FirebaseStream`.
- Watch or star the [GitHub repo repo](https://github.com/googlesamples/firebase-arduino)
- Give [feedback](gitter.im/googlesamples/firebase-arduino)
- Report [bugs](https://github.com/googlesamples/firebase-arduino/issues/new)
- [Fork](https://github.com/googlesamples/firebase-arduino#fork-destination-box) and [contribute](https://github.com/googlesamples/firebase-arduino/blob/master/CONTRIBUTING.md)