Image

Homework 06 – Second Arduino Board Interacton – Sarah Wolf and Charlene Kulesa

21 Nov

Homework 06 - Second Arduino Board Interacton - Sarah Wolf and Charlene Kulesa

Potentiometer is connected to arduino board 1, controls the LED light blinking frequency on arduino board 2.

Here is the code:
int LED = 13;// setting the integer LED
int pot = 0; //analog pin used to connect the potentiometer

void setup() {
pinMode (LED, OUTPUT);// set pin 13 to output

}
void loop() {
pot = (analogRead(A0));
digitalWrite (LED, HIGH);// Turn LED on
delay(pot); //delay based off of potentiometer
digitalWrite (LED, LOW);//Turn LED off
delay(pot); //delay based off of potentiometer

}

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s