1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-13 23:48:46 +01:00
Arduino/build/shared/examples/10.StarterKit_BasicKit/p15_HackingButtons/p15_HackingButtons.ino
per1234 8f48433f33 Indent all multi-line C style comments in built-in examples by at least two spaces
This is required for Auto Format compatibility because it has the undesirable effect of indenting only unindented contents of multi-lline comments, thus altering the relative indentation of the text.

The exception is the Max/MSP patches as I did not know whether indentation would break them.
2017-07-18 11:07:37 +02:00

36 lines
827 B
C++

/*
Arduino Starter Kit example
Project 15 - Hacking Buttons
This sketch is written to accompany Project 15 in the
Arduino Starter Kit
Parts required:
battery powered component
220 ohm resistor
4N35 optocoupler
Created 18 September 2012
by Scott Fitzgerald
http://www.arduino.cc/starterKit
This example code is part of the public domain
*/
const int optoPin = 2; // the pin the optocoupler is connected to
void setup() {
// make the pin with the optocoupler an output
pinMode(optoPin, OUTPUT);
}
void loop() {
digitalWrite(optoPin, HIGH); // pull pin 2 HIGH, activating the optocoupler
delay(15); // give the optocoupler a moment to activate
digitalWrite(optoPin, LOW); // pull pin 2 low until you're ready to activate again
delay(21000); // wait for 21 seconds
}