My circuit is a simple one, I am using an arduino atmega 2560. One 5mm red LED connected in series with a 150 ohm resistor. If I didn't make some kind of goof, a red LED has a voltage drop of 2 volts and operates at 20 ma. So my calculations were, 5-2=3volts. 3V/150=20 mA. So I put a 150 ohm resistor. My code to control it is the following:
int red = 48;
void setup() {
pinMode(OUTPUT,red);
}
void loop() {
digitalWrite(red,HIGH);
}
When I run the code the red LED is dimly lit, when connected to the 5V on the board it lights brightly. When I measured the voltage between pin48 and ground I got 1.7 volts. When connected directly to the 5V and GND the voltage between them is 4.95V. Measuring a pin with nothing connected set at HIGH results in a 4.99V reading. Is my board malfunctioning or have I missed something?
pinMode(red, OUTPUT)