Created
November 20, 2014 20:28
-
-
Save staceymakes/6ceb19eb2b12a0eb8704 to your computer and use it in GitHub Desktop.
SparkCore Analog Pressure Sensor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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