source: arduino-1-6-7/trunk/fuentes/arduino-ide-amd64/libraries/Adafruit_CircuitPlayground/examples/Hello_CircuitPlayground/Hello_SlideSwitch/Hello_SlideSwitch.ino @ 4837

Last change on this file since 4837 was 4837, checked in by daduve, 2 years ago

Adding new version

File size: 351 bytes
Line 
1#include <Adafruit_CircuitPlayground.h>
2
3bool slideSwitch;
4
5void setup() {
6  Serial.begin(9600);
7  CircuitPlayground.begin();
8}
9
10void loop() {
11  slideSwitch = CircuitPlayground.slideSwitch();
12 
13  Serial.print("Slide Switch: ");
14  if (slideSwitch) {
15    Serial.print("+");
16  } else {
17    Serial.print("-");
18  }
19  Serial.println();
20 
21  delay(1000);
22}
Note: See TracBrowser for help on using the repository browser.