Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0d19a56

Browse files
committed
switch to camel case
1 parent4aadeeb commit0d19a56

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

‎examples/FirebaseRoom_ESP8266/FirebaseRoom_ESP8266.ino‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@
2020
#include<ESP8266WiFi.h>
2121
#include<FirebaseArduino.h>
2222

23-
constintpin_grove =15;
24-
constintpin_vibrator =5;
25-
constintpin_light_sensor = A0;
26-
constintpin_led =12;
27-
constintpin_button =14;
28-
constintpin_fan =13;
23+
constintpinGrove =15;
24+
constintpinVibrator =5;
25+
constintpinLightSensor = A0;
26+
constintpinLed =12;
27+
constintpinButton =14;
28+
constintpinFan =13;
2929

3030
voidsetup() {
3131
Serial.begin(9600);
3232

33-
pinMode(pin_grove, OUTPUT);
34-
digitalWrite(pin_grove, HIGH);
33+
pinMode(pinGrove, OUTPUT);
34+
digitalWrite(pinGrove, HIGH);
3535

36-
pinMode(pin_vibrator, OUTPUT);
37-
pinMode(pin_light_sensor, INPUT);
38-
pinMode(pin_led, OUTPUT);
39-
pinMode(pin_button, INPUT);
40-
pinMode(pin_fan, OUTPUT);
36+
pinMode(pinVibrator, OUTPUT);
37+
pinMode(pinLightSensor, INPUT);
38+
pinMode(pinLed, OUTPUT);
39+
pinMode(pinButton, INPUT);
40+
pinMode(pinFan, OUTPUT);
4141

4242
// connect to wifi.
4343
WiFi.begin("SSID","PASSWORD");
@@ -57,15 +57,15 @@ int button = 0;
5757
float light =0.0;
5858

5959
voidloop() {
60-
digitalWrite(pin_led, (int)Firebase.get("redlight"));
61-
digitalWrite(pin_fan, (int)Firebase.get("cooldown"));
62-
digitalWrite(pin_vibrator, (int)Firebase.get("brrr"));
63-
int newButton =digitalRead(pin_button);
60+
digitalWrite(pinLed, (int)Firebase.get("redlight"));
61+
digitalWrite(pinFan, (int)Firebase.get("cooldown"));
62+
digitalWrite(pinVibrator, (int)Firebase.get("brrr"));
63+
int newButton =digitalRead(pinButton);
6464
if (newButton != button) {
6565
button = newButton;
6666
Firebase.set("pushbutton", button);
6767
}
68-
float newLight =analogRead(pin_light_sensor);
68+
float newLight =analogRead(pinLightSensor);
6969
if (abs(newLight - light) >100) {
7070
light = newLight;
7171
Firebase.set("sunlight", light);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp