Search
 
SCRIPT & CODE EXAMPLE
 

C

arduino digital read

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 :: successeur d’un entier donné 
C :: successeur nombre chaine 
C :: how to genrate a random number in C 
C :: two bytes to int c 
C :: fast inverse square root explained 
C :: how to get add to number C 
C :: nested loop in c 
C :: add field to model rails 
C :: c convert integer to string 
C :: c define array size 
C :: armstrong number in c 
C :: addition in c 
C :: check if string in string c 
C :: for loop in c 
C :: how to scanf two dimensional array in c 
C :: c print to stderr 
C :: how to make sure input is integer c 
C :: binary to decimal in c 
C :: The fscanf and fprintf functions 
C :: simple calculator, using switch statement in C 
C :: c language string 
C :: program to find the average of n numbers using arrays. 
C :: bubble sort c 
C :: function component with props 
C :: iterate through enum in qt 
C :: fahrenheit to celcius 
C :: rust set toolchain 
C :: what is the use of malloc in c 
C :: increment pointer value in c 
C :: C Pass Individual Array Elements 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =