How to configure input / output pin ARDUINOS

Thread Starter

microcontroller60

Joined Oct 1, 2019
62
I am new for ARDUINOS IDE. When I open IDE I get editor to write code I want to know how I can make a pin as an input pin or as an output pin I have two switch and two Led so how to configure input/output for them in ARDUINOS IDE.


1581079092118.png
 

Thread Starter

microcontroller60

Joined Oct 1, 2019
62
Use the pinmode() function.
Hi "OBW0549

I do not have board I am practicing on IDE
I wrote it code
Code:
void setup() {
 
pinMode(13, INPUT);    // sets the digital pin 13 as input switch
pinMode(14, OUTPUT);    // sets the digital pin 14 as output led
}

void loop() {
  // put your main code here, to run repeatedly:

  digitalWrite(14, HIGH); // sets the digital pin 14 on
  delay(1000);            // waits for a second
  digitalWrite(14, LOW);  // sets the digital pin 14 off
  delay(1000);            // waits for a second

}
 

dl324

Joined Mar 30, 2015
16,846
I do not have board I am practicing on IDE
I wrote it code
I only started using Arduino about 9 months ago and I did the same. As soon as the Arduino Uno arrived, I had some code to upload and run.

Be aware that the Arduino IDE is buggy. Also be aware that the Arduino site is crude compared to AAC and a number of high post count members there aren't very welcoming. I didn't even make it to 100 posts before I left.
 

djsfantasi

Joined Apr 11, 2010
9,156
You may have a different experience. I’ve been using the Arduino platform for a long time for many projects. Including a project on a Mega with 1,000 lines of code.

I have found the Arduino forum to be a helpful and valuable resource. And I have not had any difficulty with the Arduino IDE, using it as well to program other non-Arduino microprocessors.

So, as I stated, your experience may vary.
 
Top