Skip to main content
Search
Search This Blog
Emily's Media Art
Share
Get link
Facebook
X
Pinterest
Email
Other Apps
February 02, 2023
STUPID PET TRICK
int Button = 12; int hairDryer = 8; void setup() { // put your setup code here, to run once: Serial.begin(9600); // set pins as input or output pinMode(hairDryer, OUTPUT); pinMode(Button, INPUT); // enable resistor digitalWrite(Button, HIGH); } void loop() { // put your main code here, to run repeatedly: // if button is pressed the hair dryer will turn on if(digitalRead(Button) == 0) { digitalWrite(hairDryer, HIGH); delay(1000); } // When button is not pressed the hair dryer will be off digitalWrite(hairDryer, LOW); // will show the input of the button in serial monitor Serial.println(digitalRead(Button)); }
Comments
Popular Posts
January 12, 2023
BLINK ASSIGNMENT
April 02, 2023
KINETIC OBJECT: BLOOMING FLOWER
Comments
Post a Comment