I started with a simple circuit consisting of a Photon 2 microcontroller, a red LED, and a 1 kOhm resistor. At first, I started with my LED being controlled by pin D2 as I tested simple HIGH and LOW digital output controls to turn the LED on and off. I then tried to use this same D2 pin for pulse width modulation (PWM) control through the analogWrite() function, but it did not work. I then changed my circuit and code to control the LED using the D1 pin and as able to successfully adjust the brightness from my Particle Console. I used a Particle function that accepted a String input and converted it to an integer to set the brightness to if the value was withing bounds.
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .