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

Commit77b2ab8

Browse files
committed
Addresses some feedback from review, fixes folder structure for Arduino builds
1 parent3a527e9 commit77b2ab8

File tree

6 files changed

+7
-16
lines changed

6 files changed

+7
-16
lines changed

‎examples/Firebase_ESP8266_Neopixel/web/web-demo.htmlrenamed to‎examples/Firebase_ESP8266_LEDs/Firebase_ESP8266_Neopixel-web/web-demo.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
</head>
2424
<script>
2525
// TODO: Needs security.
26-
varfirebaseUrl='https://brilliant-fire-9638.firebaseio.com';
27-
varfirebaseSecret='llXzJtqwdiHCHw6F6sehQR2EPwbO0YYdhEjPRZxG';
26+
varfirebaseUrl='https://YOUR_FIREBASE_URL.firebaseio.com';
27+
varfirebaseSecret='YOUR_FIREBASE_SECRET';
2828
</script>
2929
<body>
3030
<h2>Paint Demo</h3>

‎examples/Firebase_ESP8266_Neopixel/Firebase_ESP8266_Neopixel.inorenamed to‎examples/Firebase_ESP8266_LEDs/Firebase_ESP8266_Neopixel/Firebase_ESP8266_Neopixel.ino

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@
2525
#definePIN13
2626
Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800);
2727

28+
#defineJSON_BUFFER_SIZE10*4
2829

2930
// TODO: Replace with your own credentials and keep these safe.
30-
Firebase fbase = Firebase("brilliant-fire-9638.firebaseio.com")
31-
.auth("llXzJtqwdiHCHw6F6sehQR2EPwbO0YYdhEjPRZxG");
31+
Firebase fbase = Firebase("YOUR-PROJECT-ID.firebaseio.com")
32+
.auth("YOUR_AUTH_SECRET");
3233

3334
voidsetup() {
3435
Serial.begin(9600);
@@ -37,6 +38,7 @@ void setup() {
3738
strip.setBrightness(25);// 0 ... 255
3839
strip.show();// Initialize all pixels to 'off'
3940

41+
// Not connected, set the LEDs red
4042
colorWipe(&strip,0xFF0000,50);
4143

4244
// connect to wifi.
@@ -74,7 +76,7 @@ void loop() {
7476

7577
// Use dynamic for large JSON objects
7678
// DynamicJsonBuffer jsonBuffer;
77-
StaticJsonBuffer<JSON_OBJECT_SIZE(10*4)> jsonBuffer;
79+
StaticJsonBuffer<JSON_OBJECT_SIZE(JSON_BUFFER_SIZE)> jsonBuffer;
7880

7981
// create an empty object
8082
String ref = get.json();
@@ -87,17 +89,6 @@ void loop() {
8789
String pixelVal = pixelJSON[pixelAddress];
8890
Serial.println(pixelVal);
8991
strip.setPixelColor(i, pixelVal.toInt());
90-
91-
// Don't do this: it will waste tons of memory due to the way that the
92-
// Arduino JSON library handles elements.
93-
/*
94-
int r = (uint32_t) pixelJSON[pixelAddress]["r"];
95-
int g = (uint32_t) pixelJSON[pixelAddress]["g"];
96-
int b = (uint32_t) pixelJSON[pixelAddress]["b"];
97-
98-
Serial.println("Setting [" + String(i) + "] to {" + String(r) + "," + String(g) + "," + String(b) + "}");
99-
strip.setPixelColor(i, strip.Color(r, g, b));
100-
*/
10192
}
10293
strip.show();
10394
}else {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp