Skip to content

Instantly share code, notes, and snippets.

@staceymakes
Created November 20, 2014 20:28
Show Gist options
  • Select an option

  • Save staceymakes/6ceb19eb2b12a0eb8704 to your computer and use it in GitHub Desktop.

Select an option

Save staceymakes/6ceb19eb2b12a0eb8704 to your computer and use it in GitHub Desktop.
SparkCore Analog Pressure Sensor
#include "lib1.h"
double pressure = 0.0;
// This routine runs only once upon reset
void setup() {
// we want to save this variable to use with the rest api
Spark.variable("pressure", &pressure, DOUBLE);
pinMode(A0, INPUT);
}
void loop() {
pressure = analogRead(A0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment