//This sketch varies the brightness of an LED over time!
//Note that the LED is plugged into a pin with the ~ symbol. That symbol means that that pin supports 'analogWrite'
const int led_pin = 6; //Setting the variable for the LED pin
int led_brightness;
void setup() {
pinMode(led_pin, OUTPUT); //Setting the LED as an output
}
void loop() {
//The value we get from analogread is from 0 to 1024
//Therefore we need to divide it by 4 to get it to be from 0 to 255,
//which is the range analogWrite takes in
led_brightness = analogRead(A0) / 4;
analogWrite(led_pin, led_brightness);
}