Skip to content

Commit c01017c

Browse files
committed
Extended the BlinkRGB and Temperature examples
1 parent df07605 commit c01017c

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

examples/Peripherals/BlinkRGB/BlinkRGB.ino

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,22 @@ void setup() {
99
void loop() {
1010
Scout.loop();
1111

12-
// blink once for 250ms
13-
RgbLed.blinkRed(250);
14-
Scout.delay(1000);
12+
Serial.println("blink red once for 100ms");
13+
RgbLed.blinkRed(100);
14+
Scout.delay(1500);
1515

16-
// blink once using the default (500ms)
16+
Serial.println("blink green once using the default (500ms)");
1717
RgbLed.blinkGreen();
18-
Scout.delay(1000);
18+
Scout.delay(1500);
1919

20-
// blink once using 750ms
21-
RgbLed.blinkBlue(750);
20+
Serial.println("blink blue once for 1000ms");
21+
RgbLed.blinkBlue(1000);
22+
Scout.delay(1500);
23+
24+
Serial.println("blink yellow continuously every 100ms");
25+
RgbLed.enableContinuousBlink();
26+
RgbLed.blinkYellow(100);
27+
Scout.delay(1500);
28+
RgbLed.disableContinuousBlink();
2229
Scout.delay(1000);
2330
}

examples/Peripherals/Temperature/Temperature.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@ void setup() {
99
void loop() {
1010
Scout.loop();
1111

12+
int tempInCelsius = Scout.getTemperature();
13+
int tempInFahrenheit = tempInCelsius * 9/5 + 32;
1214
Serial.print("Temperature: ");
13-
Serial.println(Scout.getTemperature());
15+
Serial.print(tempInCelsius);
16+
Serial.print(" C, ");
17+
Serial.print(tempInFahrenheit);
18+
Serial.println(" F");
1419

1520
Scout.delay(1000);
1621
}

0 commit comments

Comments
 (0)