Drop Pressure Sensor Config
Posted by Justin Bernard on January 6, 2014
convert/create method of:
"sensor is rated 0-25lbs
voltage input is 0-5v
Analog input reads 0-5V as 0-1023
so we need to do 0 is 0oz, 1023 is 400oz"
WiFi Refrigerator Scale
Posted by Justin Bernard on January 6, 2014
convert/create method of:
"sensor is rated 0-25lbs
voltage input is 0-5v
Analog input reads 0-5V as 0-1023
so we need to do 0 is 0oz, 1023 is 400oz"
Comments
Justin Bernard on January 6, 2014:
0-5V as 0-1023
so that mean syou always receive the value returned as 0-1023 instead of 0-5, right?
Taylor Bernard on January 6, 2014:
yep
Justin Bernard on January 7, 2014:
float instantPound;
}
Taylor Bernard on January 7, 2014:
agent.send
or
data.push
here's the most logical code ive seen so far:
but this is the one thats throwing an error on that data = [] line for some reason
//------------
//Setup hardware
sensor1 <- hardware.pin1;
sensor1.configure(ANALOG_IN);
function getValuesAndSendToXively() {
// read values from pins
local s1 = sensor1.read();
// make array of {key/value} objects to send to agent
data = [];
data.push( { key = "sensor1", value = s1 } );
// send to agent
agent.send("sendToXively", data);
// wakeup in 15 minutes, and do it again
imp.wakeup(120, getValuesAndSendToXively);
}
getValuesAndSendToXively();
Taylor Bernard on January 7, 2014:
http://forums.electricimp.com/discussion/comment/9566
why is his agent code so much more involved? looks like both do the same thing in theory, just send 1 ch of data back to the API?
Justin Bernard on January 7, 2014:
Taylor Bernard on January 7, 2014:
Justin Bernard on January 7, 2014:
https://github.com/beardedinventor/electricimp/tree/master/Xively/example
Taylor Bernard on January 7, 2014:
https://github.com/electricimp/examples/tree/master/tempBug
http://www.instructables.com/id/TempBug-internet-connected-thermometer/step5/Setting-your-imp-firmware/
Justin Bernard on January 7, 2014:
Taylor Bernard on January 7, 2014:
Justin Bernard on January 7, 2014:
moving forward i'll base stuff off that code base. looking now into stripping stuff out so we can add our functionality into it...
Taylor Bernard on January 7, 2014: