Search
 
SCRIPT & CODE EXAMPLE
 

C

arduino digital input pins

int ledPin = 13;  // LED connected to digital pin 13
int inPin = 7;    // pushbutton connected to digital pin 7
int val = 0;      // variable to store the read value

void setup() {
  pinMode(ledPin, OUTPUT);  // sets the digital pin 13 as output
  pinMode(inPin, INPUT);    // sets the digital pin 7 as input
}

void loop() {
  val = digitalRead(inPin);   // read the input pin
  digitalWrite(ledPin, val);  // sets the LED to the button's value
}
Comment

PREVIOUS NEXT
Code Example
C :: fonction recursive successeur nombre chaine de caractere en c 
C :: successeur ("123") 
C :: c format specifiers 
C :: print ascii value in c 
C :: libdvd-pkg: `apt-get check` failed 
C :: Call by reference to pass an array to the function in C- 
C :: pass the pointer to the function 
C :: c iterate string 
C :: arduino millis() 
C :: c how to check a palindrome string 
C :: c argv 
C :: c binary search 
C :: string input c 
C :: mongodb update 
C :: c strcat 
C :: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration] 
C :: fgets function in c 
C :: what is the usage of extern in c 
C :: Bitwise Operators in C/C++ 
C :: c convert float to string 
C :: c strstr 
C :: adjacency matrix representation maker 
C :: millis() 
C :: passing file as argument in c 
C :: Initialization of a 3d array in c 
C :: how to input till end of line in c 
C :: getline function in c 
C :: round c 
C :: sphinx-doc 
C :: linux_reboot_magic2 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =