So how do we turn on the LED from the Particle Cloud? That’s where Particle Functions come in. The value rises with increasing brightness. Indeed, the photoresistor will output a value to read using analogRead. Since I do not have the Grove add-on board for the Photon, I connected the sensor using three male-to-female (two for power and ground and one for the signal) wires and connected the signal pin to port A0 on the Photon. To get started easily you could go for the starter kit. For the Photon, there is such a solution as well. If you don’t know the Grove system, it’s a a collection of sensors with simple four-wire connectors that typically work with an add-on board for these connectors. We’ll turn on the LED from the Particle Cloud using a Particle Function and we’ll read out the photoresistor value using a Particle Variable.įor the photoresistor, I only had a Grove Light Sensor lying around. Today, we’ll add a photoresistor and a LED with the LED positioned above the photoresistor. To start quickly, we used the Tinker firmware and the Particle iOS app to light up a LED using digitalWrite to light it up with full brightness (full 3.3V) but also with analogWrite to vary the brightness depending on the value you write (between 0-255 using the PWM port D0). ![]() In yesterday’s post, I talked a bit about the setup process and initial configuration of a Particle Photon.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |