Skip to content

Commit

Permalink
Change example pins, update description, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
alextaujenis committed Nov 10, 2015
1 parent 53adf1e commit 66775b9
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
@@ -1,5 +1,5 @@
#Arduino Human Sensor Library v1.0.2
Measure change in capacitance to detect human presence, touch, and pickup events without delay.
#Arduino Human Sensor Library v1.0.3
Measure change in capacitance to detect human presence, touch, and pickup events without delay or interrupts.

* [Documentation](http://robotsbigdata.com/docs-arduino-human-sensor.html)
* [Download Library](https://github.com/alextaujenis/RBD_HumanSensor/raw/master/extras/RBD_HumanSensor.zip)
Expand Down
4 changes: 2 additions & 2 deletions examples/read_human_sensor/read_human_sensor.ino
@@ -1,4 +1,4 @@
// Arduino RBD Human Sensor Library v1.0.2 Example - Calibrate a human sensor.
// Arduino RBD Human Sensor Library v1.0.3 Example - Calibrate a human sensor.
// https://github.com/alextaujenis/RBD_HumanSensor
// Copyright 2015 Alex Taujenis
// MIT License
Expand All @@ -7,7 +7,7 @@
#include <RBD_Threshold.h> // https://github.com/alextaujenis/RBD_Threshold
#include <RBD_HumanSensor.h> // https://github.com/alextaujenis/RBD_HumanSensor

RBD::HumanSensor human_sensor(1, 0); // send, receive
RBD::HumanSensor human_sensor(2, 3); // send, receive pin

void setup() {
Serial.begin(115200);
Expand Down
Binary file modified extras/RBD_HumanSensor.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions library.properties
@@ -1,9 +1,9 @@
name=RBD_HumanSensor
version=1.0.2
version=1.0.3
author=Alex Taujenis <alex.taujenis@gmail.com>
maintainer=Alex Taujenis <alex.taujenis@gmail.com>
sentence=Detect human presence, touch, and pickup events.
paragraph=Measure change in capacitance to detect human presence, touch, and pickup events without delay.
paragraph=Measure change in capacitance to detect human presence, touch, and pickup events without delay or interrupts.
category=Sensors
url=https://github.com/alextaujenis/RBD_HumanSensor
architectures=avr
12 changes: 4 additions & 8 deletions src/RBD_HumanSensor.cpp
@@ -1,4 +1,4 @@
// Arduino RBD Human Sensor Library v1.0.2 - Detect human presence, touch, and pickup events.
// Arduino RBD Human Sensor Library v1.0.3 - Detect human presence, touch, and pickup events.
// https://github.com/alextaujenis/RBD_HumanSensor
// Copyright 2015 Alex Taujenis
// MIT License
Expand Down Expand Up @@ -174,13 +174,11 @@ namespace RBD {
}

int HumanSensor::getActiveLevel() {
// this function memoizes the level so it's only computed when the raw value or modifier changes
// get the current (modifed raw) value
_temp_value = getValue();

// check if it has changed
// memoize the level, only recompute on change
if (_temp_value != _temp_prev_value) {
// save a new level if it has changed
// save a new level
_temp_level = _threshold.computeLevel(_temp_value);
// store the old value
_temp_prev_value = _temp_value;
Expand All @@ -198,6 +196,4 @@ namespace RBD {
_has_been_touch = false;
_has_been_pickup = false;
}
}


}
2 changes: 1 addition & 1 deletion src/RBD_HumanSensor.h
@@ -1,4 +1,4 @@
// Arduino RBD Human Sensor Library v1.0.2 - Detect human presence, touch, and pickup events.
// Arduino RBD Human Sensor Library v1.0.3 - Detect human presence, touch, and pickup events.
// https://github.com/alextaujenis/RBD_HumanSensor
// Copyright 2015 Alex Taujenis
// MIT License
Expand Down

0 comments on commit 66775b9

Please sign in to comment.