Back to Parent

Reflection

  • The first time I was connecting, I had forgotten to use jumper wires to power the whole circuit. It's so easy to get caught up and excited about engaging with the input and output because of which I made multiple mistakes in setting up the circuit.
  • Writing code on your own without an exact reference is hard. I wanted to make sure I'm getting the basics right instead of just copying code and it took me multiple trials and errors and multiple hours, despite which I couldn't get it right. Following is the code I couldn't get to work, hence I decided to design something different for exercise. If you spot my mistake and know how to fix it, please comment and let me know.  
  • int flexPin = A0;

    int flexReading = 0;

    int ledPin = D2;

    int ledBrightness = 0;

    void setup() {

    pinMode(ledPin, OUTPUT);

    Particle.variable("snoopy", flexReading );

    }

    void loop() {

    flexReading = analogRead(flexPin);

    ledBrightness = map(flexReading, 0, 4095, 0, 255);

    analogWrite(ledPin, ledBrightness);

    delay(100);

    }


Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0