My first IoT project was to get the on board LED flashing which I achieved here:
Not as easy as IoT
With that accomplished, I now wanted to get an external LED flashing.
I firstly needed to pick a pin on the Adafruit device to control the output on.

I chose the third in from the bottom on the right which is PIN 2.
Next, I needed to work out the maximum output voltage for the Adafruit Feather Huzzah, which turns out to be 3.3 Volts. I also noted the following from the pin output specifications as well:
“be aware the maximum current drawn per pin is 12mA. 6mA recommended”
I also needed to take into account the voltage drop that would occur across the LED, which is around 0.7V. So the voltage for my calculation was now:
3.3V – 0.7V = 2.3V
To work out what resistor I needed to place in the circuit I used the good ole V= IR.
V=IR
R = V/I
R = 2.3 / 0.006
R = 433 ohms
I double checked my logic at:
http://www.anycalculator.com/ohmslaw.htm
I then went through the:
I had bought to see what resistors were included. In there I found a 560 ohm resistor. If you need to check your resistor markings like I did, you can use:
https://byjus.com/physics/resistor-colour-codes/
to help discern what you have.
A 560 ohm resistor would means my current would be:
I = V / R
I = 2.3 / 560
I = 4.1 milliamps (well below the 6 milliamp recommendation)
All I needed now was to find the ground for the Adafruit

which turned out to be the fourth pin from the top on the left.
I therefore wired up the output from pin 2 on the Adafruit, through the LED, through the resistor and then to ground, completing the circuit.
Now for the code to make it flash.
#include <Arduino.h>
int LED_Pin = 2;
int status = 1;
void setup(){
pinMode(LED_Pin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if (status) {
digitalWrite(LED_Pin, HIGH);
} else {
digitalWrite(LED_Pin, LOW);
}
status = 1-status;
delay (1000);
}
which is basically the same as before, except the LED_pin now is set to 2. The code is at:
https://github.com/directorcia/Azure/blob/master/Iot/huzzah-ext-flash-led.c
Using PlatformIO IDE I uploaded my code to the Adafruit and after a few minutes was greeted by:

Magic eh?
Sure it’s simple but it’s another step along my IoT journey.