diff --git a/README.md b/README.md index f548ad1..cccf8d8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # ArduinoOOP -This is an Arduino-based project that will follow my progression learning C++ (on the Arduino IDE and otherwise) with a goal of proficiency in object-oriented programming for mechatronics engineering. I will start by building an 'mp3 player' with Adafruit components and program the software to read data from a TF card and output audio using Bluetooth low-energy protocals. +This is an Arduino-based project that will follow my progression learning C++ (on the Arduino IDE and otherwise) with a goal of proficiency in object-oriented programming for mechatronics engineering. diff --git a/digital-read-button.ino b/digital-read-button.ino new file mode 100644 index 0000000..6fae9f1 --- /dev/null +++ b/digital-read-button.ino @@ -0,0 +1,18 @@ +void setup() { + // put your setup code here, to run once: +pinMode(0, INPUT); +pinMode(LED_BUILTIN, OUTPUT); +Serial.begin(9600); +} + +void loop() { + // put your main code here, to run repeatedly: +digitalRead(0); +int input1 = digitalRead(0); +if(input1 == 0) { + digitalWrite(LED_BUILTIN, HIGH); + delay(100); +} +digitalWrite(LED_BUILTIN, LOW); +Serial.println(input1); +}