Back to Parent

Code for Central Controller
int fsrPin = A5;
int fsrReading = 0;

int last_published = 0;

void setup() {
    
    pinMode(fsrPin, INPUT);

}

void loop() {
    fsrReading = analogRead(fsrPin);
    if (fsrReading > 1500)
    {
        if (millis() - last_published > 1000)
        {
            Particle.publish("coolball/homescore", "homescore");
            last_published = millis();
        }
        
    }
}
Click to Expand

Content Rating

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

0