Merge branch 'master' into development

This commit is contained in:
Theo Arends 2018-12-16 16:22:04 +01:00
commit cb0b5f6eab
19 changed files with 1086 additions and 4564 deletions

2489
Doxyfile

File diff suppressed because it is too large Load Diff

View File

@ -128,6 +128,7 @@ Libraries used with Sonoff-Tasmota are:
- [arduino mqtt](https://github.com/256dpi/arduino-mqtt)
- [Bosch BME680](https://github.com/BoschSensortec/BME680_driver)
- [C2 Programmer](http://app.cear.ufpb.br/~lucas.hartmann/tag/efm8bb1/)
- [esp-epaper-29-ws-20171230-gemu](https://github.com/gemu2015/Sonoff-Tasmota/tree/displays/lib)
- [esp-knx-ip](https://github.com/envy/esp-knx-ip)
- [I2Cdevlib](https://github.com/jrowberg/i2cdevlib)
- [IRremoteEsp8266](https://github.com/markszabo/IRremoteESP8266)
@ -135,10 +136,10 @@ Libraries used with Sonoff-Tasmota are:
- [Liquid Cristal](https://github.com/marcoschwartz/LiquidCrystal_I2C)
- [MultiChannelGasSensor](http://wiki.seeedstudio.com/Grove-Multichannel_Gas_Sensor/)
- [NeoPixelBus](https://github.com/Makuna/NeoPixelBus)
- [NewPing](https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home)
- [OneWire](https://github.com/PaulStoffregen/OneWire)
- [PubSubClient](https://github.com/knolleary/pubsubclient)
- [rc-switch](https://github.com/sui77/rc-switch)
- [NewPing](https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home)
#### People inspiring me
People helping to keep the show on the road:

View File

@ -81,9 +81,10 @@ Module | Description
57 SK03 Outdoor | SK03 Outdoor Wifi Smart Switch with Energy Monitoring
58 PS-16-DZ | PS-16-DZ Wifi dimmer for Incandescent Lights and Led
59 Teckin US | Teckin US and ZooZee SA102 Wifi Smart Switch with Energy Monitoring
60 Manzoku strip | Manzoku Wifi Smart Power Strip with four Relays
## Provided Binary Downloads
The following binary downloads have been compiled with ESP8266/Arduino library version **2.3.0**
The following binary downloads have been compiled with ESP8266/Arduino library core version **2.4.2** patched with the Alexa fix.
- **sonoff-minimal.bin** = The Minimal version allows intermediate OTA uploads to support larger versions and does NOT change any persistent parameter. This version **should NOT be used for initial installation**.
- **sonoff-classic.bin** = The Classic version allows **initial installation** using either WifiManager, Wps or SmartConfig.
@ -93,14 +94,12 @@ The following binary downloads have been compiled with ESP8266/Arduino library v
- **sonoff-display.bin** = The Display version without Wps and SmartConfig configuration but adds display support.
- **sonoff-knx.bin** = The Knx version without Wps and SmartConfig configuration and some other features but adds KNX support.
See [Tasmota ESP/Arduino library version related issues](https://github.com/arendst/Sonoff-Tasmota/wiki/Theo's-Tasmota-Tips#20180523---relation-tasmota-and-esp8266arduino-core-version) why these files are still released using ESP/Arduino library version v2.3.0.
### Available Features and Sensors
| Feature or Sensor | minimal | basic | classic | sonoff | knx | sensors | Remarks
|--------------------------------|---------|-------|---------|--------|------|---------|--------
| ESP/Arduino lib v2.3.0 | 343k | 425k | 484k | 490k | 508k | 517k |
| ESP/Arduino lib v2.4.2 | 372k | 451k | 497k | 517k | 533k | 541k | No sleep
| ESP/Arduino lib v2.3.0 | 346k | 429k | 482k | 504k | 522k | 535k |
| ESP/Arduino lib v2.4.2 | 366k | 446k | 496k | 522k | 538k | 551k | No wifi sleep
| | | | | | | |
| MY_LANGUAGE en-GB | x | x | x | x | x | x |
| MQTT_LIBRARY_TYPE PUBSUBCLIENT | x | x | x | x | x | x |
@ -108,7 +107,7 @@ See [Tasmota ESP/Arduino library version related issues](https://github.com/aren
| USE_SMARTCONFIG | - | - | x | - | - | - | SmartConfig
| USE_ARDUINO_OTA | - | - | - | - | - | - |
| USE_DOMOTICZ | - | - | x | x | x | x |
| USE_HOME_ASSISTANT | - | - | x | x | x | x |
| USE_HOME_ASSISTANT | - | - | - | x | x | x |
| USE_MQTT_TLS | - | - | - | - | - | - |
| USE_KNX | - | - | - | - | x | - |
| USE_WEBSERVER | x | x | x | x | x | x | WifiManager
@ -150,6 +149,7 @@ See [Tasmota ESP/Arduino library version related issues](https://github.com/aren
| USE_CCS811 | - | - | - | - | - | - |
| USE_MPU6050 | - | - | - | - | - | - |
| USE_DS3231 | - | - | - | - | - | - |
| USE_MGC3130 | - | - | - | - | - | - |
| | | | | | | |
| Feature or Sensor | minimal | basic | classic | sonoff | knx | sensors |
| USE_SPI | - | - | - | - | - | - |
@ -166,6 +166,8 @@ See [Tasmota ESP/Arduino library version related issues](https://github.com/aren
| USE_SDM630 | - | - | - | - | - | x |
| USE_MP3_PLAYER | - | - | - | - | - | x |
| USE_TUYA_DIMMER | - | x | - | x | x | x |
| USE_ARMTRONIX_DIMMERS | - | x | - | x | x | x |
| USE_PS_16_DZ | - | x | - | x | x | x |
| USE_IR_REMOTE | - | - | - | x | x | x |
| USE_IR_HVAC | - | - | - | - | - | x |
| USE_IR_RECEIVE | - | - | - | x | x | x |
@ -178,94 +180,67 @@ See [Tasmota ESP/Arduino library version related issues](https://github.com/aren
| USE_RF_FLASH | - | - | - | x | x | x |
| USE_TX20_WIND_SENSOR | - | - | - | x | x | x |
| USE_RC_SWITCH | - | - | - | x | x | x |
| USE_RF_SENSOR | - | - | - | - | - | x | AlectoV2 only
| USE_DISPLAY | - | - | - | - | - | - |
## Changelog
Version 6.3.0 20181030
* Change web Configure Module GPIO drop down list order for better readability
* Change status JSON message providing more switch and retain information
* Change xsns_17_senseair.ino to use TasmotaModbus library
* Change MCP230xx driver
* Change PubSubClient Mqtt library to non-blocking EspEasy version
* Change energy monitoring using energy sensor driver modules
* Change Webserver page handler for easier extension (thx to Adrian Scillato)
* Change pinmode for no-pullup defined switches to pullup when configured as switchmode PUSHBUTTON (=3 and up) (#3896)
* Change default OTA Url to http://thehackbox.org/tasmota/release/sonoff.bin (#4170)
* Remove support for MQTT Client esp-mqtt-arduino by #define MQTT_LIBRARY_TYPE MQTT_ESPMQTTARDUINO
* Remove commands PowerCal, VoltageCal and CurrentCal as more functionality is provided by commands PowerSet, VoltageSet and CurrentSet
* Remove restart after ntpserver change and force NTP re-sync (#3890)
* Fix showing Period Power in energy threshold messages
* Fix header file execution order by renaming user_config.h to my_user_config.h
* Fix some TSL2561 driver issues (#3681)
* Fix KNX PA exception. Regression from 6.2.1 buffer overflow caused by subStr() (#3700, #3710)
* Fix setting and getting color temperature for Philips Hue emulation (#3733)
* Fix ButtonRetain to not use default topic for clearing retain messages (#3737)
* Fix syslog when emulation is selected (#2109, #3784)
* Fix rule trigger POWER1#STATE execution after restart and SetOption0 is 0 (#3856)
* Fix Home Assistant forced light discovery (#3908)
* Fix invalid configuration restores and decode_config.py crc error when savedata = 0 (#3918)
* Fix timer offset -00:00 causing 12:00 hour offset (#3923)
* Fix I2CScan invalid JSON error message (#3925)
* Fix exception when wrong Domoticz JSON message is received (#3963)
* Fix Sonoff Bridge RfRaw receive (#4080, #4085)
* Fix possible wifi connection error (#4044, #4083)
* Fix invalid JSON floating point result from nan (Not a Number) and inf (Infinity) into null (#4147)
* Fix rule mqtt#connected trigger when mqtt is disabled (#4149)
* Add support for LCD, Matrix, TFT and Oled displays
* Add support for Neo Coolcam Wifi Smart Power Plug
* Add support for Michael Haustein ESP Switch
* Add support for MQTT Client based on lwmqtt to be selected by #define MQTT_LIBRARY_TYPE MQTT_ARDUINOMQTT
* Add support for Neo Coolcam Wifi Smart Power Plug
* Add support for Michael Haustein ESP Switch
* Add support for MQTT Client based on lwmqtt to be selected by #define MQTT_LIBRARY_TYPE MQTT_ARDUINOMQTT
* Add support for DS3231 Real Time Clock
* Add support for HX711 Load Cell with optional web GUI scale interface to demonstrate easy GUI plug-in
* Add support for serial 8N2 communication to TasmotaModbus and TasmotaSerial libraries
* Add support for RF transceiving using library RcSwitch (#2702)
* Add support for Shelly 1 and Shelly 2 (#2789)
* Add support for La Crosse TX20 Anemometer (#2654, #3146)
* Add support for MP3 player using DFRobot RB-DFR-562 (#3723)
* Add Support for Xiaomi-Philips Bulbs (#3787)
* Add support for PCA9685 12bit 16pin hardware PWM driver (#3866)
* Add support for EXS Relay V5.0 (#3810)
* Add support for OBI Power Socket (#1988, #3944)
* Add support for Teckin Power Socket with Energy Monitoring (#3950)
* Add support for Pzem-003/017 DC Energy monitoring module (#3694)
* Add support for Pzem-014/016 AC Energy monitoring module (#3694)
* Add support for CSL Aplic WDP 303075 Power Socket with Energy Monitoring (#3991, #3996)
* Add support for Tuya Dimmer (#469, #4075)
* Add command Display to show all settings at once
* Add command SerialSend5 to send raw serial data like "A5074100545293"
* Add command WebRefresh 1000..10000 to control web page refresh in milliseconds. Default is 2345
* Add command WeightRes 0..3 to control display of decimals for kilogram
* Add command RGBWWTable to support color calibration (#3933)
* Add command Reset 4 (reset to defaults but keep wifi params) and Reset 5 (as reset 4 and also erase flash) (#4061)
* Add command SetOption35 0..255 (seconds) to delay mDNS initialization to control possible Wifi connect problems
* Add command SetOption52 0/1 to control display of optional time offset from UTC in JSON messages (#3629, #3711)
* Add command SetOption53 0/1 to toggle gui display of Hostname and IP address (#1006, #2091)
* Add authentication to HTTP web pages
* Add decimals as input to commands PowerSet, VoltageSet and CurrentSet
* Add tools/decode-config.py by Norbert Richter to decode configuration data. See file for information
* Add define USE_DISPLAYS for selecting image sonoff-display
* Add define USE_BASIC for selecting image sonoff-basic without most sensors
* Add auto reload of main web page to some web restarts
* Add TasmotaModbus library as very basic modbus wrapper for TasmotaSerial
* Add more API callbacks and document API.md
* Add Apparent Power and Reactive Power to Energy Monitoring devices (#251)
* Add token %hostname% to command FullTopic (#3018)
* Add Wifi channel number to state message (#3664)
* Add user configurable GPIO02 and GPIO03 on H801 devices (#3692)
* Add toggle function RGBW lights (#3695, #3697)
* Add network information to display start screen (#3704)
* Add sleep to Nova Fitness SDS01X sensor (#2841, #3724, #3749)
* Add Analog input AD0 enabled to sonoff-sensors.bin (#3756, #3757)
* Add power value below 5W to Sonoff Pow R2 and S31 (#3745)
* Add RF Receiver control to module MagicHome to be used on Arilux LC10 (#3792)
* Add userid/password option to decode-status.py (#3796)
* Add delay after restart before processing rule sensor data (#3811)
* Add force_update to Home Assistant discovery (#3873)
* Add rule triggers SWITCH1#BOOT and POWER1#BOOT (#3904, #3910)
* Add Hebrew language file (#3960)
* Add TotalStartTime to Energy JSON message (#3971)
* Add whitespace removal from RfRaw and SerialSend5 (#4020)
* Add support for two BMP/BME sensors (#4195)
Version 6.4.0 20181217
* Change GUI Configure Module by using AJAX for data fetch to cut page size (and memory use) by 40%.
In case of web page errors clear your browser cache or do Page Reload (F5 or Ctrl+R)
* Change enforcing flashmode dout but it is still mandatory
* Change bootcount update (being first) flash write to 10 seconds after restart
* Change display and epaper drivers
* Change command WebSend Host header field from IP address to hostname (#4331)
* Change log buffer size from 512 to 520 to accommodate http sensor data (#4354)
* Change default WIFI_CONFIG_TOOL from WIFI_WAIT to WIFI_RETRY in my_user_config.h (#4400)
* Change webgui refresh time delay for Save Settings and local OTA Upload (#4423)
* Change SR-04 driver to use NewPing library (#4488)
* Change MCP230xx driver to support interrupt retention over teleperiod (#4547)
* Change support for MPU6050 using DMP (#4581)
* Fix unintended function overload of WifiState
* Fix wifi connection errors using wifi disconnect and ESP.reset instead of ESP.restart
* Fix Sonoff Pow R2 and Sonoff S31 Serial interface hang caused by Sonoff Basic R2 driver delay implementation (and possibly core bug)
* Fix MQTT connection error after restart
* Fix wifi re-scan connection baseline
* Fix possible strncat buffer overflows
* Fix intermittent Pzem sensor energy overflow calculation error
* Fix shelly2 ghost switching caused by lack of pull-up inputs (#4255)
* Fix hardware serial pin configuration. To keep using hardware serial swap current Rx/Tx pin configuration only (#4280)
* Fix MqttRetry values above 255 seconds (#4424)
* Fix WifiManager functionality on initial installation (#4433)
* Fix ArduinoOTA for Core 2.5.0 (#4620)
* Add minutes to commands Timezone to allow all possible world timezones
* Add more strict checks for GPIO selections
* Add code image and optional commit number to version
* Add dynamic delay to main loop providing time for wifi background tasks
* Add additional start-up delay during initial wifi connection
* Add support for decoding Theo V2 sensors as documented on https://sidweb.nl using 434MHz RF sensor receiver
* Add support for decoding Alecto V2 sensors like ACH2010, WS3000 and DKW2012 weather stations using 868MHz RF sensor receiver
* Add user definition of defines WIFI_RSSI_THRESHOLD (default 10) and WIFI_RESCAN_MINUTES (default 44)
* Add command SetOption58 0/1 to enable IR raw data info in JSON message (#2116)
* Add command IRSend \<frequency\>|0,\<rawdata1\>,\<rawdata2\>,.. to allow raw data transmission (#2116)
* Add command SetOption56 0/1 to enable wifi network scan and select highest RSSI (#3173)
* Add command SetOption57 0/1 to enable wifi network re-scan every 44 minutes with a rssi threshold of 10 to select highest RSSI (#3173)
* Add support for SDM220 (#3610)
* Add default sleep 1 to sonoff-basic to lower energy consumption (#4217)
* Add wifi status to Tuya (#4221)
* Add delays to reduce CPU usage at boot time (#4233)
* Add command SetOption24 0/1 to select pressure unit as hPa or mmHg (#4241)
* Add optional hardware serial when GPIO13(Rx) and GPIO15(Tx) are selected removing hardware serial from GPIO01(Tx) and GPIO03(Rx) (#4288)
* Add support for Gosund SP1 v2.3 Power Socket with Energy Monitoring (#4297)
* Add support for Armtronix dimmers. See wiki for info (#4321)
* Add to command WebSend option to send a direct path when command starts with a slash (#4329)
* Add support for LG HVac and IrRemote (#4377)
* Add initial support for Hass sensor discovery (#4380)
* Add support for Fujitsu HVac and IrRemote (#4387)
* Add support for I2C MGC3130 Electric Field Effect sensor by Christian Baars (#3774, #4404)
* Add command CalcRes to set number of decimals (0 - 7) used in commands ADD, SUB, MULT and SCALE (#4420)
* Add CPU average load to state message (#4431)
* Add command SetOption59 0/1 to change state topic from tele/STATE to stat/RESULT (#4450)
* Add support for SM Smart Wifi Dimmer PS-16-DZ (#4465)
* Add support for Teckin US Power Socket with Energy Monitoring (#4481)
* Add command SetOption60 0/1 to select dynamic sleep (0) or sleep (1) (#4497)
* Add support for iFan02 Fanspeed in Domoticz using a selector (#4517)
* Add support for GPIO02 for newer Sonoff Basic (#4518)
* Add Announce Switches to MQTT Discovery (#4531)
* Add support for Manzoku Power Strip (#4590)

View File

@ -1,3 +1,3 @@
# NewPing Arduino Library for Arduino
## See the [NewPing Wiki](https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home) for documentation
# NewPing Arduino Library for Arduino
## See the [NewPing Wiki](https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home) for documentation

View File

@ -1,78 +1,78 @@
// ---------------------------------------------------------------------------
// Before attempting to use this sketch, please read the "Help with 15 Sensors Example Sketch":
// https://bitbucket.org/teckel12/arduino-new-ping/wiki/Help%20with%2015%20Sensors%20Example%20Sketch
//
// This example code was used to successfully communicate with 15 ultrasonic sensors. You can adjust
// the number of sensors in your project by changing SONAR_NUM and the number of NewPing objects in the
// "sonar" array. You also need to change the pins for each sensor for the NewPing objects. Each sensor
// is pinged at 33ms intervals. So, one cycle of all sensors takes 495ms (33 * 15 = 495ms). The results
// are sent to the "oneSensorCycle" function which currently just displays the distance data. Your project
// would normally process the sensor results in this function (for example, decide if a robot needs to
// turn and call the turn function). Keep in mind this example is event-driven. Your complete sketch needs
// to be written so there's no "delay" commands and the loop() cycles at faster than a 33ms rate. If other
// processes take longer than 33ms, you'll need to increase PING_INTERVAL so it doesn't get behind.
// ---------------------------------------------------------------------------
#include <NewPing.h>
#define SONAR_NUM 15 // Number of sensors.
#define MAX_DISTANCE 200 // Maximum distance (in cm) to ping.
#define PING_INTERVAL 33 // Milliseconds between sensor pings (29ms is about the min to avoid cross-sensor echo).
unsigned long pingTimer[SONAR_NUM]; // Holds the times when the next ping should happen for each sensor.
unsigned int cm[SONAR_NUM]; // Where the ping distances are stored.
uint8_t currentSensor = 0; // Keeps track of which sensor is active.
NewPing sonar[SONAR_NUM] = { // Sensor object array.
NewPing(41, 42, MAX_DISTANCE), // Each sensor's trigger pin, echo pin, and max distance to ping.
NewPing(43, 44, MAX_DISTANCE),
NewPing(45, 20, MAX_DISTANCE),
NewPing(21, 22, MAX_DISTANCE),
NewPing(23, 24, MAX_DISTANCE),
NewPing(25, 26, MAX_DISTANCE),
NewPing(27, 28, MAX_DISTANCE),
NewPing(29, 30, MAX_DISTANCE),
NewPing(31, 32, MAX_DISTANCE),
NewPing(34, 33, MAX_DISTANCE),
NewPing(35, 36, MAX_DISTANCE),
NewPing(37, 38, MAX_DISTANCE),
NewPing(39, 40, MAX_DISTANCE),
NewPing(50, 51, MAX_DISTANCE),
NewPing(52, 53, MAX_DISTANCE)
};
void setup() {
Serial.begin(115200);
pingTimer[0] = millis() + 75; // First ping starts at 75ms, gives time for the Arduino to chill before starting.
for (uint8_t i = 1; i < SONAR_NUM; i++) // Set the starting time for each sensor.
pingTimer[i] = pingTimer[i - 1] + PING_INTERVAL;
}
void loop() {
for (uint8_t i = 0; i < SONAR_NUM; i++) { // Loop through all the sensors.
if (millis() >= pingTimer[i]) { // Is it this sensor's time to ping?
pingTimer[i] += PING_INTERVAL * SONAR_NUM; // Set next time this sensor will be pinged.
if (i == 0 && currentSensor == SONAR_NUM - 1) oneSensorCycle(); // Sensor ping cycle complete, do something with the results.
sonar[currentSensor].timer_stop(); // Make sure previous timer is canceled before starting a new ping (insurance).
currentSensor = i; // Sensor being accessed.
cm[currentSensor] = 0; // Make distance zero in case there's no ping echo for this sensor.
sonar[currentSensor].ping_timer(echoCheck); // Do the ping (processing continues, interrupt will call echoCheck to look for echo).
}
}
// Other code that *DOESN'T* analyze ping results can go here.
}
void echoCheck() { // If ping received, set the sensor distance to array.
if (sonar[currentSensor].check_timer())
cm[currentSensor] = sonar[currentSensor].ping_result / US_ROUNDTRIP_CM;
}
void oneSensorCycle() { // Sensor ping cycle complete, do something with the results.
// The following code would be replaced with your code that does something with the ping results.
for (uint8_t i = 0; i < SONAR_NUM; i++) {
Serial.print(i);
Serial.print("=");
Serial.print(cm[i]);
Serial.print("cm ");
}
Serial.println();
}
// ---------------------------------------------------------------------------
// Before attempting to use this sketch, please read the "Help with 15 Sensors Example Sketch":
// https://bitbucket.org/teckel12/arduino-new-ping/wiki/Help%20with%2015%20Sensors%20Example%20Sketch
//
// This example code was used to successfully communicate with 15 ultrasonic sensors. You can adjust
// the number of sensors in your project by changing SONAR_NUM and the number of NewPing objects in the
// "sonar" array. You also need to change the pins for each sensor for the NewPing objects. Each sensor
// is pinged at 33ms intervals. So, one cycle of all sensors takes 495ms (33 * 15 = 495ms). The results
// are sent to the "oneSensorCycle" function which currently just displays the distance data. Your project
// would normally process the sensor results in this function (for example, decide if a robot needs to
// turn and call the turn function). Keep in mind this example is event-driven. Your complete sketch needs
// to be written so there's no "delay" commands and the loop() cycles at faster than a 33ms rate. If other
// processes take longer than 33ms, you'll need to increase PING_INTERVAL so it doesn't get behind.
// ---------------------------------------------------------------------------
#include <NewPing.h>
#define SONAR_NUM 15 // Number of sensors.
#define MAX_DISTANCE 200 // Maximum distance (in cm) to ping.
#define PING_INTERVAL 33 // Milliseconds between sensor pings (29ms is about the min to avoid cross-sensor echo).
unsigned long pingTimer[SONAR_NUM]; // Holds the times when the next ping should happen for each sensor.
unsigned int cm[SONAR_NUM]; // Where the ping distances are stored.
uint8_t currentSensor = 0; // Keeps track of which sensor is active.
NewPing sonar[SONAR_NUM] = { // Sensor object array.
NewPing(41, 42, MAX_DISTANCE), // Each sensor's trigger pin, echo pin, and max distance to ping.
NewPing(43, 44, MAX_DISTANCE),
NewPing(45, 20, MAX_DISTANCE),
NewPing(21, 22, MAX_DISTANCE),
NewPing(23, 24, MAX_DISTANCE),
NewPing(25, 26, MAX_DISTANCE),
NewPing(27, 28, MAX_DISTANCE),
NewPing(29, 30, MAX_DISTANCE),
NewPing(31, 32, MAX_DISTANCE),
NewPing(34, 33, MAX_DISTANCE),
NewPing(35, 36, MAX_DISTANCE),
NewPing(37, 38, MAX_DISTANCE),
NewPing(39, 40, MAX_DISTANCE),
NewPing(50, 51, MAX_DISTANCE),
NewPing(52, 53, MAX_DISTANCE)
};
void setup() {
Serial.begin(115200);
pingTimer[0] = millis() + 75; // First ping starts at 75ms, gives time for the Arduino to chill before starting.
for (uint8_t i = 1; i < SONAR_NUM; i++) // Set the starting time for each sensor.
pingTimer[i] = pingTimer[i - 1] + PING_INTERVAL;
}
void loop() {
for (uint8_t i = 0; i < SONAR_NUM; i++) { // Loop through all the sensors.
if (millis() >= pingTimer[i]) { // Is it this sensor's time to ping?
pingTimer[i] += PING_INTERVAL * SONAR_NUM; // Set next time this sensor will be pinged.
if (i == 0 && currentSensor == SONAR_NUM - 1) oneSensorCycle(); // Sensor ping cycle complete, do something with the results.
sonar[currentSensor].timer_stop(); // Make sure previous timer is canceled before starting a new ping (insurance).
currentSensor = i; // Sensor being accessed.
cm[currentSensor] = 0; // Make distance zero in case there's no ping echo for this sensor.
sonar[currentSensor].ping_timer(echoCheck); // Do the ping (processing continues, interrupt will call echoCheck to look for echo).
}
}
// Other code that *DOESN'T* analyze ping results can go here.
}
void echoCheck() { // If ping received, set the sensor distance to array.
if (sonar[currentSensor].check_timer())
cm[currentSensor] = sonar[currentSensor].ping_result / US_ROUNDTRIP_CM;
}
void oneSensorCycle() { // Sensor ping cycle complete, do something with the results.
// The following code would be replaced with your code that does something with the ping results.
for (uint8_t i = 0; i < SONAR_NUM; i++) {
Serial.print(i);
Serial.print("=");
Serial.print(cm[i]);
Serial.print("cm ");
}
Serial.println();
}

View File

@ -1,29 +1,29 @@
// ---------------------------------------------------------------------------
// Example NewPing library sketch that pings 3 sensors 20 times a second.
// ---------------------------------------------------------------------------
#include <NewPing.h>
#define SONAR_NUM 3 // Number of sensors.
#define MAX_DISTANCE 200 // Maximum distance (in cm) to ping.
NewPing sonar[SONAR_NUM] = { // Sensor object array.
NewPing(4, 5, MAX_DISTANCE), // Each sensor's trigger pin, echo pin, and max distance to ping.
NewPing(6, 7, MAX_DISTANCE),
NewPing(8, 9, MAX_DISTANCE)
};
void setup() {
Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
}
void loop() {
for (uint8_t i = 0; i < SONAR_NUM; i++) { // Loop through each sensor and display results.
delay(50); // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
Serial.print(i);
Serial.print("=");
Serial.print(sonar[i].ping_cm());
Serial.print("cm ");
}
Serial.println();
}
// ---------------------------------------------------------------------------
// Example NewPing library sketch that pings 3 sensors 20 times a second.
// ---------------------------------------------------------------------------
#include <NewPing.h>
#define SONAR_NUM 3 // Number of sensors.
#define MAX_DISTANCE 200 // Maximum distance (in cm) to ping.
NewPing sonar[SONAR_NUM] = { // Sensor object array.
NewPing(4, 5, MAX_DISTANCE), // Each sensor's trigger pin, echo pin, and max distance to ping.
NewPing(6, 7, MAX_DISTANCE),
NewPing(8, 9, MAX_DISTANCE)
};
void setup() {
Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
}
void loop() {
for (uint8_t i = 0; i < SONAR_NUM; i++) { // Loop through each sensor and display results.
delay(50); // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
Serial.print(i);
Serial.print("=");
Serial.print(sonar[i].ping_cm());
Serial.print("cm ");
}
Serial.println();
}

View File

@ -1,60 +1,60 @@
// ---------------------------------------------------------------------------
// Calculate a ping median using the ping_timer() method.
// ---------------------------------------------------------------------------
#include <NewPing.h>
#define ITERATIONS 5 // Number of iterations.
#define TRIGGER_PIN 12 // Arduino pin tied to trigger pin on ping sensor.
#define ECHO_PIN 11 // Arduino pin tied to echo pin on ping sensor.
#define MAX_DISTANCE 200 // Maximum distance (in cm) to ping.
#define PING_INTERVAL 33 // Milliseconds between sensor pings (29ms is about the min to avoid cross-sensor echo).
unsigned long pingTimer[ITERATIONS]; // Holds the times when the next ping should happen for each iteration.
unsigned int cm[ITERATIONS]; // Where the ping distances are stored.
uint8_t currentIteration = 0; // Keeps track of iteration step.
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
void setup() {
Serial.begin(115200);
pingTimer[0] = millis() + 75; // First ping starts at 75ms, gives time for the Arduino to chill before starting.
for (uint8_t i = 1; i < ITERATIONS; i++) // Set the starting time for each iteration.
pingTimer[i] = pingTimer[i - 1] + PING_INTERVAL;
}
void loop() {
for (uint8_t i = 0; i < ITERATIONS; i++) { // Loop through all the iterations.
if (millis() >= pingTimer[i]) { // Is it this iteration's time to ping?
pingTimer[i] += PING_INTERVAL * ITERATIONS; // Set next time this sensor will be pinged.
if (i == 0 && currentIteration == ITERATIONS - 1) oneSensorCycle(); // Sensor ping cycle complete, do something with the results.
sonar.timer_stop(); // Make sure previous timer is canceled before starting a new ping (insurance).
currentIteration = i; // Sensor being accessed.
cm[currentIteration] = 0; // Make distance zero in case there's no ping echo for this iteration.
sonar.ping_timer(echoCheck); // Do the ping (processing continues, interrupt will call echoCheck to look for echo).
}
}
// Other code that *DOESN'T* analyze ping results can go here.
}
void echoCheck() { // If ping received, set the sensor distance to array.
if (sonar.check_timer())
cm[currentIteration] = sonar.ping_result / US_ROUNDTRIP_CM;
}
void oneSensorCycle() { // All iterations complete, calculate the median.
unsigned int uS[ITERATIONS];
uint8_t j, it = ITERATIONS;
uS[0] = NO_ECHO;
for (uint8_t i = 0; i < it; i++) { // Loop through iteration results.
if (cm[i] != NO_ECHO) { // Ping in range, include as part of median.
if (i > 0) { // Don't start sort till second ping.
for (j = i; j > 0 && uS[j - 1] < cm[i]; j--) // Insertion sort loop.
uS[j] = uS[j - 1]; // Shift ping array to correct position for sort insertion.
} else j = 0; // First ping is sort starting point.
uS[j] = cm[i]; // Add last ping to array in sorted position.
} else it--; // Ping out of range, skip and don't include as part of median.
}
Serial.print(uS[it >> 1]);
Serial.println("cm");
}
// ---------------------------------------------------------------------------
// Calculate a ping median using the ping_timer() method.
// ---------------------------------------------------------------------------
#include <NewPing.h>
#define ITERATIONS 5 // Number of iterations.
#define TRIGGER_PIN 12 // Arduino pin tied to trigger pin on ping sensor.
#define ECHO_PIN 11 // Arduino pin tied to echo pin on ping sensor.
#define MAX_DISTANCE 200 // Maximum distance (in cm) to ping.
#define PING_INTERVAL 33 // Milliseconds between sensor pings (29ms is about the min to avoid cross-sensor echo).
unsigned long pingTimer[ITERATIONS]; // Holds the times when the next ping should happen for each iteration.
unsigned int cm[ITERATIONS]; // Where the ping distances are stored.
uint8_t currentIteration = 0; // Keeps track of iteration step.
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
void setup() {
Serial.begin(115200);
pingTimer[0] = millis() + 75; // First ping starts at 75ms, gives time for the Arduino to chill before starting.
for (uint8_t i = 1; i < ITERATIONS; i++) // Set the starting time for each iteration.
pingTimer[i] = pingTimer[i - 1] + PING_INTERVAL;
}
void loop() {
for (uint8_t i = 0; i < ITERATIONS; i++) { // Loop through all the iterations.
if (millis() >= pingTimer[i]) { // Is it this iteration's time to ping?
pingTimer[i] += PING_INTERVAL * ITERATIONS; // Set next time this sensor will be pinged.
if (i == 0 && currentIteration == ITERATIONS - 1) oneSensorCycle(); // Sensor ping cycle complete, do something with the results.
sonar.timer_stop(); // Make sure previous timer is canceled before starting a new ping (insurance).
currentIteration = i; // Sensor being accessed.
cm[currentIteration] = 0; // Make distance zero in case there's no ping echo for this iteration.
sonar.ping_timer(echoCheck); // Do the ping (processing continues, interrupt will call echoCheck to look for echo).
}
}
// Other code that *DOESN'T* analyze ping results can go here.
}
void echoCheck() { // If ping received, set the sensor distance to array.
if (sonar.check_timer())
cm[currentIteration] = sonar.ping_result / US_ROUNDTRIP_CM;
}
void oneSensorCycle() { // All iterations complete, calculate the median.
unsigned int uS[ITERATIONS];
uint8_t j, it = ITERATIONS;
uS[0] = NO_ECHO;
for (uint8_t i = 0; i < it; i++) { // Loop through iteration results.
if (cm[i] != NO_ECHO) { // Ping in range, include as part of median.
if (i > 0) { // Don't start sort till second ping.
for (j = i; j > 0 && uS[j - 1] < cm[i]; j--) // Insertion sort loop.
uS[j] = uS[j - 1]; // Shift ping array to correct position for sort insertion.
} else j = 0; // First ping is sort starting point.
uS[j] = cm[i]; // Add last ping to array in sorted position.
} else it--; // Ping out of range, skip and don't include as part of median.
}
Serial.print(uS[it >> 1]);
Serial.println("cm");
}

View File

@ -1,25 +1,25 @@
// ---------------------------------------------------------------------------
// While the NewPing library's primary goal is to interface with ultrasonic sensors, interfacing with
// the Timer2 interrupt was a result of creating an interrupt-based ping method. Since these Timer2
// interrupt methods were built, the library may as well provide the functionality to use these methods
// in your sketches. This shows how simple it is (no ultrasonic sensor required). Keep in mind that
// these methods use Timer2, as does NewPing's ping_timer method for using ultrasonic sensors. You
// can't use ping_timer at the same time you're using timer_ms or timer_us as all use the same timer.
// ---------------------------------------------------------------------------
#include <NewPing.h>
#define LED_PIN 13 // Pin with LED attached.
void setup() {
pinMode(LED_PIN, OUTPUT);
NewPing::timer_ms(500, toggleLED); // Create a Timer2 interrupt that calls toggleLED in your sketch once every 500 milliseconds.
}
void loop() {
// Do anything here, the Timer2 interrupt will take care of the flashing LED without your intervention.
}
void toggleLED() {
digitalWrite(LED_PIN, !digitalRead(LED_PIN)); // Toggle the LED.
}
// ---------------------------------------------------------------------------
// While the NewPing library's primary goal is to interface with ultrasonic sensors, interfacing with
// the Timer2 interrupt was a result of creating an interrupt-based ping method. Since these Timer2
// interrupt methods were built, the library may as well provide the functionality to use these methods
// in your sketches. This shows how simple it is (no ultrasonic sensor required). Keep in mind that
// these methods use Timer2, as does NewPing's ping_timer method for using ultrasonic sensors. You
// can't use ping_timer at the same time you're using timer_ms or timer_us as all use the same timer.
// ---------------------------------------------------------------------------
#include <NewPing.h>
#define LED_PIN 13 // Pin with LED attached.
void setup() {
pinMode(LED_PIN, OUTPUT);
NewPing::timer_ms(500, toggleLED); // Create a Timer2 interrupt that calls toggleLED in your sketch once every 500 milliseconds.
}
void loop() {
// Do anything here, the Timer2 interrupt will take care of the flashing LED without your intervention.
}
void toggleLED() {
digitalWrite(LED_PIN, !digitalRead(LED_PIN)); // Toggle the LED.
}

View File

@ -1,31 +1,30 @@
###################################
# Syntax Coloring Map For NewPing
###################################
###################################
# Datatypes (KEYWORD1)
###################################
NewPing KEYWORD1
###################################
# Methods and Functions (KEYWORD2)
###################################
ping KEYWORD2
ping_in KEYWORD2
ping_cm KEYWORD2
ping_median KEYWORD2
ping_timer KEYWORD2
check_timer KEYWORD2
ping_result KEYWORD2
timer_us KEYWORD2
timer_ms KEYWORD2
timer_stop KEYWORD2
convert_in KEYWORD2
convert_cm KEYWORD2
###################################
# Constants (LITERAL1)
###################################
###################################
# Syntax Coloring Map For NewPing
###################################
###################################
# Datatypes (KEYWORD1)
###################################
NewPing KEYWORD1
###################################
# Methods and Functions (KEYWORD2)
###################################
ping KEYWORD2
ping_in KEYWORD2
ping_cm KEYWORD2
ping_median KEYWORD2
ping_timer KEYWORD2
check_timer KEYWORD2
ping_result KEYWORD2
timer_us KEYWORD2
timer_ms KEYWORD2
timer_stop KEYWORD2
convert_in KEYWORD2
convert_cm KEYWORD2
###################################
# Constants (LITERAL1)
###################################

View File

@ -1,10 +1,10 @@
name=NewPing
version=1.9.1
author=Tim Eckel <tim@leethost.com>
maintainer=Tim Eckel <tim@leethost.com>
sentence=A library that makes working with ultrasonic sensors easy.
paragraph=When I first received an ultrasonic sensor I was not happy with how poorly it performed. I soon realized the problem was not the sensor, it was the available ping and ultrasonic libraries causing the problem. The NewPing library totally fixes these problems, adds many new features, and breathes new life into these very affordable distance sensors.
category=Sensors
url=https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home
architectures=avr,arm,esp8266
includes=NewPing.h
name=NewPing
version=1.9.1
author=Tim Eckel <tim@leethost.com>
maintainer=Tim Eckel <tim@leethost.com>
sentence=A library that makes working with ultrasonic sensors easy.
paragraph=When I first received an ultrasonic sensor I was not happy with how poorly it performed. I soon realized the problem was not the sensor, it was the available ping and ultrasonic libraries causing the problem. The NewPing library totally fixes these problems, adds many new features, and breathes new life into these very affordable distance sensors.
category=Sensors
url=https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home
architectures=avr,arm,esp8266
includes=NewPing.h

View File

@ -1,365 +1,365 @@
// ---------------------------------------------------------------------------
// Created by Tim Eckel - teckel@leethost.com
//
// See NewPing.h for license, purpose, syntax, version history, links, etc.
// ---------------------------------------------------------------------------
#include "NewPing.h"
// ---------------------------------------------------------------------------
// NewPing constructor
// ---------------------------------------------------------------------------
NewPing::NewPing(uint8_t trigger_pin, uint8_t echo_pin, unsigned int max_cm_distance) {
#if DO_BITWISE == true
_triggerBit = digitalPinToBitMask(trigger_pin); // Get the port register bitmask for the trigger pin.
_echoBit = digitalPinToBitMask(echo_pin); // Get the port register bitmask for the echo pin.
_triggerOutput = portOutputRegister(digitalPinToPort(trigger_pin)); // Get the output port register for the trigger pin.
_echoInput = portInputRegister(digitalPinToPort(echo_pin)); // Get the input port register for the echo pin.
_triggerMode = (uint8_t *) portModeRegister(digitalPinToPort(trigger_pin)); // Get the port mode register for the trigger pin.
#else
_triggerPin = trigger_pin;
_echoPin = echo_pin;
#endif
set_max_distance(max_cm_distance); // Call function to set the max sensor distance.
#if (defined (__arm__) && (defined (TEENSYDUINO) || defined(PARTICLE))) || DO_BITWISE != true
pinMode(echo_pin, INPUT); // Set echo pin to input (on Teensy 3.x (ARM), pins default to disabled, at least one pinMode() is needed for GPIO mode).
pinMode(trigger_pin, OUTPUT); // Set trigger pin to output (on Teensy 3.x (ARM), pins default to disabled, at least one pinMode() is needed for GPIO mode).
#endif
#if defined (ARDUINO_AVR_YUN)
pinMode(echo_pin, INPUT); // Set echo pin to input for the Arduino Yun, not sure why it doesn't default this way.
#endif
#if ONE_PIN_ENABLED != true && DO_BITWISE == true
*_triggerMode |= _triggerBit; // Set trigger pin to output.
#endif
}
// ---------------------------------------------------------------------------
// Standard ping methods
// ---------------------------------------------------------------------------
unsigned int NewPing::ping(unsigned int max_cm_distance) {
if (max_cm_distance > 0) set_max_distance(max_cm_distance); // Call function to set a new max sensor distance.
if (!ping_trigger()) return NO_ECHO; // Trigger a ping, if it returns false, return NO_ECHO to the calling function.
#if URM37_ENABLED == true
#if DO_BITWISE == true
while (!(*_echoInput & _echoBit)) // Wait for the ping echo.
#else
while (!digitalRead(_echoPin)) // Wait for the ping echo.
#endif
if (micros() > _max_time) return NO_ECHO; // Stop the loop and return NO_ECHO (false) if we're beyond the set maximum distance.
#else
#if DO_BITWISE == true
while (*_echoInput & _echoBit) // Wait for the ping echo.
#else
while (digitalRead(_echoPin)) // Wait for the ping echo.
#endif
if (micros() > _max_time) return NO_ECHO; // Stop the loop and return NO_ECHO (false) if we're beyond the set maximum distance.
#endif
return (micros() - (_max_time - _maxEchoTime) - PING_OVERHEAD); // Calculate ping time, include overhead.
}
unsigned long NewPing::ping_cm(unsigned int max_cm_distance) {
unsigned long echoTime = NewPing::ping(max_cm_distance); // Calls the ping method and returns with the ping echo distance in uS.
#if ROUNDING_ENABLED == false
return (echoTime / US_ROUNDTRIP_CM); // Call the ping method and returns the distance in centimeters (no rounding).
#else
return NewPingConvert(echoTime, US_ROUNDTRIP_CM); // Convert uS to centimeters.
#endif
}
unsigned long NewPing::ping_in(unsigned int max_cm_distance) {
unsigned long echoTime = NewPing::ping(max_cm_distance); // Calls the ping method and returns with the ping echo distance in uS.
#if ROUNDING_ENABLED == false
return (echoTime / US_ROUNDTRIP_IN); // Call the ping method and returns the distance in inches (no rounding).
#else
return NewPingConvert(echoTime, US_ROUNDTRIP_IN); // Convert uS to inches.
#endif
}
unsigned long NewPing::ping_median(uint8_t it, unsigned int max_cm_distance) {
unsigned int uS[it], last;
uint8_t j, i = 0;
unsigned long t;
uS[0] = NO_ECHO;
while (i < it) {
t = micros(); // Start ping timestamp.
last = ping(max_cm_distance); // Send ping.
if (last != NO_ECHO) { // Ping in range, include as part of median.
if (i > 0) { // Don't start sort till second ping.
for (j = i; j > 0 && uS[j - 1] < last; j--) // Insertion sort loop.
uS[j] = uS[j - 1]; // Shift ping array to correct position for sort insertion.
} else j = 0; // First ping is sort starting point.
uS[j] = last; // Add last ping to array in sorted position.
i++; // Move to next ping.
} else it--; // Ping out of range, skip and don't include as part of median.
if (i < it && micros() - t < PING_MEDIAN_DELAY)
delay((PING_MEDIAN_DELAY + t - micros()) / 1000); // Millisecond delay between pings.
}
return (uS[it >> 1]); // Return the ping distance median.
}
// ---------------------------------------------------------------------------
// Standard and timer interrupt ping method support functions (not called directly)
// ---------------------------------------------------------------------------
boolean NewPing::ping_trigger() {
#if DO_BITWISE == true
#if ONE_PIN_ENABLED == true
*_triggerMode |= _triggerBit; // Set trigger pin to output.
#endif
*_triggerOutput &= ~_triggerBit; // Set the trigger pin low, should already be low, but this will make sure it is.
delayMicroseconds(4); // Wait for pin to go low.
*_triggerOutput |= _triggerBit; // Set trigger pin high, this tells the sensor to send out a ping.
delayMicroseconds(10); // Wait long enough for the sensor to realize the trigger pin is high. Sensor specs say to wait 10uS.
*_triggerOutput &= ~_triggerBit; // Set trigger pin back to low.
#if ONE_PIN_ENABLED == true
*_triggerMode &= ~_triggerBit; // Set trigger pin to input (when using one Arduino pin, this is technically setting the echo pin to input as both are tied to the same Arduino pin).
#endif
#if URM37_ENABLED == true
if (!(*_echoInput & _echoBit)) return false; // Previous ping hasn't finished, abort.
_max_time = micros() + _maxEchoTime + MAX_SENSOR_DELAY; // Maximum time we'll wait for ping to start (most sensors are <450uS, the SRF06 can take up to 34,300uS!)
while (*_echoInput & _echoBit) // Wait for ping to start.
if (micros() > _max_time) return false; // Took too long to start, abort.
#else
if (*_echoInput & _echoBit) return false; // Previous ping hasn't finished, abort.
_max_time = micros() + _maxEchoTime + MAX_SENSOR_DELAY; // Maximum time we'll wait for ping to start (most sensors are <450uS, the SRF06 can take up to 34,300uS!)
while (!(*_echoInput & _echoBit)) // Wait for ping to start.
if (micros() > _max_time) return false; // Took too long to start, abort.
#endif
#else
#if ONE_PIN_ENABLED == true
pinMode(_triggerPin, OUTPUT); // Set trigger pin to output.
#endif
digitalWrite(_triggerPin, LOW); // Set the trigger pin low, should already be low, but this will make sure it is.
delayMicroseconds(4); // Wait for pin to go low.
digitalWrite(_triggerPin, HIGH); // Set trigger pin high, this tells the sensor to send out a ping.
delayMicroseconds(10); // Wait long enough for the sensor to realize the trigger pin is high. Sensor specs say to wait 10uS.
digitalWrite(_triggerPin, LOW); // Set trigger pin back to low.
#if ONE_PIN_ENABLED == true
pinMode(_triggerPin, INPUT); // Set trigger pin to input (when using one Arduino pin, this is technically setting the echo pin to input as both are tied to the same Arduino pin).
#endif
#if URM37_ENABLED == true
if (!digitalRead(_echoPin)) return false; // Previous ping hasn't finished, abort.
_max_time = micros() + _maxEchoTime + MAX_SENSOR_DELAY; // Maximum time we'll wait for ping to start (most sensors are <450uS, the SRF06 can take up to 34,300uS!)
while (digitalRead(_echoPin)) // Wait for ping to start.
if (micros() > _max_time) return false; // Took too long to start, abort.
#else
if (digitalRead(_echoPin)) return false; // Previous ping hasn't finished, abort.
_max_time = micros() + _maxEchoTime + MAX_SENSOR_DELAY; // Maximum time we'll wait for ping to start (most sensors are <450uS, the SRF06 can take up to 34,300uS!)
while (!digitalRead(_echoPin)) // Wait for ping to start.
if (micros() > _max_time) return false; // Took too long to start, abort.
#endif
#endif
_max_time = micros() + _maxEchoTime; // Ping started, set the time-out.
return true; // Ping started successfully.
}
void NewPing::set_max_distance(unsigned int max_cm_distance) {
#if ROUNDING_ENABLED == false
_maxEchoTime = min(max_cm_distance + 1, (unsigned int) MAX_SENSOR_DISTANCE + 1) * US_ROUNDTRIP_CM; // Calculate the maximum distance in uS (no rounding).
#else
_maxEchoTime = min(max_cm_distance, (unsigned int) MAX_SENSOR_DISTANCE) * US_ROUNDTRIP_CM + (US_ROUNDTRIP_CM / 2); // Calculate the maximum distance in uS.
#endif
}
#if TIMER_ENABLED == true && DO_BITWISE == true
// ---------------------------------------------------------------------------
// Timer interrupt ping methods (won't work with ATmega128, ATtiny and most non-AVR microcontrollers)
// ---------------------------------------------------------------------------
void NewPing::ping_timer(void (*userFunc)(void), unsigned int max_cm_distance) {
if (max_cm_distance > 0) set_max_distance(max_cm_distance); // Call function to set a new max sensor distance.
if (!ping_trigger()) return; // Trigger a ping, if it returns false, return without starting the echo timer.
timer_us(ECHO_TIMER_FREQ, userFunc); // Set ping echo timer check every ECHO_TIMER_FREQ uS.
}
boolean NewPing::check_timer() {
if (micros() > _max_time) { // Outside the time-out limit.
timer_stop(); // Disable timer interrupt
return false; // Cancel ping timer.
}
#if URM37_ENABLED == false
if (!(*_echoInput & _echoBit)) { // Ping echo received.
#else
if (*_echoInput & _echoBit) { // Ping echo received.
#endif
timer_stop(); // Disable timer interrupt
ping_result = (micros() - (_max_time - _maxEchoTime) - PING_TIMER_OVERHEAD); // Calculate ping time including overhead.
return true; // Return ping echo true.
}
return false; // Return false because there's no ping echo yet.
}
// ---------------------------------------------------------------------------
// Timer2/Timer4 interrupt methods (can be used for non-ultrasonic needs)
// ---------------------------------------------------------------------------
// Variables used for timer functions
void (*intFunc)();
void (*intFunc2)();
unsigned long _ms_cnt_reset;
volatile unsigned long _ms_cnt;
#if defined(__arm__) && (defined (TEENSYDUINO) || defined(PARTICLE))
IntervalTimer itimer;
#endif
void NewPing::timer_us(unsigned int frequency, void (*userFunc)(void)) {
intFunc = userFunc; // User's function to call when there's a timer event.
timer_setup(); // Configure the timer interrupt.
#if defined (__AVR_ATmega32U4__) // Use Timer4 for ATmega32U4 (Teensy/Leonardo).
OCR4C = min((frequency>>2) - 1, 255); // Every count is 4uS, so divide by 4 (bitwise shift right 2) subtract one, then make sure we don't go over 255 limit.
TIMSK4 = (1<<TOIE4); // Enable Timer4 interrupt.
#elif defined (__arm__) && defined (TEENSYDUINO) // Timer for Teensy 3.x
itimer.begin(userFunc, frequency); // Really simple on the Teensy 3.x, calls userFunc every 'frequency' uS.
#elif defined (__arm__) && defined (PARTICLE) // Timer for Particle devices
itimer.begin(userFunc, frequency, uSec); // Really simple on the Particle, calls userFunc every 'frequency' uS.
#else
OCR2A = min((frequency>>2) - 1, 255); // Every count is 4uS, so divide by 4 (bitwise shift right 2) subtract one, then make sure we don't go over 255 limit.
TIMSK2 |= (1<<OCIE2A); // Enable Timer2 interrupt.
#endif
}
void NewPing::timer_ms(unsigned long frequency, void (*userFunc)(void)) {
intFunc = NewPing::timer_ms_cntdwn; // Timer events are sent here once every ms till user's frequency is reached.
intFunc2 = userFunc; // User's function to call when user's frequency is reached.
_ms_cnt = _ms_cnt_reset = frequency; // Current ms counter and reset value.
timer_setup(); // Configure the timer interrupt.
#if defined (__AVR_ATmega32U4__) // Use Timer4 for ATmega32U4 (Teensy/Leonardo).
OCR4C = 249; // Every count is 4uS, so 1ms = 250 counts - 1.
TIMSK4 = (1<<TOIE4); // Enable Timer4 interrupt.
#elif defined (__arm__) && defined (TEENSYDUINO) // Timer for Teensy 3.x
itimer.begin(NewPing::timer_ms_cntdwn, 1000); // Set timer to 1ms (1000 uS).
#elif defined (__arm__) && defined (PARTICLE) // Timer for Particle
itimer.begin(NewPing::timer_ms_cntdwn, 1000, uSec); // Set timer to 1ms (1000 uS).
#else
OCR2A = 249; // Every count is 4uS, so 1ms = 250 counts - 1.
TIMSK2 |= (1<<OCIE2A); // Enable Timer2 interrupt.
#endif
}
void NewPing::timer_stop() { // Disable timer interrupt.
#if defined (__AVR_ATmega32U4__) // Use Timer4 for ATmega32U4 (Teensy/Leonardo).
TIMSK4 = 0;
#elif defined (__arm__) && (defined (TEENSYDUINO) || defined (PARTICLE)) // Timer for Teensy 3.x & Particle
itimer.end();
#else
TIMSK2 &= ~(1<<OCIE2A);
#endif
}
// ---------------------------------------------------------------------------
// Timer2/Timer4 interrupt method support functions (not called directly)
// ---------------------------------------------------------------------------
void NewPing::timer_setup() {
#if defined (__AVR_ATmega32U4__) // Use Timer4 for ATmega32U4 (Teensy/Leonardo).
timer_stop(); // Disable Timer4 interrupt.
TCCR4A = TCCR4C = TCCR4D = TCCR4E = 0;
TCCR4B = (1<<CS42) | (1<<CS41) | (1<<CS40) | (1<<PSR4); // Set Timer4 prescaler to 64 (4uS/count, 4uS-1020uS range).
TIFR4 = (1<<TOV4);
TCNT4 = 0; // Reset Timer4 counter.
#elif defined (__AVR_ATmega8__) || defined (__AVR_ATmega16__) || defined (__AVR_ATmega32__) || defined (__AVR_ATmega8535__) // Alternate timer commands for certain microcontrollers.
timer_stop(); // Disable Timer2 interrupt.
ASSR &= ~(1<<AS2); // Set clock, not pin.
TCCR2 = (1<<WGM21 | 1<<CS22); // Set Timer2 to CTC mode, prescaler to 64 (4uS/count, 4uS-1020uS range).
TCNT2 = 0; // Reset Timer2 counter.
#elif defined (__arm__) && (defined (TEENSYDUINO) || defined (PARTICLE))
timer_stop(); // Stop the timer.
#else
timer_stop(); // Disable Timer2 interrupt.
ASSR &= ~(1<<AS2); // Set clock, not pin.
TCCR2A = (1<<WGM21); // Set Timer2 to CTC mode.
TCCR2B = (1<<CS22); // Set Timer2 prescaler to 64 (4uS/count, 4uS-1020uS range).
TCNT2 = 0; // Reset Timer2 counter.
#endif
}
void NewPing::timer_ms_cntdwn() {
if (!_ms_cnt--) { // Count down till we reach zero.
intFunc2(); // Scheduled time reached, run the main timer event function.
_ms_cnt = _ms_cnt_reset; // Reset the ms timer.
}
}
#if defined (__AVR_ATmega32U4__) // Use Timer4 for ATmega32U4 (Teensy/Leonardo).
ISR(TIMER4_OVF_vect) {
intFunc(); // Call wrapped function.
}
#elif defined (__AVR_ATmega8__) || defined (__AVR_ATmega16__) || defined (__AVR_ATmega32__) || defined (__AVR_ATmega8535__) // Alternate timer commands for certain microcontrollers.
ISR(TIMER2_COMP_vect) {
intFunc(); // Call wrapped function.
}
#elif defined (__arm__)
// Do nothing...
#else
ISR(TIMER2_COMPA_vect) {
intFunc(); // Call wrapped function.
}
#endif
#endif
// ---------------------------------------------------------------------------
// Conversion methods (rounds result to nearest cm or inch).
// ---------------------------------------------------------------------------
unsigned int NewPing::convert_cm(unsigned int echoTime) {
#if ROUNDING_ENABLED == false
return (echoTime / US_ROUNDTRIP_CM); // Convert uS to centimeters (no rounding).
#else
return NewPingConvert(echoTime, US_ROUNDTRIP_CM); // Convert uS to centimeters.
#endif
}
unsigned int NewPing::convert_in(unsigned int echoTime) {
#if ROUNDING_ENABLED == false
return (echoTime / US_ROUNDTRIP_IN); // Convert uS to inches (no rounding).
#else
return NewPingConvert(echoTime, US_ROUNDTRIP_IN); // Convert uS to inches.
#endif
}
// ---------------------------------------------------------------------------
// Created by Tim Eckel - teckel@leethost.com
//
// See NewPing.h for license, purpose, syntax, version history, links, etc.
// ---------------------------------------------------------------------------
#include "NewPing.h"
// ---------------------------------------------------------------------------
// NewPing constructor
// ---------------------------------------------------------------------------
NewPing::NewPing(uint8_t trigger_pin, uint8_t echo_pin, unsigned int max_cm_distance) {
#if DO_BITWISE == true
_triggerBit = digitalPinToBitMask(trigger_pin); // Get the port register bitmask for the trigger pin.
_echoBit = digitalPinToBitMask(echo_pin); // Get the port register bitmask for the echo pin.
_triggerOutput = portOutputRegister(digitalPinToPort(trigger_pin)); // Get the output port register for the trigger pin.
_echoInput = portInputRegister(digitalPinToPort(echo_pin)); // Get the input port register for the echo pin.
_triggerMode = (uint8_t *) portModeRegister(digitalPinToPort(trigger_pin)); // Get the port mode register for the trigger pin.
#else
_triggerPin = trigger_pin;
_echoPin = echo_pin;
#endif
set_max_distance(max_cm_distance); // Call function to set the max sensor distance.
#if (defined (__arm__) && (defined (TEENSYDUINO) || defined(PARTICLE))) || DO_BITWISE != true
pinMode(echo_pin, INPUT); // Set echo pin to input (on Teensy 3.x (ARM), pins default to disabled, at least one pinMode() is needed for GPIO mode).
pinMode(trigger_pin, OUTPUT); // Set trigger pin to output (on Teensy 3.x (ARM), pins default to disabled, at least one pinMode() is needed for GPIO mode).
#endif
#if defined (ARDUINO_AVR_YUN)
pinMode(echo_pin, INPUT); // Set echo pin to input for the Arduino Yun, not sure why it doesn't default this way.
#endif
#if ONE_PIN_ENABLED != true && DO_BITWISE == true
*_triggerMode |= _triggerBit; // Set trigger pin to output.
#endif
}
// ---------------------------------------------------------------------------
// Standard ping methods
// ---------------------------------------------------------------------------
unsigned int NewPing::ping(unsigned int max_cm_distance) {
if (max_cm_distance > 0) set_max_distance(max_cm_distance); // Call function to set a new max sensor distance.
if (!ping_trigger()) return NO_ECHO; // Trigger a ping, if it returns false, return NO_ECHO to the calling function.
#if URM37_ENABLED == true
#if DO_BITWISE == true
while (!(*_echoInput & _echoBit)) // Wait for the ping echo.
#else
while (!digitalRead(_echoPin)) // Wait for the ping echo.
#endif
if (micros() > _max_time) return NO_ECHO; // Stop the loop and return NO_ECHO (false) if we're beyond the set maximum distance.
#else
#if DO_BITWISE == true
while (*_echoInput & _echoBit) // Wait for the ping echo.
#else
while (digitalRead(_echoPin)) // Wait for the ping echo.
#endif
if (micros() > _max_time) return NO_ECHO; // Stop the loop and return NO_ECHO (false) if we're beyond the set maximum distance.
#endif
return (micros() - (_max_time - _maxEchoTime) - PING_OVERHEAD); // Calculate ping time, include overhead.
}
unsigned long NewPing::ping_cm(unsigned int max_cm_distance) {
unsigned long echoTime = NewPing::ping(max_cm_distance); // Calls the ping method and returns with the ping echo distance in uS.
#if ROUNDING_ENABLED == false
return (echoTime / US_ROUNDTRIP_CM); // Call the ping method and returns the distance in centimeters (no rounding).
#else
return NewPingConvert(echoTime, US_ROUNDTRIP_CM); // Convert uS to centimeters.
#endif
}
unsigned long NewPing::ping_in(unsigned int max_cm_distance) {
unsigned long echoTime = NewPing::ping(max_cm_distance); // Calls the ping method and returns with the ping echo distance in uS.
#if ROUNDING_ENABLED == false
return (echoTime / US_ROUNDTRIP_IN); // Call the ping method and returns the distance in inches (no rounding).
#else
return NewPingConvert(echoTime, US_ROUNDTRIP_IN); // Convert uS to inches.
#endif
}
unsigned long NewPing::ping_median(uint8_t it, unsigned int max_cm_distance) {
unsigned int uS[it], last;
uint8_t j, i = 0;
unsigned long t;
uS[0] = NO_ECHO;
while (i < it) {
t = micros(); // Start ping timestamp.
last = ping(max_cm_distance); // Send ping.
if (last != NO_ECHO) { // Ping in range, include as part of median.
if (i > 0) { // Don't start sort till second ping.
for (j = i; j > 0 && uS[j - 1] < last; j--) // Insertion sort loop.
uS[j] = uS[j - 1]; // Shift ping array to correct position for sort insertion.
} else j = 0; // First ping is sort starting point.
uS[j] = last; // Add last ping to array in sorted position.
i++; // Move to next ping.
} else it--; // Ping out of range, skip and don't include as part of median.
if (i < it && micros() - t < PING_MEDIAN_DELAY)
delay((PING_MEDIAN_DELAY + t - micros()) / 1000); // Millisecond delay between pings.
}
return (uS[it >> 1]); // Return the ping distance median.
}
// ---------------------------------------------------------------------------
// Standard and timer interrupt ping method support functions (not called directly)
// ---------------------------------------------------------------------------
boolean NewPing::ping_trigger() {
#if DO_BITWISE == true
#if ONE_PIN_ENABLED == true
*_triggerMode |= _triggerBit; // Set trigger pin to output.
#endif
*_triggerOutput &= ~_triggerBit; // Set the trigger pin low, should already be low, but this will make sure it is.
delayMicroseconds(4); // Wait for pin to go low.
*_triggerOutput |= _triggerBit; // Set trigger pin high, this tells the sensor to send out a ping.
delayMicroseconds(10); // Wait long enough for the sensor to realize the trigger pin is high. Sensor specs say to wait 10uS.
*_triggerOutput &= ~_triggerBit; // Set trigger pin back to low.
#if ONE_PIN_ENABLED == true
*_triggerMode &= ~_triggerBit; // Set trigger pin to input (when using one Arduino pin, this is technically setting the echo pin to input as both are tied to the same Arduino pin).
#endif
#if URM37_ENABLED == true
if (!(*_echoInput & _echoBit)) return false; // Previous ping hasn't finished, abort.
_max_time = micros() + _maxEchoTime + MAX_SENSOR_DELAY; // Maximum time we'll wait for ping to start (most sensors are <450uS, the SRF06 can take up to 34,300uS!)
while (*_echoInput & _echoBit) // Wait for ping to start.
if (micros() > _max_time) return false; // Took too long to start, abort.
#else
if (*_echoInput & _echoBit) return false; // Previous ping hasn't finished, abort.
_max_time = micros() + _maxEchoTime + MAX_SENSOR_DELAY; // Maximum time we'll wait for ping to start (most sensors are <450uS, the SRF06 can take up to 34,300uS!)
while (!(*_echoInput & _echoBit)) // Wait for ping to start.
if (micros() > _max_time) return false; // Took too long to start, abort.
#endif
#else
#if ONE_PIN_ENABLED == true
pinMode(_triggerPin, OUTPUT); // Set trigger pin to output.
#endif
digitalWrite(_triggerPin, LOW); // Set the trigger pin low, should already be low, but this will make sure it is.
delayMicroseconds(4); // Wait for pin to go low.
digitalWrite(_triggerPin, HIGH); // Set trigger pin high, this tells the sensor to send out a ping.
delayMicroseconds(10); // Wait long enough for the sensor to realize the trigger pin is high. Sensor specs say to wait 10uS.
digitalWrite(_triggerPin, LOW); // Set trigger pin back to low.
#if ONE_PIN_ENABLED == true
pinMode(_triggerPin, INPUT); // Set trigger pin to input (when using one Arduino pin, this is technically setting the echo pin to input as both are tied to the same Arduino pin).
#endif
#if URM37_ENABLED == true
if (!digitalRead(_echoPin)) return false; // Previous ping hasn't finished, abort.
_max_time = micros() + _maxEchoTime + MAX_SENSOR_DELAY; // Maximum time we'll wait for ping to start (most sensors are <450uS, the SRF06 can take up to 34,300uS!)
while (digitalRead(_echoPin)) // Wait for ping to start.
if (micros() > _max_time) return false; // Took too long to start, abort.
#else
if (digitalRead(_echoPin)) return false; // Previous ping hasn't finished, abort.
_max_time = micros() + _maxEchoTime + MAX_SENSOR_DELAY; // Maximum time we'll wait for ping to start (most sensors are <450uS, the SRF06 can take up to 34,300uS!)
while (!digitalRead(_echoPin)) // Wait for ping to start.
if (micros() > _max_time) return false; // Took too long to start, abort.
#endif
#endif
_max_time = micros() + _maxEchoTime; // Ping started, set the time-out.
return true; // Ping started successfully.
}
void NewPing::set_max_distance(unsigned int max_cm_distance) {
#if ROUNDING_ENABLED == false
_maxEchoTime = min(max_cm_distance + 1, (unsigned int) MAX_SENSOR_DISTANCE + 1) * US_ROUNDTRIP_CM; // Calculate the maximum distance in uS (no rounding).
#else
_maxEchoTime = min(max_cm_distance, (unsigned int) MAX_SENSOR_DISTANCE) * US_ROUNDTRIP_CM + (US_ROUNDTRIP_CM / 2); // Calculate the maximum distance in uS.
#endif
}
#if TIMER_ENABLED == true && DO_BITWISE == true
// ---------------------------------------------------------------------------
// Timer interrupt ping methods (won't work with ATmega128, ATtiny and most non-AVR microcontrollers)
// ---------------------------------------------------------------------------
void NewPing::ping_timer(void (*userFunc)(void), unsigned int max_cm_distance) {
if (max_cm_distance > 0) set_max_distance(max_cm_distance); // Call function to set a new max sensor distance.
if (!ping_trigger()) return; // Trigger a ping, if it returns false, return without starting the echo timer.
timer_us(ECHO_TIMER_FREQ, userFunc); // Set ping echo timer check every ECHO_TIMER_FREQ uS.
}
boolean NewPing::check_timer() {
if (micros() > _max_time) { // Outside the time-out limit.
timer_stop(); // Disable timer interrupt
return false; // Cancel ping timer.
}
#if URM37_ENABLED == false
if (!(*_echoInput & _echoBit)) { // Ping echo received.
#else
if (*_echoInput & _echoBit) { // Ping echo received.
#endif
timer_stop(); // Disable timer interrupt
ping_result = (micros() - (_max_time - _maxEchoTime) - PING_TIMER_OVERHEAD); // Calculate ping time including overhead.
return true; // Return ping echo true.
}
return false; // Return false because there's no ping echo yet.
}
// ---------------------------------------------------------------------------
// Timer2/Timer4 interrupt methods (can be used for non-ultrasonic needs)
// ---------------------------------------------------------------------------
// Variables used for timer functions
void (*intFunc)();
void (*intFunc2)();
unsigned long _ms_cnt_reset;
volatile unsigned long _ms_cnt;
#if defined(__arm__) && (defined (TEENSYDUINO) || defined(PARTICLE))
IntervalTimer itimer;
#endif
void NewPing::timer_us(unsigned int frequency, void (*userFunc)(void)) {
intFunc = userFunc; // User's function to call when there's a timer event.
timer_setup(); // Configure the timer interrupt.
#if defined (__AVR_ATmega32U4__) // Use Timer4 for ATmega32U4 (Teensy/Leonardo).
OCR4C = min((frequency>>2) - 1, 255); // Every count is 4uS, so divide by 4 (bitwise shift right 2) subtract one, then make sure we don't go over 255 limit.
TIMSK4 = (1<<TOIE4); // Enable Timer4 interrupt.
#elif defined (__arm__) && defined (TEENSYDUINO) // Timer for Teensy 3.x
itimer.begin(userFunc, frequency); // Really simple on the Teensy 3.x, calls userFunc every 'frequency' uS.
#elif defined (__arm__) && defined (PARTICLE) // Timer for Particle devices
itimer.begin(userFunc, frequency, uSec); // Really simple on the Particle, calls userFunc every 'frequency' uS.
#else
OCR2A = min((frequency>>2) - 1, 255); // Every count is 4uS, so divide by 4 (bitwise shift right 2) subtract one, then make sure we don't go over 255 limit.
TIMSK2 |= (1<<OCIE2A); // Enable Timer2 interrupt.
#endif
}
void NewPing::timer_ms(unsigned long frequency, void (*userFunc)(void)) {
intFunc = NewPing::timer_ms_cntdwn; // Timer events are sent here once every ms till user's frequency is reached.
intFunc2 = userFunc; // User's function to call when user's frequency is reached.
_ms_cnt = _ms_cnt_reset = frequency; // Current ms counter and reset value.
timer_setup(); // Configure the timer interrupt.
#if defined (__AVR_ATmega32U4__) // Use Timer4 for ATmega32U4 (Teensy/Leonardo).
OCR4C = 249; // Every count is 4uS, so 1ms = 250 counts - 1.
TIMSK4 = (1<<TOIE4); // Enable Timer4 interrupt.
#elif defined (__arm__) && defined (TEENSYDUINO) // Timer for Teensy 3.x
itimer.begin(NewPing::timer_ms_cntdwn, 1000); // Set timer to 1ms (1000 uS).
#elif defined (__arm__) && defined (PARTICLE) // Timer for Particle
itimer.begin(NewPing::timer_ms_cntdwn, 1000, uSec); // Set timer to 1ms (1000 uS).
#else
OCR2A = 249; // Every count is 4uS, so 1ms = 250 counts - 1.
TIMSK2 |= (1<<OCIE2A); // Enable Timer2 interrupt.
#endif
}
void NewPing::timer_stop() { // Disable timer interrupt.
#if defined (__AVR_ATmega32U4__) // Use Timer4 for ATmega32U4 (Teensy/Leonardo).
TIMSK4 = 0;
#elif defined (__arm__) && (defined (TEENSYDUINO) || defined (PARTICLE)) // Timer for Teensy 3.x & Particle
itimer.end();
#else
TIMSK2 &= ~(1<<OCIE2A);
#endif
}
// ---------------------------------------------------------------------------
// Timer2/Timer4 interrupt method support functions (not called directly)
// ---------------------------------------------------------------------------
void NewPing::timer_setup() {
#if defined (__AVR_ATmega32U4__) // Use Timer4 for ATmega32U4 (Teensy/Leonardo).
timer_stop(); // Disable Timer4 interrupt.
TCCR4A = TCCR4C = TCCR4D = TCCR4E = 0;
TCCR4B = (1<<CS42) | (1<<CS41) | (1<<CS40) | (1<<PSR4); // Set Timer4 prescaler to 64 (4uS/count, 4uS-1020uS range).
TIFR4 = (1<<TOV4);
TCNT4 = 0; // Reset Timer4 counter.
#elif defined (__AVR_ATmega8__) || defined (__AVR_ATmega16__) || defined (__AVR_ATmega32__) || defined (__AVR_ATmega8535__) // Alternate timer commands for certain microcontrollers.
timer_stop(); // Disable Timer2 interrupt.
ASSR &= ~(1<<AS2); // Set clock, not pin.
TCCR2 = (1<<WGM21 | 1<<CS22); // Set Timer2 to CTC mode, prescaler to 64 (4uS/count, 4uS-1020uS range).
TCNT2 = 0; // Reset Timer2 counter.
#elif defined (__arm__) && (defined (TEENSYDUINO) || defined (PARTICLE))
timer_stop(); // Stop the timer.
#else
timer_stop(); // Disable Timer2 interrupt.
ASSR &= ~(1<<AS2); // Set clock, not pin.
TCCR2A = (1<<WGM21); // Set Timer2 to CTC mode.
TCCR2B = (1<<CS22); // Set Timer2 prescaler to 64 (4uS/count, 4uS-1020uS range).
TCNT2 = 0; // Reset Timer2 counter.
#endif
}
void NewPing::timer_ms_cntdwn() {
if (!_ms_cnt--) { // Count down till we reach zero.
intFunc2(); // Scheduled time reached, run the main timer event function.
_ms_cnt = _ms_cnt_reset; // Reset the ms timer.
}
}
#if defined (__AVR_ATmega32U4__) // Use Timer4 for ATmega32U4 (Teensy/Leonardo).
ISR(TIMER4_OVF_vect) {
intFunc(); // Call wrapped function.
}
#elif defined (__AVR_ATmega8__) || defined (__AVR_ATmega16__) || defined (__AVR_ATmega32__) || defined (__AVR_ATmega8535__) // Alternate timer commands for certain microcontrollers.
ISR(TIMER2_COMP_vect) {
intFunc(); // Call wrapped function.
}
#elif defined (__arm__)
// Do nothing...
#else
ISR(TIMER2_COMPA_vect) {
intFunc(); // Call wrapped function.
}
#endif
#endif
// ---------------------------------------------------------------------------
// Conversion methods (rounds result to nearest cm or inch).
// ---------------------------------------------------------------------------
unsigned int NewPing::convert_cm(unsigned int echoTime) {
#if ROUNDING_ENABLED == false
return (echoTime / US_ROUNDTRIP_CM); // Convert uS to centimeters (no rounding).
#else
return NewPingConvert(echoTime, US_ROUNDTRIP_CM); // Convert uS to centimeters.
#endif
}
unsigned int NewPing::convert_in(unsigned int echoTime) {
#if ROUNDING_ENABLED == false
return (echoTime / US_ROUNDTRIP_IN); // Convert uS to inches (no rounding).
#else
return NewPingConvert(echoTime, US_ROUNDTRIP_IN); // Convert uS to inches.
#endif
}

View File

@ -1,275 +1,275 @@
// ---------------------------------------------------------------------------
// NewPing Library - v1.9.1 - 07/15/2018
//
// AUTHOR/LICENSE:
// Created by Tim Eckel - teckel@leethost.com
// Copyright 2018 License: Forks and derivitive works are NOT permitted without
// permission. Permission is only granted to use as-is for private and
// commercial use. If you wish to contribute, make changes, or enhancements,
// please create a pull request. I get a TON of support issues from this
// library, most of which comes from old versions, buggy forks or sites without
// proper documentation, just trying to wrangle this project together.
//
// LINKS:
// Project home: https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home
// Blog: http://arduino.cc/forum/index.php/topic,106043.0.html
//
// DISCLAIMER:
// This software is furnished "as is", without technical support, and with no
// warranty, express or implied, as to its usefulness for any purpose.
//
// BACKGROUND:
// When I first received an ultrasonic sensor I was not happy with how poorly
// it worked. Quickly I realized the problem wasn't the sensor, it was the
// available ping and ultrasonic libraries causing the problem. The NewPing
// library totally fixes these problems, adds many new features, and breaths
// new life into these very affordable distance sensors.
//
// FEATURES:
// * Works with many different ultrasonic sensors: SR04, SRF05, SRF06, DYP-ME007, URM37 & Parallax PING)))™.
// * Compatible with the entire Arduino line-up (and clones), Teensy family (including $19.80 96Mhz 32 bit Teensy 3.2) and non-AVR microcontrollers.
// * Interface with all but the SRF06 sensor using only one Arduino pin.
// * Doesn't lag for a full second if no ping/echo is received.
// * Ping sensors consistently and reliably at up to 30 times per second.
// * Timer interrupt method for event-driven sketches.
// * Built-in digital filter method ping_median() for easy error correction.
// * Uses port registers for a faster pin interface and smaller code size.
// * Allows you to set a maximum distance where pings beyond that distance are read as no ping "clear".
// * Ease of using multiple sensors (example sketch with 15 sensors).
// * More accurate distance calculation (cm, inches & uS).
// * Doesn't use pulseIn, which is slow and gives incorrect results with some ultrasonic sensor models.
// * Actively developed with features being added and bugs/issues addressed.
//
// CONSTRUCTOR:
// NewPing sonar(trigger_pin, echo_pin [, max_cm_distance])
// trigger_pin & echo_pin - Arduino pins connected to sensor trigger and echo.
// NOTE: To use the same Arduino pin for trigger and echo, specify the same pin for both values.
// max_cm_distance - [Optional] Maximum distance you wish to sense. Default=500cm.
//
// METHODS:
// sonar.ping([max_cm_distance]) - Send a ping and get the echo time (in microseconds) as a result. [max_cm_distance] allows you to optionally set a new max distance.
// sonar.ping_in([max_cm_distance]) - Send a ping and get the distance in whole inches. [max_cm_distance] allows you to optionally set a new max distance.
// sonar.ping_cm([max_cm_distance]) - Send a ping and get the distance in whole centimeters. [max_cm_distance] allows you to optionally set a new max distance.
// sonar.ping_median(iterations [, max_cm_distance]) - Do multiple pings (default=5), discard out of range pings and return median in microseconds. [max_cm_distance] allows you to optionally set a new max distance.
// NewPing::convert_in(echoTime) - Convert echoTime from microseconds to inches (rounds to nearest inch).
// NewPing::convert_cm(echoTime) - Convert echoTime from microseconds to centimeters (rounds to nearest cm).
// sonar.ping_timer(function [, max_cm_distance]) - Send a ping and call function to test if ping is complete. [max_cm_distance] allows you to optionally set a new max distance.
// sonar.check_timer() - Check if ping has returned within the set distance limit.
// NewPing::timer_us(frequency, function) - Call function every frequency microseconds.
// NewPing::timer_ms(frequency, function) - Call function every frequency milliseconds.
// NewPing::timer_stop() - Stop the timer.
//
// HISTORY:
// 07/15/2018 v1.9.1 - Added support for ATtiny441 and ATtiny841
// microcontrollers.
// 12/09/2017 v1.9.0 - Added support for the ARM-based Particle devices. If
// other ARM-based microcontrollers adopt a similar timer method that the
// Particle and Teensy 3.x share, support for other ARM-based microcontrollers
// could be possible. Attempt to add to Arduino library manager. License
// changed.
// 07/30/2016 v1.8 - Added support for non-AVR microcontrollers. For non-AVR
// microcontrollers, advanced ping_timer() timer methods are disabled due to
// inconsistencies or no support at all between platforms. However, standard
// ping methods are all supported. Added new optional variable to ping(),
// ping_in(), ping_cm(), ping_median(), and ping_timer() methods which allows
// you to set a new maximum distance for each ping. Added support for the
// ATmega16, ATmega32 and ATmega8535 microcontrollers. Changed convert_cm()
// and convert_in() methods to static members. You can now call them without
// an object. For example: cm = NewPing::convert_cm(distance);
//
// 09/29/2015 v1.7 - Removed support for the Arduino Due and Zero because
// they're both 3.3 volt boards and are not 5 volt tolerant while the HC-SR04
// is a 5 volt sensor. Also, the Due and Zero don't support pin manipulation
// compatibility via port registers which can be done (see the Teensy 3.2).
//
// 06/17/2014 v1.6 - Corrected delay between pings when using ping_median()
// method. Added support for the URM37 sensor (must change URM37_ENABLED from
// false to true). Added support for Arduino microcontrollers like the $20
// 32 bit ARM Cortex-M4 based Teensy 3.2. Added automatic support for the
// Atmel ATtiny family of microcontrollers. Added timer support for the
// ATmega8 microcontroller. Rounding disabled by default, reduces compiled
// code size (can be turned on with ROUNDING_ENABLED switch). Added
// TIMER_ENABLED switch to get around compile-time "__vector_7" errors when
// using the Tone library, or you can use the toneAC, NewTone or
// TimerFreeTone libraries: https://bitbucket.org/teckel12/arduino-toneac/
// Other speed and compiled size optimizations.
//
// 08/15/2012 v1.5 - Added ping_median() method which does a user specified
// number of pings (default=5) and returns the median ping in microseconds
// (out of range pings ignored). This is a very effective digital filter.
// Optimized for smaller compiled size (even smaller than sketches that
// don't use a library).
//
// 07/14/2012 v1.4 - Added support for the Parallax PING)))<29> sensor. Interface
// with all but the SRF06 sensor using only one Arduino pin. You can also
// interface with the SRF06 using one pin if you install a 0.1uf capacitor
// on the trigger and echo pins of the sensor then tie the trigger pin to
// the Arduino pin (doesn't work with Teensy). To use the same Arduino pin
// for trigger and echo, specify the same pin for both values. Various bug
// fixes.
//
// 06/08/2012 v1.3 - Big feature addition, event-driven ping! Uses Timer2
// interrupt, so be mindful of PWM or timing conflicts messing with Timer2
// may cause (namely PWM on pins 3 & 11 on Arduino, PWM on pins 9 and 10 on
// Mega, and Tone library). Simple to use timer interrupt functions you can
// use in your sketches totally unrelated to ultrasonic sensors (don't use if
// you're also using NewPing's ping_timer because both use Timer2 interrupts).
// Loop counting ping method deleted in favor of timing ping method after
// inconsistent results kept surfacing with the loop timing ping method.
// Conversion to cm and inches now rounds to the nearest cm or inch. Code
// optimized to save program space and fixed a couple minor bugs here and
// there. Many new comments added as well as line spacing to group code
// sections for better source readability.
//
// 05/25/2012 v1.2 - Lots of code clean-up thanks to Arduino Forum members.
// Rebuilt the ping timing code from scratch, ditched the pulseIn code as it
// doesn't give correct results (at least with ping sensors). The NewPing
// library is now VERY accurate and the code was simplified as a bonus.
// Smaller and faster code as well. Fixed some issues with very close ping
// results when converting to inches. All functions now return 0 only when
// there's no ping echo (out of range) and a positive value for a successful
// ping. This can effectively be used to detect if something is out of range
// or in-range and at what distance. Now compatible with Arduino 0023.
//
// 05/16/2012 v1.1 - Changed all I/O functions to use low-level port registers
// for ultra-fast and lean code (saves from 174 to 394 bytes). Tested on both
// the Arduino Uno and Teensy 2.0 but should work on all Arduino-based
// platforms because it calls standard functions to retrieve port registers
// and bit masks. Also made a couple minor fixes to defines.
//
// 05/15/2012 v1.0 - Initial release.
// ---------------------------------------------------------------------------
#ifndef NewPing_h
#define NewPing_h
#if defined (ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#if defined (PARTICLE)
#include <SparkIntervalTimer.h>
#else
#include <pins_arduino.h>
#endif
#endif
#if defined (__AVR__)
#include <avr/io.h>
#include <avr/interrupt.h>
#endif
// Shouldn't need to change these values unless you have a specific need to do so.
#define MAX_SENSOR_DISTANCE 500 // Maximum sensor distance can be as high as 500cm, no reason to wait for ping longer than sound takes to travel this distance and back. Default=500
#define US_ROUNDTRIP_CM 57 // Microseconds (uS) it takes sound to travel round-trip 1cm (2cm total), uses integer to save compiled code space. Default=57
#define US_ROUNDTRIP_IN 146 // Microseconds (uS) it takes sound to travel round-trip 1 inch (2 inches total), uses integer to save compiled code space. Defalult=146
#define ONE_PIN_ENABLED true // Set to "false" to disable one pin mode which saves around 14-26 bytes of binary size. Default=true
#define ROUNDING_ENABLED false // Set to "true" to enable distance rounding which also adds 64 bytes to binary size. Default=false
#define URM37_ENABLED false // Set to "true" to enable support for the URM37 sensor in PWM mode. Default=false
#define TIMER_ENABLED true // Set to "false" to disable the timer ISR (if getting "__vector_7" compile errors set this to false). Default=true
// Probably shouldn't change these values unless you really know what you're doing.
#define NO_ECHO 0 // Value returned if there's no ping echo within the specified MAX_SENSOR_DISTANCE or max_cm_distance. Default=0
#define MAX_SENSOR_DELAY 5800 // Maximum uS it takes for sensor to start the ping. Default=5800
#define ECHO_TIMER_FREQ 24 // Frequency to check for a ping echo (every 24uS is about 0.4cm accuracy). Default=24
#define PING_MEDIAN_DELAY 29000 // Microsecond delay between pings in the ping_median method. Default=29000
#define PING_OVERHEAD 5 // Ping overhead in microseconds (uS). Default=5
#define PING_TIMER_OVERHEAD 13 // Ping timer overhead in microseconds (uS). Default=13
#if URM37_ENABLED == true
#undef US_ROUNDTRIP_CM
#undef US_ROUNDTRIP_IN
#define US_ROUNDTRIP_CM 50 // Every 50uS PWM signal is low indicates 1cm distance. Default=50
#define US_ROUNDTRIP_IN 127 // If 50uS is 1cm, 1 inch would be 127uS (50 x 2.54 = 127). Default=127
#endif
// Conversion from uS to distance (round result to nearest cm or inch).
#define NewPingConvert(echoTime, conversionFactor) (max(((unsigned int)echoTime + conversionFactor / 2) / conversionFactor, (echoTime ? 1 : 0)))
// Detect non-AVR microcontrollers (Teensy 3.x, Arduino DUE, etc.) and don't use port registers or timer interrupts as required.
#if (defined (__arm__) && (defined (TEENSYDUINO) || defined (PARTICLE)))
#undef PING_OVERHEAD
#define PING_OVERHEAD 1
#undef PING_TIMER_OVERHEAD
#define PING_TIMER_OVERHEAD 1
#define DO_BITWISE true
#elif !defined (__AVR__)
#undef PING_OVERHEAD
#define PING_OVERHEAD 1
#undef PING_TIMER_OVERHEAD
#define PING_TIMER_OVERHEAD 1
#undef TIMER_ENABLED
#define TIMER_ENABLED false
#define DO_BITWISE false
#else
#define DO_BITWISE true
#endif
// Disable the timer interrupts when using ATmega128 and all ATtiny microcontrollers.
#if defined (__AVR_ATmega128__) || defined (__AVR_ATtiny24__) || defined (__AVR_ATtiny44__) || defined (__AVR_ATtiny441__) || defined (__AVR_ATtiny84__) || defined (__AVR_ATtiny841__) || defined (__AVR_ATtiny25__) || defined (__AVR_ATtiny45__) || defined (__AVR_ATtiny85__) || defined (__AVR_ATtiny261__) || defined (__AVR_ATtiny461__) || defined (__AVR_ATtiny861__) || defined (__AVR_ATtiny43U__)
#undef TIMER_ENABLED
#define TIMER_ENABLED false
#endif
// Define timers when using ATmega8, ATmega16, ATmega32 and ATmega8535 microcontrollers.
#if defined (__AVR_ATmega8__) || defined (__AVR_ATmega16__) || defined (__AVR_ATmega32__) || defined (__AVR_ATmega8535__)
#define OCR2A OCR2
#define TIMSK2 TIMSK
#define OCIE2A OCIE2
#endif
class NewPing {
public:
NewPing(uint8_t trigger_pin, uint8_t echo_pin, unsigned int max_cm_distance = MAX_SENSOR_DISTANCE);
unsigned int ping(unsigned int max_cm_distance = 0);
unsigned long ping_cm(unsigned int max_cm_distance = 0);
unsigned long ping_in(unsigned int max_cm_distance = 0);
unsigned long ping_median(uint8_t it = 5, unsigned int max_cm_distance = 0);
static unsigned int convert_cm(unsigned int echoTime);
static unsigned int convert_in(unsigned int echoTime);
#if TIMER_ENABLED == true
void ping_timer(void (*userFunc)(void), unsigned int max_cm_distance = 0);
boolean check_timer();
unsigned long ping_result;
static void timer_us(unsigned int frequency, void (*userFunc)(void));
static void timer_ms(unsigned long frequency, void (*userFunc)(void));
static void timer_stop();
#endif
private:
boolean ping_trigger();
void set_max_distance(unsigned int max_cm_distance);
#if TIMER_ENABLED == true
boolean ping_trigger_timer(unsigned int trigger_delay);
boolean ping_wait_timer();
static void timer_setup();
static void timer_ms_cntdwn();
#endif
#if DO_BITWISE == true
uint8_t _triggerBit;
uint8_t _echoBit;
#if defined(PARTICLE)
#if !defined(portModeRegister)
#if defined (STM32F10X_MD)
#define portModeRegister(port) ( &(port->CRL) )
#elif defined (STM32F2XX)
#define portModeRegister(port) ( &(port->MODER) )
#endif
#endif
volatile uint32_t *_triggerOutput;
volatile uint32_t *_echoInput;
volatile uint32_t *_triggerMode;
#else
volatile uint8_t *_triggerOutput;
volatile uint8_t *_echoInput;
volatile uint8_t *_triggerMode;
#endif
#else
uint8_t _triggerPin;
uint8_t _echoPin;
#endif
unsigned int _maxEchoTime;
unsigned long _max_time;
};
#endif
// ---------------------------------------------------------------------------
// NewPing Library - v1.9.1 - 07/15/2018
//
// AUTHOR/LICENSE:
// Created by Tim Eckel - teckel@leethost.com
// Copyright 2018 License: Forks and derivitive works are NOT permitted without
// permission. Permission is only granted to use as-is for private and
// commercial use. If you wish to contribute, make changes, or enhancements,
// please create a pull request. I get a TON of support issues from this
// library, most of which comes from old versions, buggy forks or sites without
// proper documentation, just trying to wrangle this project together.
//
// LINKS:
// Project home: https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home
// Blog: http://arduino.cc/forum/index.php/topic,106043.0.html
//
// DISCLAIMER:
// This software is furnished "as is", without technical support, and with no
// warranty, express or implied, as to its usefulness for any purpose.
//
// BACKGROUND:
// When I first received an ultrasonic sensor I was not happy with how poorly
// it worked. Quickly I realized the problem wasn't the sensor, it was the
// available ping and ultrasonic libraries causing the problem. The NewPing
// library totally fixes these problems, adds many new features, and breaths
// new life into these very affordable distance sensors.
//
// FEATURES:
// * Works with many different ultrasonic sensors: SR04, SRF05, SRF06, DYP-ME007, URM37 & Parallax PING)))™.
// * Compatible with the entire Arduino line-up (and clones), Teensy family (including $19.80 96Mhz 32 bit Teensy 3.2) and non-AVR microcontrollers.
// * Interface with all but the SRF06 sensor using only one Arduino pin.
// * Doesn't lag for a full second if no ping/echo is received.
// * Ping sensors consistently and reliably at up to 30 times per second.
// * Timer interrupt method for event-driven sketches.
// * Built-in digital filter method ping_median() for easy error correction.
// * Uses port registers for a faster pin interface and smaller code size.
// * Allows you to set a maximum distance where pings beyond that distance are read as no ping "clear".
// * Ease of using multiple sensors (example sketch with 15 sensors).
// * More accurate distance calculation (cm, inches & uS).
// * Doesn't use pulseIn, which is slow and gives incorrect results with some ultrasonic sensor models.
// * Actively developed with features being added and bugs/issues addressed.
//
// CONSTRUCTOR:
// NewPing sonar(trigger_pin, echo_pin [, max_cm_distance])
// trigger_pin & echo_pin - Arduino pins connected to sensor trigger and echo.
// NOTE: To use the same Arduino pin for trigger and echo, specify the same pin for both values.
// max_cm_distance - [Optional] Maximum distance you wish to sense. Default=500cm.
//
// METHODS:
// sonar.ping([max_cm_distance]) - Send a ping and get the echo time (in microseconds) as a result. [max_cm_distance] allows you to optionally set a new max distance.
// sonar.ping_in([max_cm_distance]) - Send a ping and get the distance in whole inches. [max_cm_distance] allows you to optionally set a new max distance.
// sonar.ping_cm([max_cm_distance]) - Send a ping and get the distance in whole centimeters. [max_cm_distance] allows you to optionally set a new max distance.
// sonar.ping_median(iterations [, max_cm_distance]) - Do multiple pings (default=5), discard out of range pings and return median in microseconds. [max_cm_distance] allows you to optionally set a new max distance.
// NewPing::convert_in(echoTime) - Convert echoTime from microseconds to inches (rounds to nearest inch).
// NewPing::convert_cm(echoTime) - Convert echoTime from microseconds to centimeters (rounds to nearest cm).
// sonar.ping_timer(function [, max_cm_distance]) - Send a ping and call function to test if ping is complete. [max_cm_distance] allows you to optionally set a new max distance.
// sonar.check_timer() - Check if ping has returned within the set distance limit.
// NewPing::timer_us(frequency, function) - Call function every frequency microseconds.
// NewPing::timer_ms(frequency, function) - Call function every frequency milliseconds.
// NewPing::timer_stop() - Stop the timer.
//
// HISTORY:
// 07/15/2018 v1.9.1 - Added support for ATtiny441 and ATtiny841
// microcontrollers.
// 12/09/2017 v1.9.0 - Added support for the ARM-based Particle devices. If
// other ARM-based microcontrollers adopt a similar timer method that the
// Particle and Teensy 3.x share, support for other ARM-based microcontrollers
// could be possible. Attempt to add to Arduino library manager. License
// changed.
// 07/30/2016 v1.8 - Added support for non-AVR microcontrollers. For non-AVR
// microcontrollers, advanced ping_timer() timer methods are disabled due to
// inconsistencies or no support at all between platforms. However, standard
// ping methods are all supported. Added new optional variable to ping(),
// ping_in(), ping_cm(), ping_median(), and ping_timer() methods which allows
// you to set a new maximum distance for each ping. Added support for the
// ATmega16, ATmega32 and ATmega8535 microcontrollers. Changed convert_cm()
// and convert_in() methods to static members. You can now call them without
// an object. For example: cm = NewPing::convert_cm(distance);
//
// 09/29/2015 v1.7 - Removed support for the Arduino Due and Zero because
// they're both 3.3 volt boards and are not 5 volt tolerant while the HC-SR04
// is a 5 volt sensor. Also, the Due and Zero don't support pin manipulation
// compatibility via port registers which can be done (see the Teensy 3.2).
//
// 06/17/2014 v1.6 - Corrected delay between pings when using ping_median()
// method. Added support for the URM37 sensor (must change URM37_ENABLED from
// false to true). Added support for Arduino microcontrollers like the $20
// 32 bit ARM Cortex-M4 based Teensy 3.2. Added automatic support for the
// Atmel ATtiny family of microcontrollers. Added timer support for the
// ATmega8 microcontroller. Rounding disabled by default, reduces compiled
// code size (can be turned on with ROUNDING_ENABLED switch). Added
// TIMER_ENABLED switch to get around compile-time "__vector_7" errors when
// using the Tone library, or you can use the toneAC, NewTone or
// TimerFreeTone libraries: https://bitbucket.org/teckel12/arduino-toneac/
// Other speed and compiled size optimizations.
//
// 08/15/2012 v1.5 - Added ping_median() method which does a user specified
// number of pings (default=5) and returns the median ping in microseconds
// (out of range pings ignored). This is a very effective digital filter.
// Optimized for smaller compiled size (even smaller than sketches that
// don't use a library).
//
// 07/14/2012 v1.4 - Added support for the Parallax PING)))<29> sensor. Interface
// with all but the SRF06 sensor using only one Arduino pin. You can also
// interface with the SRF06 using one pin if you install a 0.1uf capacitor
// on the trigger and echo pins of the sensor then tie the trigger pin to
// the Arduino pin (doesn't work with Teensy). To use the same Arduino pin
// for trigger and echo, specify the same pin for both values. Various bug
// fixes.
//
// 06/08/2012 v1.3 - Big feature addition, event-driven ping! Uses Timer2
// interrupt, so be mindful of PWM or timing conflicts messing with Timer2
// may cause (namely PWM on pins 3 & 11 on Arduino, PWM on pins 9 and 10 on
// Mega, and Tone library). Simple to use timer interrupt functions you can
// use in your sketches totally unrelated to ultrasonic sensors (don't use if
// you're also using NewPing's ping_timer because both use Timer2 interrupts).
// Loop counting ping method deleted in favor of timing ping method after
// inconsistent results kept surfacing with the loop timing ping method.
// Conversion to cm and inches now rounds to the nearest cm or inch. Code
// optimized to save program space and fixed a couple minor bugs here and
// there. Many new comments added as well as line spacing to group code
// sections for better source readability.
//
// 05/25/2012 v1.2 - Lots of code clean-up thanks to Arduino Forum members.
// Rebuilt the ping timing code from scratch, ditched the pulseIn code as it
// doesn't give correct results (at least with ping sensors). The NewPing
// library is now VERY accurate and the code was simplified as a bonus.
// Smaller and faster code as well. Fixed some issues with very close ping
// results when converting to inches. All functions now return 0 only when
// there's no ping echo (out of range) and a positive value for a successful
// ping. This can effectively be used to detect if something is out of range
// or in-range and at what distance. Now compatible with Arduino 0023.
//
// 05/16/2012 v1.1 - Changed all I/O functions to use low-level port registers
// for ultra-fast and lean code (saves from 174 to 394 bytes). Tested on both
// the Arduino Uno and Teensy 2.0 but should work on all Arduino-based
// platforms because it calls standard functions to retrieve port registers
// and bit masks. Also made a couple minor fixes to defines.
//
// 05/15/2012 v1.0 - Initial release.
// ---------------------------------------------------------------------------
#ifndef NewPing_h
#define NewPing_h
#if defined (ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#if defined (PARTICLE)
#include <SparkIntervalTimer.h>
#else
#include <pins_arduino.h>
#endif
#endif
#if defined (__AVR__)
#include <avr/io.h>
#include <avr/interrupt.h>
#endif
// Shouldn't need to change these values unless you have a specific need to do so.
#define MAX_SENSOR_DISTANCE 500 // Maximum sensor distance can be as high as 500cm, no reason to wait for ping longer than sound takes to travel this distance and back. Default=500
#define US_ROUNDTRIP_CM 57 // Microseconds (uS) it takes sound to travel round-trip 1cm (2cm total), uses integer to save compiled code space. Default=57
#define US_ROUNDTRIP_IN 146 // Microseconds (uS) it takes sound to travel round-trip 1 inch (2 inches total), uses integer to save compiled code space. Defalult=146
#define ONE_PIN_ENABLED true // Set to "false" to disable one pin mode which saves around 14-26 bytes of binary size. Default=true
#define ROUNDING_ENABLED false // Set to "true" to enable distance rounding which also adds 64 bytes to binary size. Default=false
#define URM37_ENABLED false // Set to "true" to enable support for the URM37 sensor in PWM mode. Default=false
#define TIMER_ENABLED true // Set to "false" to disable the timer ISR (if getting "__vector_7" compile errors set this to false). Default=true
// Probably shouldn't change these values unless you really know what you're doing.
#define NO_ECHO 0 // Value returned if there's no ping echo within the specified MAX_SENSOR_DISTANCE or max_cm_distance. Default=0
#define MAX_SENSOR_DELAY 5800 // Maximum uS it takes for sensor to start the ping. Default=5800
#define ECHO_TIMER_FREQ 24 // Frequency to check for a ping echo (every 24uS is about 0.4cm accuracy). Default=24
#define PING_MEDIAN_DELAY 29000 // Microsecond delay between pings in the ping_median method. Default=29000
#define PING_OVERHEAD 5 // Ping overhead in microseconds (uS). Default=5
#define PING_TIMER_OVERHEAD 13 // Ping timer overhead in microseconds (uS). Default=13
#if URM37_ENABLED == true
#undef US_ROUNDTRIP_CM
#undef US_ROUNDTRIP_IN
#define US_ROUNDTRIP_CM 50 // Every 50uS PWM signal is low indicates 1cm distance. Default=50
#define US_ROUNDTRIP_IN 127 // If 50uS is 1cm, 1 inch would be 127uS (50 x 2.54 = 127). Default=127
#endif
// Conversion from uS to distance (round result to nearest cm or inch).
#define NewPingConvert(echoTime, conversionFactor) (max(((unsigned int)echoTime + conversionFactor / 2) / conversionFactor, (echoTime ? 1 : 0)))
// Detect non-AVR microcontrollers (Teensy 3.x, Arduino DUE, etc.) and don't use port registers or timer interrupts as required.
#if (defined (__arm__) && (defined (TEENSYDUINO) || defined (PARTICLE)))
#undef PING_OVERHEAD
#define PING_OVERHEAD 1
#undef PING_TIMER_OVERHEAD
#define PING_TIMER_OVERHEAD 1
#define DO_BITWISE true
#elif !defined (__AVR__)
#undef PING_OVERHEAD
#define PING_OVERHEAD 1
#undef PING_TIMER_OVERHEAD
#define PING_TIMER_OVERHEAD 1
#undef TIMER_ENABLED
#define TIMER_ENABLED false
#define DO_BITWISE false
#else
#define DO_BITWISE true
#endif
// Disable the timer interrupts when using ATmega128 and all ATtiny microcontrollers.
#if defined (__AVR_ATmega128__) || defined (__AVR_ATtiny24__) || defined (__AVR_ATtiny44__) || defined (__AVR_ATtiny441__) || defined (__AVR_ATtiny84__) || defined (__AVR_ATtiny841__) || defined (__AVR_ATtiny25__) || defined (__AVR_ATtiny45__) || defined (__AVR_ATtiny85__) || defined (__AVR_ATtiny261__) || defined (__AVR_ATtiny461__) || defined (__AVR_ATtiny861__) || defined (__AVR_ATtiny43U__)
#undef TIMER_ENABLED
#define TIMER_ENABLED false
#endif
// Define timers when using ATmega8, ATmega16, ATmega32 and ATmega8535 microcontrollers.
#if defined (__AVR_ATmega8__) || defined (__AVR_ATmega16__) || defined (__AVR_ATmega32__) || defined (__AVR_ATmega8535__)
#define OCR2A OCR2
#define TIMSK2 TIMSK
#define OCIE2A OCIE2
#endif
class NewPing {
public:
NewPing(uint8_t trigger_pin, uint8_t echo_pin, unsigned int max_cm_distance = MAX_SENSOR_DISTANCE);
unsigned int ping(unsigned int max_cm_distance = 0);
unsigned long ping_cm(unsigned int max_cm_distance = 0);
unsigned long ping_in(unsigned int max_cm_distance = 0);
unsigned long ping_median(uint8_t it = 5, unsigned int max_cm_distance = 0);
static unsigned int convert_cm(unsigned int echoTime);
static unsigned int convert_in(unsigned int echoTime);
#if TIMER_ENABLED == true
void ping_timer(void (*userFunc)(void), unsigned int max_cm_distance = 0);
boolean check_timer();
unsigned long ping_result;
static void timer_us(unsigned int frequency, void (*userFunc)(void));
static void timer_ms(unsigned long frequency, void (*userFunc)(void));
static void timer_stop();
#endif
private:
boolean ping_trigger();
void set_max_distance(unsigned int max_cm_distance);
#if TIMER_ENABLED == true
boolean ping_trigger_timer(unsigned int trigger_delay);
boolean ping_wait_timer();
static void timer_setup();
static void timer_ms_cntdwn();
#endif
#if DO_BITWISE == true
uint8_t _triggerBit;
uint8_t _echoBit;
#if defined(PARTICLE)
#if !defined(portModeRegister)
#if defined (STM32F10X_MD)
#define portModeRegister(port) ( &(port->CRL) )
#elif defined (STM32F2XX)
#define portModeRegister(port) ( &(port->MODER) )
#endif
#endif
volatile uint32_t *_triggerOutput;
volatile uint32_t *_echoInput;
volatile uint32_t *_triggerMode;
#else
volatile uint8_t *_triggerOutput;
volatile uint8_t *_echoInput;
volatile uint8_t *_triggerMode;
#endif
#else
uint8_t _triggerPin;
uint8_t _echoPin;
#endif
unsigned int _maxEchoTime;
unsigned long _max_time;
};
#endif

View File

@ -11,7 +11,7 @@
src_dir = sonoff
; *** Uncomment one of the lines below to build/upload only one environment
env_default = sonoff
;env_default = sonoff
;env_default = sonoff-minimal
;env_default = sonoff-basic
;env_default = sonoff-classic
@ -67,7 +67,7 @@ build_flags =
; if using esp8266 core < 2.5.0
-Wl,-Tesp8266.flash.1m0.ld -Wl,-Map,firmware.map
-mtarget-align
; -DUSE_CONFIG_OVERRIDE
; -DUSE_CONFIG_OVERRIDE
; lwIP 1.4 (Default)
; -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH
; lwIP 2 - Low Memory
@ -77,13 +77,14 @@ build_flags =
; lwIP 2 - Higher Bandwitdh no Features
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
; lwIP 2 - Higher Bandwitdh Low Memory no Features
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH
; -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH
; VTABLES in Flash (default)
-DVTABLES_IN_FLASH
; VTABLES in Heap
; -DVTABLES_IN_DRAM
; VTABLES in IRAM
; -DVTABLES_IN_IRAM
; if using esp8266 core 2.5.0 (stage) or up
; No exception code in firmware
; -fno-exceptions
; -lstdc++-nox
; if using esp8266 core 2.5.0 (stage) or up
; enable one option set -> No exception recommended
@ -92,7 +93,7 @@ build_flags =
; -lstdc++-nox
; Exception code in firmware /needs much space! 90k
; -fexceptions
; -lstdc++
; -lstdc++
; *** Serial Monitor options
monitor_speed = 115200

View File

@ -1,251 +1,152 @@
/* 6.3.0.17 20181211
* Add support for decoding Theo V2 sensors as documented on https://sidweb.nl using 434MHz RF sensor receiver
* Add support for decoding Alecto V2 sensors like ACH2010, WS3000 and DKW2012 using 868MHz RF sensor receiver
* Add support for SDM220 (#3610)
* Add support for Manzoku Power Strip (#4590)
* Enhance support for MPU6050 using DMP (#4581)
* Fix ArduinoOTA for Core 2.5.0 (fix is backwards compatible) (#4620)
*
* 6.3.0.16 20181201
* Add support for iFan02 Fanspeed in Domoticz using a selector (#4517)
* Add Announce Switches to MQTT Discovery (#4531)
* Update MCP230xx driver to support interrupt retention over teleperiod (#4547)
*
* 6.3.0.15 20181201
* Removed command SetOption36 (#4497)
* Add command SetOption60 0/1 to select dynamic sleep (0) or sleep (1) (#4497)
* Update SR-04 driver to use NewPing library (#4488)
* Add support for GPIO02 for newer Sonoff Basic (#4518)
*
* 6.3.0.14 20181127
* Add command CalcRes to set number of decimals (0 - 7) used in commands ADD, SUB, MULT and SCALE (#4420)
* Add support for SM Smart Wifi Dimmer PS-16-DZ (#4465)
* Move some static (serial) buffers to dynamic buffers
* Update display and epaper drivers
* Fix intermittent Pzem sensor energy overflow calculation error
* Add support for Teckin US Power Socket with Energy Monitoring (#4481)
*
* 6.3.0.13 20181126
* Add command SetOption59 0/1 to change state topic from tele/STATE to stat/RESULT (#4450)
* Fix WifiManager functionality on initial installation (#4433)
*
* 6.3.0.12 20181122
* Remove delays introduced in 6.3.0.11 (#4233)
* Add additional start-up delay during initial wifi connection
* Add support for I2C MGC3130 Electric Field Effect sensor by Christian Baars (#3774, #4404)
* Add initial support for Hass sensor discovery (#4380)
* Fix possible strncat buffer overflows
* Fix MqttRetry values above 255 seconds (#4424)
* Increase webui refresh time delay for Save Settings and local OTA Upload (#4423)
* Add CPU average load to state message (#4431)
*
* 6.3.0.11 20181120
* Add delays removed in 6.3.0.9 (#4233)
* Allow user definition of defines WIFI_RSSI_THRESHOLD (default 10) and WIFI_RESCAN_MINUTES (default 44)
* Add support for Fujitsu HVac and IrRemote (#4387)
* Add command SetOption58 0/1 to enable IR raw data info in JSON message (#2116)
* Add command IRSend <frequency>|0,<rawdata1>,<rawdata2>,.. to allow raw data transmission (#2116)
/* 6.4.0 20181217
* Change GUI Configure Module by using AJAX for data fetch to cut page size (and memory use) by 40%
In case of web page errors clear your browser cache or do Page Reload (F5 or Ctrl+R)
* Change enforcing flashmode dout but it is still mandatory
* Change bootcount update (being first) flash write to 10 seconds after restart
* Change display and epaper drivers
* Change command WebSend Host header field from IP address to hostname (#4331)
* Change log buffer size from 512 to 520 to accommodate http sensor data (#4354)
* Change default WIFI_CONFIG_TOOL from WIFI_WAIT to WIFI_RETRY in my_user_config.h (#4400)
*
* 6.3.0.10 20181118
* Add command SetOption36 0..255 milliseconds (50 default) to tune main loop dynamic delay
* Add support for LG HVac and IrRemote (#4377)
* Add command SetOption56 0/1 to enable wifi network scan and select highest RSSI (#3173)
* Add command SetOption57 0/1 to enable wifi network re-scan every 44 minutes with a rssi threshold of 10 to select highest RSSI (#3173)
* Fix MQTT connection error after restart
* Fix wifi re-scan connection baseline
*
* 6.3.0.9 20181118
* Moved command SetSensorXX to debugging driver freeing user code space
* Add dynamic delay to main loop providing time for wifi background tasks
* Remove delays introduced in 6.3.0.1 (#4233)
*
* 6.3.0.8 20181115
* Stop enforcing flashmode dout but it is still mandatory
* Moved bootcount update (being first) flash write to 10 seconds after restart
* Add support for Armtronix dimmers. See wiki for info (#4321)
*
* 6.3.0.7 20181111
* Change webgui refresh time delay for Save Settings and local OTA Upload (#4423)
* Change SR-04 driver to use NewPing library (#4488)
* Change MCP230xx driver to support interrupt retention over teleperiod (#4547)
* Change support for MPU6050 using DMP (#4581)
* Fix unintended function overload of WifiState
* Fix wifi connection errors using wifi disconnect and ESP.reset instead of ESP.restart
* Fix Sonoff Pow R2 and Sonoff S31 Serial interface hang caused by Sonoff Basic R2 driver delay implementation (and possibly core bug)
* Change command WebSend Host header field from IP address to hostname (#4331)
* Add to command WebSend option to send a direct path when command starts with a slash (#4329)
* Consolidate LTrim into Trim
* Increase log buffer size from 512 to 520 to accommodate http sensor data (#4354)
*
* 6.3.0.6 20181110
* Change GUI Configure Module by using AJAX for data fetch to cut page size (and memory use) by 40%
* In case of web page errors clear your browser cache or do Page Reload (F5 or Ctrl+R)
*
* 6.3.0.5 20181107
* Add code image and optional commit number to version
* Add support for Gosund SP1 v2.3 Power Socket with Energy Monitoring (#4297)
* Fix MQTT connection error after restart
* Fix wifi re-scan connection baseline
* Fix possible strncat buffer overflows
* Fix intermittent Pzem sensor energy overflow calculation error
* Fix shelly2 ghost switching caused by lack of pull-up inputs (#4255)
*
* 6.3.0.4 20181106
* Add command SetSensorXX 0/1 to disable/re-enable compiled xsns_XX_sensor.ino driver
*
* 6.3.0.3 20181105
* Fix hardware serial pin configuration. To keep using hardware serial swap current Rx/Tx pin configuration only (#4280)
* Add more strict checks for GPIO selections
* Add optional hardware serial when GPIO13(Rx) and GPIO15(Tx) are selected removing hardware serial from GPIO01(Tx) and GPIO03(Rx) (#4288)
* Bump TasmotaSerial version from 2.1.0 to 2.2.0
*
* 6.3.0.2 20181101
* Fix MqttRetry values above 255 seconds (#4424)
* Fix WifiManager functionality on initial installation (#4433)
* Fix ArduinoOTA for Core 2.5.0 (#4620)
* Add minutes to commands Timezone to allow all possible world timezones
* Add command SetOption24 0/1 to select pressure unit as hPa or mmHg (#4241)
*
* 6.3.0.1 20181031
* Add wifi status to Tuya (#4221)
* Add more strict checks for GPIO selections
* Add code image and optional commit number to version
* Add dynamic delay to main loop providing time for wifi background tasks
* Add additional start-up delay during initial wifi connection
* Add support for decoding Theo V2 sensors as documented on https://sidweb.nl using 434MHz RF sensor receiver
* Add support for decoding Alecto V2 sensors like ACH2010, WS3000 and DKW2012 weather stations using 868MHz RF sensor receiver
* Add user definition of defines WIFI_RSSI_THRESHOLD (default 10) and WIFI_RESCAN_MINUTES (default 44)
* Add command SetOption58 0/1 to enable IR raw data info in JSON message (#2116)
* Add command IRSend <frequency>|0,<rawdata1>,<rawdata2>,.. to allow raw data transmission (#2116)
* Add command SetOption56 0/1 to enable wifi network scan and select highest RSSI (#3173)
* Add command SetOption57 0/1 to enable wifi network re-scan every 44 minutes with a rssi threshold of 10 to select highest RSSI (#3173)
* Add support for SDM220 (#3610)
* Add default sleep 1 to sonoff-basic to lower energy consumption (#4217)
* Fix unintended function overload of WifiState
* Add wifi status to Tuya (#4221)
* Add delays to reduce CPU usage at boot time (#4233)
* Add command SetOption24 0/1 to select pressure unit as hPa or mmHg (#4241)
* Add optional hardware serial when GPIO13(Rx) and GPIO15(Tx) are selected removing hardware serial from GPIO01(Tx) and GPIO03(Rx) (#4288)
* Add support for Gosund SP1 v2.3 Power Socket with Energy Monitoring (#4297)
* Add support for Armtronix dimmers. See wiki for info (#4321)
* Add to command WebSend option to send a direct path when command starts with a slash (#4329)
* Add support for LG HVac and IrRemote (#4377)
* Add initial support for Hass sensor discovery (#4380)
* Add support for Fujitsu HVac and IrRemote (#4387)
* Add support for I2C MGC3130 Electric Field Effect sensor by Christian Baars (#3774, #4404)
* Add command CalcRes to set number of decimals (0 - 7) used in commands ADD, SUB, MULT and SCALE (#4420)
* Add CPU average load to state message (#4431)
* Add command SetOption59 0/1 to change state topic from tele/STATE to stat/RESULT (#4450)
* Add support for SM Smart Wifi Dimmer PS-16-DZ (#4465)
* Add support for Teckin US Power Socket with Energy Monitoring (#4481)
* Add command SetOption60 0/1 to select dynamic sleep (0) or sleep (1) (#4497)
* Add support for iFan02 Fanspeed in Domoticz using a selector (#4517)
* Add support for GPIO02 for newer Sonoff Basic (#4518)
* Add Announce Switches to MQTT Discovery (#4531)
* Add support for Manzoku Power Strip (#4590)
*
* 6.3.0 20181030
* Release of v6.3.0
*
* 6.2.1.20 20181028
* Add command SetOption35 0..255 (seconds) to delay mDNS initialization to control possible Wifi connect problems
* Add command SetOption53 0/1 to toggle gui display of Hostname and IP address (#1006, #2091)
* Add token %hostname% to command FullTopic (#3018)
* Add support for two BMP/BME sensors (#4195)
* Add TotalStartTime to Energy JSON message (#3971)
*
* 6.2.1.19 20181023
* Change web Configure Module GPIO drop down list order for better readability
* Change status JSON message providing more switch and retain information
* Change xsns_17_senseair.ino to use TasmotaModbus library
* Change MCP230xx driver
* Change PubSubClient Mqtt library to non-blocking EspEasy version
* Change energy monitoring using energy sensor driver modules
* Change Webserver page handler for easier extension (thx to Adrian Scillato)
* Change pinmode for no-pullup defined switches to pullup when configured as switchmode PUSHBUTTON (=3 and up) (#3896)
* Change default OTA Url to http://thehackbox.org/tasmota/release/sonoff.bin (#4170)
* Remove support for MQTT Client esp-mqtt-arduino by #define MQTT_LIBRARY_TYPE MQTT_ESPMQTTARDUINO
* Remove commands PowerCal, VoltageCal and CurrentCal as more functionality is provided by commands PowerSet, VoltageSet and CurrentSet
* Remove restart after ntpserver change and force NTP re-sync (#3890)
* Fix showing Period Power in energy threshold messages
* Fix header file execution order by renaming user_config.h to my_user_config.h
* Fix some TSL2561 driver issues (#3681)
* Fix KNX PA exception. Regression from 6.2.1 buffer overflow caused by subStr() (#3700, #3710)
* Fix setting and getting color temperature for Philips Hue emulation (#3733)
* Fix ButtonRetain to not use default topic for clearing retain messages (#3737)
* Fix syslog when emulation is selected (#2109, #3784)
* Fix rule trigger POWER1#STATE execution after restart and SetOption0 is 0 (#3856)
* Fix Home Assistant forced light discovery (#3908)
* Fix invalid configuration restores and decode_config.py crc error when savedata = 0 (#3918)
* Fix timer offset -00:00 causing 12:00 hour offset (#3923)
* Fix I2CScan invalid JSON error message (#3925)
* Fix exception when wrong Domoticz JSON message is received (#3963)
* Fix Sonoff Bridge RfRaw receive (#4080, #4085)
* Fix possible wifi connection error (#4044, #4083)
* Fix invalid JSON floating point result from nan (Not a Number) and inf (Infinity) into null (#4147)
* Fix rule mqtt#connected trigger when mqtt is disabled (#4149)
* Initial release of RF transceiving using library RcSwitch (#2702)
* Change default OTA Url to http://thehackbox.org/tasmota/release/sonoff.bin (#4170)
* Add Tuya Software Serial to support additional Tuya configurations (#4178)
* Add define USE_BASIC for selecting image sonoff-basic without most sensors
*
* 6.2.1.18 20181019
* Add more API callbacks and document API.md
* Add support for La Crosse TX20 Anemometer (#2654, #3146)
* Add optional HX711 scale interface to web GUI demonstrating easy GUI plug-in
* Resize HX711 weight_item field from 16 bit to 32 bit
*
* 6.2.1.17 20181017
* Enable updated non-blocking PubSubClient as default MQTT client
* Update TasmotaModbus and TasmotaSerial libraries for support of serial 8N2 communication
* Add support for Pzem-003/017 DC Energy monitoring module (#3694)
* Change support for Pzem-014/016 AC Energy monitoring module (#3694)
* Rewrite Tuya Dimmer code
*
* 6.2.1.16 20181015
* Add TasmotaModbus library for very basic modbus wrapper for TasmotaSerial
* Change xsns_17_senseair.ino to use TasmotaModbus library
* Fix xnrg_05_pzem2.ino for PZEM-014/016 support using TasmotaModbus library (#3694)
* Fix RfRaw and SerialSend5 regression from 6.2.1.15 (#4072)
* Fix Sonoff Bridge RfRaw receive (#4080, #4085)
* Add support for Tuya Dimmer (#469, #4075)
* Fix possible wifi connection error (#4044, #4083)
* Update PubSubClient Mqtt library to non-blocking EspEasy version
*
* 6.2.1.15 20181012
* Fix Color Temperature slider functionality regression from 6.2.1.5 (#4037)
* Add auto reload of main web page to some web restarts
* Add whitespace removal from RfRaw and SerialSend5 (#4020)
* Add commands Reset 4 (reset to defaults but keep wifi params) and Reset 5 (as reset 4 and also erase flash) (#4061)
*
* 6.2.1.14 20181010
* Rewrite Webserver page handler for easier extension (thx to Adrian Scillato)
* Add support for DS3231 Real Time Clock
* Add support for HX711 Load Cell
* Add command WeightRes 0..3 to control display of decimals for kilogram
*
* 6.2.1.13 20181008
* Change default Mqtt client library from PubSubClient to non-blocking ArduinoMqtt by Joel Gaehwiler
* Add command WebRefresh 1000..10000 to control web page refresh in milliseconds. Default is 2345
*
* 6.2.1.12 20181007
* Fix Shelly1 switchmode 3 and 4 when using pushbutton (#3989)
* Add support for CSL Aplic WDP 303075 Power Socket with Energy Monitoring (#3991, #3996)
*
* 6.2.1.11 20181002
* Remove support for MQTT Client based on esp-mqtt-arduino by #define MQTT_LIBRARY_TYPE MQTT_ESPMQTTARDUINO
* Add support for MQTT Client based on lwmqtt to be selected by #define MQTT_LIBRARY_TYPE MQTT_ARDUINOMQTT
* Change MQTT_ARDUINOMQTT command timeout from 1 to 10 seconds
* Add Hebrew language file (#3960)
* Fix exception when wrong Domoticz JSON message is received (#3963)
*
* 6.2.1.10 20180930
* Add command RGBWWTable to support color calibration (#3933)
* Add support for LCD, Matrix, TFT and Oled displays
* Add support for Neo Coolcam Wifi Smart Power Plug
* Add support for Michael Haustein ESP Switch
* Add support for MQTT Client based on lwmqtt to be selected by #define MQTT_LIBRARY_TYPE MQTT_ARDUINOMQTT
* Add support for Neo Coolcam Wifi Smart Power Plug
* Add support for Michael Haustein ESP Switch
* Add support for MQTT Client based on lwmqtt to be selected by #define MQTT_LIBRARY_TYPE MQTT_ARDUINOMQTT
* Add support for DS3231 Real Time Clock
* Add support for HX711 Load Cell with optional web GUI scale interface to demonstrate easy GUI plug-in
* Add support for serial 8N2 communication to TasmotaModbus and TasmotaSerial libraries
* Add support for RF transceiving using library RcSwitch (#2702)
* Add support for Shelly 1 and Shelly 2 (#2789)
* Add support for La Crosse TX20 Anemometer (#2654, #3146)
* Add support for MP3 player using DFRobot RB-DFR-562 (#3723)
* Add Support for Xiaomi-Philips Bulbs (#3787)
* Add support for PCA9685 12bit 16pin hardware PWM driver (#3866)
* Add support for EXS Relay V5.0 (#3810)
* Fix timer offset -00:00 causing 12:00 hour offset (#3923)
* Add support for OBI Power Socket (#1988, #3944)
* Add support for Teckin Power Socket with Energy Monitoring (#3950)
*
* 6.2.1.9 20180928
* Add Apparent Power and Reactive Power to Energy Monitoring devices (#251)
* Add RF Receiver control to module MagicHome to be used on Arilux LC10 (#3792)
* Fix I2CScan invalid JSON error message (#3925)
* Fix invalid configuration restores and decode_config.py crc error when savedata = 0 (#3918)
*
* 6.2.1.8 20180926
* Change status JSON message providing more switch and retain information
* Change pinmode for no-pullup defined switches to pullup when configured as switchmode PUSHBUTTON (=3 and up) (#3896)
* Add delay after restart before processing rule sensor data (#3811)
* Fix Home Assistant forced light discovery (#3908)
* Add rule triggers SWITCH1#BOOT and POWER1#BOOT (#3904, #3910)
* Add support for Neo Coolcam Wifi Smart Power Plug
*
* 6.2.1.7 20180925
* Remove restart after ntpserver change and force NTP re-sync (#3890)
* Release full Shelly2 support
* Released tools/decode-config.py by Norbert Richter to decode configuration data. See file for information
* Add define USE_DISPLAYS for selecting image sonoff-display
*
* 6.2.1.6 20180922
* Removed commands PowerCal, VoltageCal and CurrentCal as more functionality is provided by commands PowerSet, VoltageSet and CurrentSet
* Allow decimals as input to commands PowerSet, VoltageSet and CurrentSet
* Add support for PCA9685 12bit 16pin hardware PWM driver (#3866)
* Add power value below 5W to Sonoff Pow R2 and S31 (#3745)
* Add force_update to Home Assistant discovery (#3873)
* Fix rule trigger POWER1#STATE execution after restart and SetOption0 is 0 (#3856)
* Disable serial logging on Shelly2 as serial is being used by energy monitoring (#3878)
* Fix Shelly2 wrong FrequencySet calculation and add input range checks (#3882)
*
* 6.2.1.5 20180921
* Add authentication to HTTP web pages
* Add energy monitoring to Shelly2 (#2789)
* Rewrite TSL2561 driver to fix some issues (#3681)
*
* 6.2.1.4 20180916
* Add support for Pzem-003/017 DC Energy monitoring module (#3694)
* Add support for Pzem-014/016 AC Energy monitoring module (#3694)
* Add support for CSL Aplic WDP 303075 Power Socket with Energy Monitoring (#3991, #3996)
* Add support for Tuya Dimmer (#469, #4075)
* Add command Display to show all settings at once
* Add command SerialSend5 to send raw serial data like "A5074100545293"
* Update MCP230xx driver
* Update Czech translation
* Update MP3 driver (#3800)
* Add userid/password option to decode-status.py (#3796)
* Fix syslog when emulation is selected (#2109, #3784)
* Fix Pzem2 compilation error (#3766, #3767)
* Add uncalibrated energy monitoring to Shelly2 (#2789)
*
* 6.2.1.3 20180907
* Change web Configure Module GPIO drop down list order for better readability
* Fix showing Period Power in energy threshold messages
* Fix ButtonRetain to not use default topic for clearing retain messages (#3737)
* Add command WebRefresh 1000..10000 to control web page refresh in milliseconds. Default is 2345
* Add command WeightRes 0..3 to control display of decimals for kilogram
* Add command RGBWWTable to support color calibration (#3933)
* Add command Reset 4 (reset to defaults but keep wifi params) and Reset 5 (as reset 4 and also erase flash) (#4061)
* Add command SetOption35 0..255 (seconds) to delay mDNS initialization to control possible Wifi connect problems
* Add command SetOption52 0/1 to control display of optional time offset from UTC in JSON messages (#3629, #3711)
* Add command SetOption53 0/1 to toggle gui display of Hostname and IP address (#1006, #2091)
* Add authentication to HTTP web pages
* Add decimals as input to commands PowerSet, VoltageSet and CurrentSet
* Add tools/decode-config.py by Norbert Richter to decode configuration data. See file for information
* Add define USE_DISPLAYS for selecting image sonoff-display
* Add define USE_BASIC for selecting image sonoff-basic without most sensors
* Add auto reload of main web page to some web restarts
* Add TasmotaModbus library as very basic modbus wrapper for TasmotaSerial
* Add more API callbacks and document API.md
* Add Apparent Power and Reactive Power to Energy Monitoring devices (#251)
* Add token %hostname% to command FullTopic (#3018)
* Add Wifi channel number to state message (#3664)
* Add user configurable GPIO02 and GPIO03 on H801 devices (#3692)
* Add toggle function RGBW lights (#3695, #3697)
* Add network information to display start screen (#3704)
* Add sleep to Nova Fitness SDS01X sensor (#2841, #3724, #3749)
* Add Analog input AD0 enabled to sonoff-sensors.bin (#3756, #3757)
* Add Support for Xiaomi-Philips Bulbs (#3787)
*
* 6.2.1.2 20180906
* Fix KNX PA exception. Regression from 6.2.1 buffer overflow caused by subStr() (#3700, #3710)
* Add command SetOption52 to control display of optional time offset from UTC in JSON messages (#3629, #3711)
* Add experimental support for PZEM-003,014,016,017 Energy monitoring (#3694)
* Add basic support for MP3 player using DFRobot RB-DFR-562 (#3723)
* Fix setting and getting color temperature for Philips Hue emulation (#3733)
*
* 6.2.1.1 20180905
* Rewrite energy monitoring using energy sensor driver modules
* Add Wifi channel number to state message (#3664)
* Add support for Shelly 1 and basic support for Shelly 2 - No energy monitoring yet (#2789)
* Add network information to display start screen (#3704)
* Add command Display to show all settings at once
* Add toggle function RGBW lights (#3695, #3697)
* Add user configurable GPIO02 and GPIO03 on H801 devices (#3692)
* Add power value below 5W to Sonoff Pow R2 and S31 (#3745)
* Add RF Receiver control to module MagicHome to be used on Arilux LC10 (#3792)
* Add userid/password option to decode-status.py (#3796)
* Add delay after restart before processing rule sensor data (#3811)
* Add force_update to Home Assistant discovery (#3873)
* Add rule triggers SWITCH1#BOOT and POWER1#BOOT (#3904, #3910)
* Add Hebrew language file (#3960)
* Add TotalStartTime to Energy JSON message (#3971)
* Add whitespace removal from RfRaw and SerialSend5 (#4020)
* Add support for two BMP/BME sensors (#4195)
*
* 6.2.1 20180905
* Fix possible ambiguity on command parameters if StateText contains numbers only (#3656)

View File

@ -401,7 +401,7 @@
//#define USE_RF_SENSOR // Add support for RF sensor receiver (434MHz or 868MHz) (+0k8 code)
// #define USE_THEO_V2 // Add support for decoding Theo V2 sensors as documented on https://sidweb.nl using 434MHz RF sensor receiver (+1k4 code)
// #define USE_ALECTO_V2 // Add support for decoding Alecto V2 sensors like ACH2010, WS3000 and DKW2012 using 868MHz RF sensor receiver (+1k7 code)
// #define USE_ALECTO_V2 // Add support for decoding Alecto V2 sensors like ACH2010, WS3000 and DKW2012 weather stations using 868MHz RF sensor receiver (+1k7 code)
/*********************************************************************************************\
* Debug features are only supported in development branch

View File

@ -20,7 +20,7 @@
#ifndef _SONOFF_VERSION_H_
#define _SONOFF_VERSION_H_
#define VERSION 0x06030011
#define VERSION 0x06040000
#define D_PROGRAMNAME "Sonoff-Tasmota"
#define D_AUTHOR "Theo Arends"

View File

@ -1,406 +0,0 @@
:020000040000FA
:10000000020FEFED24F8FEEFD39E4015ED2408FD1E
:10001000E433FCC3EF9DEC6480F874809850028058
:1000200001C322020ED0E4F5A922220213637EFF4F
:10003000EFD394004022EF9480501DE4FDED75F065
:100040000EA424A5F582E43418F583E493B50704DF
:10005000AE0580040DBD05E5AF062202110612189B
:100060004E53D87853DBFE12180FE4900085F0222F
:10007000D2DE220213B6D2011215F6C290C296D277
:1000800080E4FBFD7F101217F612064374A4F0D231
:10009000AFE4F52FF530D2960530E5307002052F2C
:1000A000B410F3E52FB427EEC29630010912150DF6
:1000B0008E328F338006753201753300E53370045C
:1000C000E532640170409000CCE07007F52FF53008
:1000D0000202870530E5307002052FD39410E52F1A
:1000E00094274002D296D3E5309430E52F94755092
:1000F00003020287E4F52FF5309000CCF09000CB9E
:10010000F0C296020287E4F52FF5309000CCE0149F
:10011000602A14700302025914700302021E147044
:100120000302023424046003020287E53364AA60F8
:10013000030202879000CC04F0020287E5339000AE
:10014000CBF0A37402F0E5331208B30206A00170ED
:10015000A10182A501A6A601BAA701C3A801DFA932
:1001600001C6B001CFB10197C00287FF00000215A0
:100170001205E69000A87401F0E4900075F07FA1EC
:10018000806E12005E9000CC7404F0753108E4F5C6
:10019000357534090202879000CC7404F0E4F5351B
:1001A000753402020287E49000A8F0900075F07F99
:1001B000A612067474A6F002028712064374A4F015
:1001C0000202877531089000CC7403F00202879018
:1001D00000757401F07FB1120674EFF0020287120D
:1001E00005E69000A8E0F52EE4F0900075F07FA9F8
:1001F0001214D090007CEFF07D307C757F017E0082
:1002000012164902028712065790007CEFF0E49024
:1002100000CCF08072E49000CBF0A3F08069E4F5AC
:1002200035E533F534E534D394009000CC402574A3
:1002300004F0805374042535F582E43400F583E539
:1002400033F00535E53565346007E535C394704016
:10025000369000CC7402F0802EE5336455702890FF
:1002600000CCF0C2019000CBE02460601824FC6058
:100270000F24FE600B14600824F66004241070073D
:100280007FA01217C3D2019000CBE01208B302B0D6
:10029000A102DAA402ECA503C5A603E1A8051FA9E3
:1002A000055CB005CFB1038DC003B3FF000000AA09
:1002B000900084E030E70F7DC87C001206167FA313
:1002C00012140902053912180740030200AA7DE83A
:1002D0007C031206167FA2020554900084E020E7FA
:1002E000030200AA7FA41214090203D99000CCE0F3
:1002F00060030200AA900085E024FC606D24046085
:10030000030200AA1531900008E0FEA3E0FF7C0084
:100310007D641208D9C006C0071215A0D007D00608
:100320001208218F3E900006E0FEA3E0FF8E3FF50D
:10033000407C007D641208D9C006C0071215A0D009
:1003400007D0061208218F41754218900008E0FA84
:10035000A3E0FB900004E0FCA3E0FDA3E0FEA3E02B
:10036000FF12067B7406F00204EBE53160171206FB
:100370002DD39400500302051012062D12066012B0
:1003800018400205101206577FA00205549000CCB9
:10039000E060030200AA900004E0FCA3E0FD7F01FE
:1003A0007E00121649D296121840C2967FA01217EC
:1003B000C3800AE4FF1217C3E49000CCF0D201120C
:1003C000066B0200AA900084E020E7030200AA5412
:1003D0007FF537FD7FA612130CE4900084F0020035
:1003E000AA9000CCE060030200AA900085E024FC03
:1003F00070030204F1240460030200AA1531120004
:100400005E900004E0647F702FA3E0FEA3E0FFA3F2
:10041000E0FCA3E0FDA3E0FAA3E0FBA3E0F53EA32C
:10042000E0F53FA3E0F540A3E0F541A3E0F542127B
:10043000067B740CF00204E2900004E0FF12002E30
:100440008F36E536F470030204DDEF75F00EA42458
:1004500060F582E43418F583E493FE740193FFC0E1
:1004600006C0071215BA2462F582E434181215C1C9
:10047000C004C0051215BA2465F582E43418F5836A
:10048000E493FA740193FB1215BA2469F582E434FB
:1004900018F583E493FF1215BA2467F582E4341843
:1004A0001215C11215BA246AF582E43418F583E4F2
:1004B00093FE1215BA246BF582E43418F583E493A5
:1004C000F5428E418C3F8D408F3ED005D004D00741
:1004D000D0061212929000747401F08005E490002E
:1004E000CBF09000CBE070030200AA121749020083
:1004F000AAE53160231215BA246CF582E43418F5AC
:1005000083E493FFD394004007EF12066012184073
:10051000E4900085F00200AA12066B7FA08035905F
:100520000084E0FF30E71C547FF5377DC87C001263
:1005300005F9AD377FAB12130CE4900084F0D201C3
:100540000200AA12180740030200AA7DE87C0312E9
:1005500005F97FAA1217C3D2010200AA900004E095
:1005600025E0F5379000CCE060030200AA900085FA
:10057000E0700512005E800B900085E0640460036B
:100580000200AAE5376007E534C394045008E490FC
:1005900000CBF00200AA74062537F9E43400753B5D
:1005A00001F53C893DC3E534953724FEF53E9000C6
:1005B00005E0F53F7B017A00790612118B7FA012CE
:1005C00017C390007CE0FF1214D0D2010200AA9061
:1005D0000084E020E7030200AA7FB1121210E49029
:1005E0000084F00200AA7D327C007F017E0012169A
:1005F00049D296121840C296227F017E00121649F7
:10060000D296121840C2969000A8E52EF090007C79
:10061000E0FF1214D0227F017E00121649D29612FA
:100620001840C29690007CE0FF1214D0227F011285
:10063000002EEF75F00EA4246CF582E43418F583D7
:10064000E493229000A87401F0E4900075F07FA478
:100650001214D090007C2290007CE0FF1214D02273
:10066000FD7C007F017E001216492290007CE0FF95
:100670001214D0221214D090007C221212929000F8
:100680007422BB010CE58229F582E5833AF583E00B
:10069000225006E92582F8E622BBFE06E92582F80B
:1006A000E222E58229F582E5833AF583E49322BBD1
:1006B000010689828A83F0225002F722BBFE01F3F1
:1006C00022EF8DF0A4A8F0CF8CF0A428CE8DF0A45A
:1006D0002EFE22BC000BBE0029EF8DF084FFADF092
:1006E00022E4CCF875F008EF2FFFEE33FEEC33FC7C
:1006F000EE9DEC984005FCEE9DFE0FD5F0E9E4CEB2
:10070000FD22EDF8F5F0EE8420D21CFEADF075F080
:1007100008EF2FFFED33FD4007985006D5F0F22289
:10072000C398FD0FD5F0EA22C2D5EC30E709B2D567
:10073000E4C39DFDE49CFCEE30E715B2D5E4C39F15
:10074000FFE49EFE1206D3C3E49DFDE49CFC8003FF
:100750001206D330D507C3E49FFFE49EFE22BB01FF
:1007600010E58229F582E5833AF583E0F5F0A3E010
:10077000225009E92582F886F008E622BBFE0AE944
:100780002582F8E2F5F008E222E5832AF583E99371
:10079000F5F0A3E99322E88FF0A4CC8BF0A42CFC15
:1007A000E98EF0A42CFC8AF0EDA42CFCEA8EF0A4D7
:1007B000CDA8F08BF0A42DCC3825F0FDE98FF0A466
:1007C0002CCD35F0FCEB8EF0A4FEA9F0EB8FF0A45D
:1007D000CFC5F02ECD39FEE43CFCEAA42DCE35F099
:1007E000FDE43CFC2275F008758200EF2FFFEE332C
:1007F000FECD33CDCC33CCC58233C5829BED9AEC94
:1008000099E58298400CF582EE9BFEED9AFDEC99FD
:10081000FC0FD5F0D6E4CEFBE4CDFAE4CCF9A88207
:1008200022B800C1B90059BA002DEC8BF084CFCEAC
:10083000CDFCE5F0CBF97818EF2FFFEE33FEED336A
:10084000FDEC33FCEB33FB10D703994004EB99FB31
:100850000FD8E5E4F9FA227818EF2FFFEE33FEED1A
:1008600033FDEC33FCC933C910D7059BE99A400727
:10087000EC9BFCE99AF90FD8E0E4C9FAE4CCFB223E
:1008800075F010EF2FFFEE33FEED33FDCC33CCC807
:1008900033C810D7079BEC9AE899400AED9BFDEC12
:1008A0009AFCE899F80FD5F0DAE4CDFBE4CCFAE451
:1008B000C8F922D083D082F8E49370127401937047
:1008C0000DA3A393F8740193F5828883E4737402F3
:1008D000936860EFA3A3A380DFEC8EF0A4CCC5F0F7
:1008E000CCCDF8EFA4CEC5F02DFDE43CFCE8A42E61
:1008F000C8C5F03DFDE43CFCEFA4FFE5F028FEE4B4
:100900003DFDE43CFC22EF4E6012EF60010EEDBBBA
:10091000010B89828A83F0A3DFFCDEFA2289F05082
:1009200007F709DFFCA9F022BBFEFCF309DFFCA9F5
:10093000F022AFE9AEEA7C007D0A1206C18E088F74
:1009400009209303020B2185080A85090BC3E509D9
:10095000950DF511E508950CF510900075E01470F3
:1009600003020B1B046003020B42900085E014603D
:1009700065046003020B42900084E06003020B42B6
:100980009000A8E0FFAB11AA10AD0FAC0E120E1331
:100990008F12E51264807003020B4290007F120CEC
:1009A000A3900002E510F0A3E511120C5FE49000A3
:1009B00074F0900077F090007EF0F513F514FE7F50
:1009C00070FD7B017A007904120906E490007DF045
:1009D00090008504F022E51275F00EA424AAF58299
:1009E000E43418F583E493FFD39400400B90007E29
:1009F000E09F5004E004F022900088E014F09000A2
:100A000077E004F0AE10AF11AB07AA06E50F2BFF9D
:100A1000E50E3AFEE433FDE433FCC004A905AA0662
:100A2000AB07AE0EAF0F120CABD0001208218F2215
:100A3000120C231200034029E51275F00EA424B015
:100A4000F582E43418F583E493FDAF2212000340ED
:100A500010120B436F600AE4900084F0C290A3F080
:100A600022120C23AF221200035007120B43C39F24
:100A70004011D3E50F9514E50E9513402B120B434F
:100A80006F7025900086120CA3D290120BF6C083D3
:100A9000C082120C9B7401A806088002C333D8FCE4
:100AA0004FD082D083F0801790007A120CA3C290AE
:100AB000D39514E50E95134006850E13850F1490FB
:100AC0000088E07015120BF6E0FF90007DE06FFFEC
:100AD00012176490007DEF120C5F120B436F70626F
:100AE0001217FF5005E4900083F0900083E0FF9020
:100AF000007DE06F601D12180F7DF47C017F017E88
:100B00000012162090007DE0900083F0A3E512F023
:100B10004480F0C290E4900085F022AF11AE1080C6
:100B20001E85080C85090DC3E509950BF50FE50831
:100B3000950AF50E900075E0147007AF0FAE0E1217
:100B40000CC822E51275F00EA424B1F582E4341825
:100B5000F583E493FF900077E022120821AB07AA07
:100B600006E4F9F87F407E427D0FFC120821E47B09
:100B7000FFFAF9F8120796A804A905AA06AB077FA1
:100B8000207ED77D757C01120821EFF40422AE2669
:100B9000AF277C007D1F1206D38E2A8F2B7C007D11
:100BA000051206D3C3E52B9FFDE52A9EFCD3E52560
:100BB0009DE5249C22E52975F00EA424A8F582E485
:100BC0003418F583E493FE740193FF2438FDEE346A
:100BD000FFFCD3E5279DE5269C22900074E02404C9
:100BE000F582E43400F58322E52525E0248AF582A8
:100BF000E43400F58322900077E024FFFFE434FF23
:100C0000FE7C007D0812072874042FF58274003ED4
:100C1000F58322E52B2FFFE52A3EC3FEE5259FE560
:100C2000249E22E51275F00EA424AFF582E4341858
:100C3000F583E493FD22E52975F00EA424A6F58240
:100C4000E43418F5832253DAFE53F7DF53F7BF225B
:100C5000AB3BAA3CA93D854082758300020682F029
:100C60009000887408F022EF24C8FFE43EFEC3E53C
:100C7000279FE5269E2275F0FFA4FFAEF07C007D45
:100C8000640206D3900078E523F0A3E524F02290D7
:100C90000081E0FF900077E0D39F22E0FF90008882
:100CA000E0FE22E50EF0A3E50FF0227C007D640259
:100CB00008D9540F75F002A4F58285F08322D3E59C
:100CC000279470E5269417228E238F24900085E0C8
:100CD000146035147003020D9D24026003020E049B
:100CE000C290900084E06003020E04AF24AE231291
:100CF00017914003020E04E4900001F0120C84905E
:100D000000857401F0D29022900078E0FCA3E0FD11
:100D1000AE047802CEC313CE13D8F92DFFEC3EFEFD
:100D2000D3E5249FE5239E4009120C84E490000142
:100D3000F022AF24AE23121492501A900001E094D6
:100D4000004012E4900074F09000887404F0900069
:100D5000857402F022C3E5249464E5239400403AAC
:100D6000120E05501C120BE8E0FEA3E02524FFE55F
:100D7000233EC313FEEF13FF120BE8EEF0A3EFF0D8
:100D800022900001E0120BEA120C87900001E004AF
:100D9000F0E0D3941E406DE4805EE48063B290AFD7
:100DA00024AE23121492500D900084E04480F0C2CF
:100DB00090E4A3F022120E055041900088E0B404A4
:100DC00011E525C454F0FF120BDAEFF0E49000882F
:100DD000F022120BDAE0FFE525540FFEEF4EF09003
:100DE0000074E004F09000887404F0900074E0D384
:100DF00094704010E4900001F08005E4900001F050
:100E0000900085F0227B007A007925AF24AE231272
:100E1000107E228F238C248D258A268B277528808F
:100E2000E523707CE4F5297F0112002EEF6529701F
:100E30001B120CBE405FE5279450E52694465055A2
:100E4000120B8E4050120C13504B807E120C36E465
:100E500093FE740193FFD39400EE9400402BEF2493
:100E600038FFEE34FFD3120C1B402A120C367401EB
:100E70009324C8FFE4933400120C1A5018120BB5D7
:100E80004013120C67500E8041120BB54007120C34
:100E900067500280350529E529C394054089802DD6
:100EA000AF2312002E8F297F0112002EEF652970CB
:100EB0001C120CBE4017E5279450E5269446500DB1
:100EC000120B8E4008120C135003852928AF2822DC
:100ED000C0E0C0F0C083C082C0D075D000C000C0E8
:100EE00001C002C003C004C005C006C007E5985495
:100EF00003F547F45298E54730E017121857900071
:100F0000C0121690EFF09000C0E004F0E0B41402BC
:100F1000E4F0E54730E12E9000C2E0D39400401A9F
:100F20009000BFE02448F8E6FF1218549000BFE09C
:100F300004F09000C2E014F08002D2029000BFE002
:100F4000B42002E4F0D007D006D005D004D003D0FE
:100F500002D001D000D0D0D082D083D0F0D0E03207
:100F60004200C700004200C300004200C900004226
:100F700000C500004100CC004100CB0041008400CE
:100F8000410085004100A8004100750041007C003F
:100F900041007656410089AB4100000041008200CB
:100FA00042007F0000420002000042008600004232
:100FB000007A000041008100410088004100770074
:100FC00041007E00410074004100830041007D002B
:100FD000410001004100C0004100C1004100BE00CD
:100FE0004100BF004100C2004100BD00C10200122B
:100FF000002A787FE4F6D8FD758167021039020077
:1010000076E493A3F8E493A34003F68001F208DFAB
:10101000F48029E493A3F85407240CC8C333C454C0
:101020000F4420C8834004F456800146F6DFE48074
:101030000B0102040810204080900F60E47E0193B1
:1010400060BCA3FF543F30E509541FFEE493A36046
:10105000010ECF54C025E060A840B8E493A3FAE4A1
:1010600093A3F8E493A3C8C582C8CAC583CAF0A3F2
:10107000C8C582C8CAC583CADFE9DEE780BE8E263E
:101080008F278B288A29892AC200E4F52B9000013A
:10109000E0FFE52BC39F506BE527AE267803CEC358
:1010A00013CE13D8F9FDAC06E527AE267802CEC3E1
:1010B00013CE13D8F92DF52DEE3CF52CE52B120BA4
:1010C000EAE0FEA3E0FFC3952DFDEE952CFCC3EDF9
:1010D0009527EC95265028E52D2FFFE52C3EFEC3E5
:1010E000E5279FE5269E5017E52A45294528600BF0
:1010F000AB28AA29A92AE52B1206AFD20080040545
:101100002B808AA20022C0E0C0F0C083C082C0D081
:1011100075D000C000C001C002C003C004C005C03B
:1011200006C007E5D85487F521F452D8E5F730E535
:1011300008E5F730E60312154353F7DFE52130E702
:1011400008E5D930E00312185DE52130E008E5DA62
:1011500030E00312169BE52130E108E5DB30E003C7
:10116000120932E52130E208E5DC30E00312185EB6
:10117000D007D006D005D004D003D002D001D000D3
:10118000D0D0D082D083D0F0D0E0328B388A398969
:101190003A53DBFE120C4653E2FDE4F540E540C352
:1011A000953E504FAB38AA39A93AC003C002C001DE
:1011B000120C50C4120CB2D001D002D00312075E40
:1011C000F54285F041D280121202AB38AA39A93A11
:1011D000C003C002C001120C50120CB2D001D002E8
:1011E000D00312075EF54285F041C280121202055B
:1011F0004080AAB290AF3F153FEF709E43E202C21B
:101200009022FDAC417F0A7E001215741218402214
:10121000AE07E4F5381216EA900001E004FF12165A
:10122000F112128B900001E0FFE538C39F501212BB
:101230001684121677121684F58312167E053880EE
:10124000E3900078E0FF1216F190007812167E12FB
:10125000128B900088E07006900074E004F0E4F5D2
:1012600038900074E0FFE538C39F501774042538A8
:101270001216720538E538541F70E612185112180C
:101280004A80DE7F551216F10218511218511218B9
:101290004A228E388F398C3A8D3BAE02AF03120C46
:1012A000ABC007AF3EAB07E4FAF9F8D007120B5A10
:1012B000900000F0AE3FAF40120CABC007AF41ABA7
:1012C00007E4FAF9F8D007120B5A900082F0E53ED5
:1012D000120C76900076EFF0E541120C76900089C2
:1012E000EFF090007FE538F0A3E539F0900002E5DB
:1012F0003AF0A3E53BF0900081E542F043DA015378
:10130000F7DF43F74053DBFE75F9FF22AE07E4FC3D
:10131000FB1216EAED75F00EA424F7F582E43418FA
:10132000F583E493FFECC39F500774082CFC0B80FB
:10133000E3EB04FF1216F1ED75F00EA424EBF58239
:10134000E43418F583E493FF1216F1E4FCECC39B3C
:10135000500974042C1216720C80F27F551216F18B
:10136000021851C0E0C083C082C0D075D000C00454
:10137000C005C006C00753C87F9000C7E0FEA3E0C9
:10138000FF4E700353C8FB9000C31214875009909E
:1013900000C7E4F0A3F0800DC39000C8E09DF0907A
:1013A00000C7E09CF0D007D006D005D004D0D0D044
:1013B00082D083D0E032C0E0C083C082C0D075D07C
:1013C00000C004C005C006C00753917F9000C9E06B
:1013D000FEA3E0FF4E70035391FB9000C5121487EB
:1013E00050099000C9E4F0A3F0800DC39000CAE05A
:1013F0009DF09000C9E09CF0D007D006D005D00445
:10140000D0D0D082D083D0E032AE07E4FDF53812E0
:1014100016EA900002E0FF1216F190000212167E0A
:1014200090007AE0FF1216F190007A12167E90007A
:1014300086E0FF1216F190008612167E74042D12BB
:1014400016720DBD03F67F551216F1021851AB0747
:10145000AA06E4F9F87F407E427D0FFC120821A81D
:1014600004A905AA06AB077F207ED77D757C0112F3
:101470000821C3E49FFFE49EFE22AB07AA06E4F91D
:10148000F87FE87E03FD22E0FCA3E0FDC3EF9DEEC4
:101490009C22AD07AC06900078E0FEA3E07802CE77
:1014A000C313CE13D8F9FFC3900079E09FFB9000DF
:1014B00078E09EFAC3EB9DEA9C5013A3E02FFF90C7
:1014C0000078E03EFEC3ED9FEC9E50028001C322F7
:1014D0008F3890007CE0F5397F0B12185A43DB01FE
:1014E000120C461200707D0A7C007F017E001216ED
:1014F0004912184043E202E4900085F0900084F025
:101500009000CBE538F090007CF0AF39229000C01D
:10151000E0FF9000BEE0B507057E017F002290004D
:10152000BE121690E0FD7C009000BEE004F0E0B436
:101530001402E4F09000BDE0FEEE4204E4F0AE04DC
:10154000AF0522120C8F400302172B120BDA120C7C
:101550009BEFA806088002C313D8FC30E00B900074
:1015600000E0FF12185AD29022900082E0FF121879
:101570005AC290228E438F448C458D4612144E12CF
:1015800017ABE54624BF9000CAF0E54534FF900054
:10159000C9F09000C5E543F0A3E544F0439104226F
:1015A000900006E0FEA3E0FF900009E02FFF90000E
:1015B00008E03EAB07FAE4F9F822E53675F00EA430
:1015C00022F583E493FC740193FD22D29053E2FD53
:1015D000D28090007F1215E6C290C2809000021265
:1015E00015E643E20222E0FCA3E0FD7F0A7E001242
:1015F00015741218402212181612181D12182412EF
:1016000017CE12002612177B1217EC1217D81217DA
:10161000E21217B712182B12183212184602183994
:101620008E238F248C258D2612147A12145B1217A8
:101630009F9000C7E525F0A3E526F09000C3E523C1
:10164000F0A3E524F043C804228E3A8F3B8C3C8DF6
:101650003D12147A12145B1217AB9000C9E53CF0EE
:10166000A3E53DF09000C5E53AF0A3E53BF04391DA
:101670000422F582E43400F583E0FF0216F1A3E0D2
:10168000FF0216F1E53825E0248AF582E4340022D1
:10169000E024A9F582E43400F58322900088E0700C
:1016A00008900074E004120C5F900077E004F09062
:1016B0000088E014F0120C8F50030216C353E2FDB1
:1016C000C28022120BDA120C9BEFA806088002C31C
:1016D00013D8FC30E0059000768003900089E07D0F
:1016E00000FCE4FF12170D22AE077FAA1216F1AF1D
:1016F00006C2029000C1E0B42002E4F09000C1E014
:101700002448F8A607E004F0A3E004F022AB07AFFA
:1017100004EB14600C14600E2402700E8DFB8FFC21
:10172000228DE98FEA228DEB8FEC22E4FDFCFF1283
:10173000170D120C4612184E53D87853E2FDC28092
:10174000C2909000857404F022120C60E014F090B6
:1017500000777401F09000857403F01216C312151F
:10176000CB0200707E1DE4FDEF30E70625E06EFF42
:101770008004EF25E0FF0DBD08EE22AF885388AF4F
:10178000758CA0758DCBEF5440FEEF54104E4288FF
:1017900022C3EF94ACEE940D4003D38001C322AD7D
:1017A00007AC06ECF5CBAF058FCA22AD07AC06EC53
:1017B000F593AF058F9222C2DE75D90575F9FF75D5
:1017C0009601221216E87F551216F102185175E3A0
:1017D0004075E10175E20222E59154045391FB4208
:1017E0009122758E5475892243885022E5C854048D
:1017F00053C8FB42C82253984FEB4F4DF59822E552
:10180000C8C320E201D322E591C320E201D32253D1
:10181000C8FB53C87F227597DE7597AD2275A4115A
:1018200075D4CE2275A54175D5772253F77F75DA29
:101830004A2253F77F75DB302275E69075A8B022F7
:10184000E59120E2FB22439810223002FD22C2DE05
:1018500022D299228F9922AF99228F8C22222201A3
:101860000190307000064001904B1918000212C020
:1018700005DC0002BC012C461E2808030BB82328F7
:1018800000044C01904B19180004251C0BB80003F0
:10189000840140461E180005000072D80702BC01F2
:1018A0002C26404000010190307000064001904B12
:1018B0001918000212C005DC0002BC012C461E28CB
:1018C00008030BB8232800044C01904B191800049E
:1018D000251C0BB80003840140461E1800050000BB
:1018E00072D80702BC012C264040000101903070E4
:1018F00000064001904B1918000212C005DC0002DE
:10190000BC012C461E2808030BB8232800044C01F8
:10191000904B19180004251C0BB8000384014046A5
:101920001E180005000072D80702BC012C2640409A
:0119300000B6
:00000001FF

View File

@ -1,451 +0,0 @@
:020000040000FA
:10000000021197ED24F8FEEFD39E4015ED2408FD74
:10001000E433FCC3EF9DEC6480F874809850028058
:1000200001C322021078E4F5A922220215927EFF74
:10003000EFD394004022EF9480501DE4FDED75F065
:1000400005A42486F582E4341BF583E493B5070404
:10005000AE0580040DBD06E5AF06220212AE121AEF
:10006000BB53D87853DBFE121A7CE4900085F02253
:10007000D2DE220215E5D201121883C290C296D2B6
:1000800080E4FBFD7F10121A6312061E74A4F0D2E6
:10009000AFE4F537F538D2960538E5387002053704
:1000A000B410F3E537B427EEC2963001091217C534
:1000B0008E3A8F3B8006753A01753B00E53B700434
:1000C000E53A640170409000CCE07007F537F538F0
:1000D0000202870538E53870020537D39410E537FA
:1000E00094274002D296D3E5389430E53794755082
:1000F00003020287E4F537F5389000CCF09000CB8E
:10010000F0C296020287E4F537F5389000CCE0148F
:10011000602A14700302025914700302021E147044
:100120000302023424046003020287E53B64AA60F0
:10013000030202879000CC04F0020287E53B9000A6
:10014000CBF0A37402F0E53B120BE00206A00170B5
:10015000A10182A501A6A601BAA701C3A801DFA932
:1001600001C6B001CFB10197C00287FF00000215A0
:100170001205D79000A87401F0E4900075F07FA1FB
:10018000806E12005E9000CC7404F0753908E4F5BE
:100190003D753C090202879000CC7404F0E4F53D03
:1001A000753C02020287E49000A8F0900075F07F91
:1001B000A612064F74A6F002028712061E74A4F05F
:1001C0000202877539089000CC7403F00202879010
:1001D00000757401F07FB112064FEFF00202871232
:1001E00005D79000A8E0F536E4F0900075F07FA9FF
:1001F00012174D90007CEFF07D307C757F017E0002
:100200001218D602028712063290007CEFF0E490BA
:1002100000CCF08072E49000CBF0A3F08069E4F5AC
:100220003DE53BF53CE53CD394009000CC40257483
:1002300004F080537404253DF582E43400F583E531
:100240003BF0053DE53D653C6007E53DC3947040EE
:10025000369000CC7402F0802EE53B6455702890F7
:1002600000CCF0C2019000CBE02460601824FC6058
:100270000F24FE600B14600824F66004241070073D
:100280007FA0121A30D2019000CBE0120BE002B036
:10029000A102DAA402ECA503B5A603D1A804F1A932
:1002A000052EB005A1B1037DC003A3FF000000AA85
:1002B000900084E030E70F7DC87C001206077FA322
:1002C00012168102050B121A7440030200AA7DE87F
:1002D0007C031206077FA2020526900084E020E737
:1002E000030200AA7FA41216810203C99000CCE089
:1002F00060030200AA900085E024FC6049240460A9
:10030000030200AA1539900008E0FEA3E0FF1215D1
:100310002C8F46900006E0FEA3E0FF8E47F54812C2
:10032000152C8F49754A18900008E0FAA3E0FB905D
:100330000004E0FCA3E0FDA3E0FEA3E0FF120656EC
:100340007406F00204BD7F0112002EEF12157C60CE
:10035000030200AAE539601D1205B812158CD3946A
:100360000050030204E21205B812158C12063B126B
:100370001AAD0204E21206327FA00205269000CCDC
:10038000E060030200AA900004E0FCA3E0FD7F010E
:100390007E001218D6D296121AADC2967FA0121AFB
:1003A00030800AE4FF121A30E49000CCF0D201123F
:1003B00006460200AA900084E020E7030200AA5447
:1003C0007FF53FFD7FA61214B4E4900084F0020094
:1003D000AA9000CCE060030200AA900085E024FC13
:1003E00070030204C3240460030200AA12157A6099
:1003F000030200AA153912005E900004E0647F70C9
:1004000036A3E0FCA3E0FFAE04900009E0FCA3E00B
:10041000FBAA04A3E0F546A3E0F547A3E0F548A353
:10042000E0F549A3E0F54A900007E0FCA3E0FD12E7
:100430000656740CF0807D900004E0FF12002E8FB1
:100440003EE53EF46069EF121561120A60FFAEF0FE
:10045000C006C00712155F900002120A8BFFAEF0B3
:10046000C006C007900005120A8BFDACF0C004C0A6
:1004700005900009120984FF900007120A8BFDAC59
:10048000F090000A120984FE90000B120984F54ACC
:100490008E498C478D488F46D003D002D005D004BA
:1004A000D007D00612143A9000747401F08005E46D
:1004B0009000CBF09000CBE070030200AA1219AAC2
:1004C0000200AA12157A60030200AAE539601B1225
:1004D000155F12158CFFD394004007EF12063B12F4
:1004E0001AADE4900085F00200AA1206467FA080B3
:1004F00035900084E0FF30E71C547FF53F7DC87CD9
:10050000001205EAAD3F7FAB1214B4E4900084F012
:10051000D2010200AA121A7440030200AA7DE87CEC
:10052000031205EA7FAA121A30D2010200AA900033
:1005300004E025E0F53F9000CCE060030200AA90C3
:100540000085E0700512005E800B900085E0640479
:1005500060030200AAE53F6007E53CC3940450082D
:10056000E49000CBF00200AA7406253FF9E43400C1
:10057000754301F5448945C3E53C953F24FEF546A6
:10058000900005E0F5477B017A0079061213337F6E
:10059000A0121A3090007CE0FF12174DD201020029
:1005A000AA900084E020E7030200AA7FB11213B8EA
:1005B000E4900084F00200AA7F0112002EEF75F093
:1005C00005A4241CF582E4341BF583E493FB740139
:1005D00093FA740293F9227D327C007F017E00122F
:1005E00018D6D296121AADC296227F017E0012183A
:1005F000D6D296121AADC2969000A8E536F09000B9
:100600007CE0FF12174D227F017E001218D6D29691
:10061000121AADC29690007CE0FF12174D22900096
:10062000A87401F0E4900075F07FA412174D9000BB
:100630007C2290007CE0FF12174D22FD7C007F01A0
:100640007E001218D62290007CE0FF12174D221275
:10065000174D90007C2212143A90007422AFE9AE3C
:10066000EA7C007D0A1209C38E088F0920930302D9
:1006700008EE85080A85090BC3E509950DF511E516
:1006800008950CF510900075E01470030208E8045A
:10069000600302090F900085E014606504600302A6
:1006A000090F900084E0600302090F9000A8E0FFAA
:1006B000AB11AA10AD0FAC0E120FCA8F12E5126467
:1006C00080700302090F90007F120FA5900002E5D1
:1006D00010F0A3E511120F0AE4900074F090007777
:1006E000F090007EF0F513F514FE7F70FD7B017A2B
:1006F000007904120C33E490007DF090008504F042
:1007000022E512120F2F700302082A046003020967
:100710000FE512120E3F900004120984FFD39400DB
:10072000400B90007EE09F5004E004F022120F483E
:10073000AE10AF11AB07AA06E50F2BFFE50E3AFE90
:10074000E433FDE433FCC004A905AA06AB07AE0EF2
:10075000AF0F120FADD000120B4E8F22E512120E0A
:100760003F900009120984FD120003401BE512129C
:100770000E3F90000A12097A400EE512120E3F1247
:100780000EE16F60030208A3E512120E3F9000090C
:1007900012097A500CE512120E3F120EE1C39F406F
:1007A00016D3E50F9514E50E9513402EE512120EA3
:1007B0003F120EE16F7023900086120FA5120E58A3
:1007C000C083C082120F407401A806088002C333A0
:1007D000D8FC4FD082D083F0801790007A120FA5FA
:1007E000C290D39514E50E95134006850E13850F20
:1007F00014900088E0700D120E5A120EF0FF1219BC
:10080000C5120F06E512120E3F120EE16F600302D1
:10081000090F121A6C5005E4900083F0120EED706F
:10082000030208E012095C0208E0E512120E3F9094
:10083000000B120984FF7E00900004120A8BFDACAD
:10084000F01209C3120F198E238F24120F48E512DC
:10085000120E3F9000061209105011E512120E3FC1
:100860009000071209365004C2908041E512120E22
:100870003F900008120910502AE512120E3F900016
:1008800009120936501D120E58C083C082120F4043
:100890007401A806088002C333D8FC4FD082D083ED
:1008A000F0800AE4900084F0C290A3F022900088C7
:1008B000E0700D120E5A120EF0FF1219C5120F063B
:1008C000E512120E3F90000A120EE46F7041121AE8
:1008D0006C5005E4900083F0120EED600312095C89
:1008E000C290E4900085F022AF11AE10801E850802
:1008F0000C85090DC3E509950BF50FE508950AF57B
:100900000E900075E0147007AF0FAE0E120C5F2250
:10091000120984FD7C00900004120A8BFFAEF012D5
:1009200009C3C3E50F9FFFE50E9EFE121A24C3EF15
:100930009524EE952322120984FD7C009000041278
:100940000A8BFFAEF01209C3C3E5119FFFE5109EAD
:10095000FE121A24C3EF9524EE952322121A7C7DF1
:10096000207C037F017E001218AD90007DE0900096
:1009700083F0A3E512F04480F022120984FDAF2237
:1009800012000322BB010CE58229F582E5833AF5CA
:1009900083E0225006E92582F8E622BBFE06E9251F
:1009A00082F8E222E58229F582E5833AF583E49331
:1009B00022BB010689828A83F0225002F722BBFE05
:1009C00001F322EF8DF0A4A8F0CF8CF0A428CE8DF7
:1009D000F0A42EFE22BC000BBE0029EF8DF084FF98
:1009E000ADF022E4CCF875F008EF2FFFEE33FEEC0B
:1009F00033FCEE9DEC984005FCEE9DFE0FD5F0E932
:100A0000E4CEFD22EDF8F5F0EE8420D21CFEADF030
:100A100075F008EF2FFFED33FD4007985006D5F035
:100A2000F222C398FD0FD5F0EA22C2D5EC30E709D7
:100A3000B2D5E4C39DFDE49CFCEE30E715B2D5E4ED
:100A4000C39FFFE49EFE1209D5C3E49DFDE49CFC18
:100A500080031209D530D507C3E49FFFE49EFE2230
:100A6000BB010A89828A83E0F5F0A3E02250068761
:100A7000F009E71922BBFE07E3F5F009E319228923
:100A8000828A83E493F5F074019322BB0110E5821E
:100A900029F582E5833AF583E0F5F0A3E0225009D9
:100AA000E92582F886F008E622BBFE0AE92582F8ED
:100AB000E2F5F008E222E5832AF583E993F5F0A355
:100AC000E99322E88FF0A4CC8BF0A42CFCE98EF003
:100AD000A42CFC8AF0EDA42CFCEA8EF0A4CDA8F0A6
:100AE0008BF0A42DCC3825F0FDE98FF0A42CCD356A
:100AF000F0FCEB8EF0A4FEA9F0EB8FF0A4CFC5F0D4
:100B00002ECD39FEE43CFCEAA42DCE35F0FDE43CCC
:100B1000FC2275F008758200EF2FFFEE33FECD3317
:100B2000CDCC33CCC58233C5829BED9AEC99E5825E
:100B300098400CF582EE9BFEED9AFDEC99FC0FD5EA
:100B4000F0D6E4CEFBE4CDFAE4CCF9A88222B800DA
:100B5000C1B90059BA002DEC8BF084CFCECDFCE5A5
:100B6000F0CBF97818EF2FFFEE33FEED33FDEC33C9
:100B7000FCEB33FB10D703994004EB99FB0FD8E54E
:100B8000E4F9FA227818EF2FFFEE33FEED33FDEC97
:100B900033FCC933C910D7059BE99A4007EC9BFC8D
:100BA000E99AF90FD8E0E4C9FAE4CCFB2275F01019
:100BB000EF2FFFEE33FEED33FDCC33CCC833C8103E
:100BC000D7079BEC9AE899400AED9BFDEC9AFCE86C
:100BD00099F80FD5F0DAE4CDFBE4CCFAE4C8F922B9
:100BE000D083D082F8E4937012740193700DA3A3A4
:100BF00093F8740193F5828883E4737402936860B8
:100C0000EFA3A3A380DFEC8EF0A4CCC5F0CCCDF88D
:100C1000EFA4CEC5F02DFDE43CFCE8A42EC8C5F041
:100C20003DFDE43CFCEFA4FFE5F028FEE43DFDE4DF
:100C30003CFC22EF4E6012EF60010EEDBB010B8910
:100C4000828A83F0A3DFFCDEFA2289F05007F709DD
:100C5000DFFCA9F022BBFEFCF309DFFCA9F0228E29
:100C6000258F26900085E0146035147003020D3D39
:100C700024026003020E0EC290900084E060030222
:100C80000E0EAF26AE251219F24003020E0EE490AE
:100C90000001F0120F8E9000857401F0D290229026
:100CA0000078E0FCA3E0FDAE047802CEC313CE13BF
:100CB000D8F92DFFEC3EFED3E5269FE5259E4009A1
:100CC000120F8EE4900001F022AF26AE2512178A93
:100CD000501F900001E094004017E4900074F090E1
:100CE00000887404F0E490007DF09000857402F0B8
:100CF00022C3E5269464E52594005003020DA31257
:100D00000E0F501C120EF8E0FEA3E02526FFE5258D
:100D10003EC313FEEF13FF120EF8EEF0A3EFF02226
:100D2000900001E0120EFA120F91900001E004F021
:100D3000E0D3941E5003020E0EE4020DFFB290AFFA
:100D400026AE2512178A505E121A6C5005E49000E8
:100D500083F0120EED604A121A7C7DF47C017F0153
:100D60007E001218AD90007DE0900083F090008826
:100D7000E07019120E78C083C082E0FF900001E09D
:100D8000540FFEEF4ED082D083F0800E900001E031
:100D9000C454F0440F120E77EFF0900084E04480CA
:100DA000F0C290E48064120E0F5057900088E0B4B7
:100DB0000410E527C454F0120E77EFF0E490008899
:100DC000F022900074E0FF120E7CE0FEE527540F45
:100DD000FDEE4DF074042F120E7E120EF0FF12196C
:100DE000C5EFF0900074E004F09000887404F09077
:100DF0000074E0D394704016121A7CE4900001F065
:100E00008008121A7CE4900001F0900085F0227BAB
:100E1000007A007927AF26AE2512122622E52B751F
:100E2000F005A42488F582E4341BF583E493FB7475
:100E30000193FA740293F9120A60FFAEF0E52B7584
:100E4000F005A42488F582E4341BF583E493FB7455
:100E50000193FA740293F922D290900077E024FF74
:100E6000FFE434FFFE7C007D08120A2A74042FF58B
:100E70008274003EF58322FF900074E02404F58222
:100E8000E43400F58322120B4EAB07AA06E4F9F80E
:100E90007F407E427D0FFC120B4EE47BFFFAF9F897
:100EA000120AC3A804A905AA06AB077F207ED77D36
:100EB000757C01120B4EEFF40422AE28AF297C00A2
:100EC0007D1F1209D58E2C8F2D7C007D051209D532
:100ED000C3E52D9FFDE52C9EFCD3E5279DE5269CD3
:100EE0002290000B120984FF900077E0229000838B
:100EF000E0FF90007DE06F22E52725E0248AF5825F
:100F0000E43400F5832290007DEFF09000887408AF
:100F1000F02275F0FFA4FFAEF07C007D640209D5DD
:100F2000E53524C8FFE43534FEC3ED9FEC9E227501
:100F3000F005A42487F582E4341BF583E49314229E
:100F4000E0FF900088E0FE22900088E014F090001E
:100F500077E004F022E5352438FFE53434FFFED392
:100F6000ED9FEC9E22E52D2FFFE52C3EFEC3E527ED
:100F70009FE5269E2253DAFE53F7DF53F7BF22ABDD
:100F800043AA44A9458548827583000209849000DC
:100F900078E525F0A3E526F022900081E0FF90009F
:100FA00077E0D39F22E50EF0A3E50FF0227C007DD1
:100FB00064020C06540F75F002A4F58285F08322BA
:100FC000D3E5299494E5289411228F258C268D272A
:100FD0008A288B29752A80E5257052E4F52B7F013C
:100FE00012002EEF652B701B120FC04035E52994BF
:100FF00050E5289446502B120EBA4026120F655029
:10100000218054E52B120F2F600D047015120E1D58
:1010100012105D500D8008120E1D12105D500385D8
:101020002B2A052BE52BC3940640B3802DAF251248
:10103000002E8F2B7F0112002EEF652B701C120FDC
:10104000C04017E5299450E5289446500D120EBA79
:101050004008120F655003852B2AAF2A2290000208
:10106000120A8BF53585F034AB07AA06AD29AC28FA
:10107000AF27AE2612163822C0E0C0F0C083C0826F
:10108000C0D075D000C000C001C002C003C004C001
:1010900005C006C007E5985403F54FF45298E54F94
:1010A00030E017121AC49000C0121742EFF09000FF
:1010B000C0E004F0E0B41402E4F0E54F30E12E901B
:1010C00000C2E0D39400401A9000BFE02450F8E63C
:1010D000FF121AC19000BFE004F09000C2E014F0CB
:1010E0008002D2029000BFE0B42002E4F0D007D02A
:1010F00006D005D004D003D002D001D000D0D0D08B
:1011000082D083D0F0D0E0324200C700004200C35A
:1011100000004200C900004200C500004100CC00B0
:101120004100CB0041008400410085004100A8003F
:101130004100750041007C0041007656410089ABBA
:10114000410000004100820042007F000042000296
:101150000000420086000042007A00004100810049
:10116000410088004100770041007E00410074008A
:101170004100830041007D00410001004100C000AA
:101180004100C1004100BE004100BF004100C2005B
:101190004100BD00C1020012002A787FE4F6D8FDAC
:1011A00075816F0211E1020076E493A3F8E493A342
:1011B0004003F68001F208DFF48029E493A3F85499
:1011C00007240CC8C333C4540F4420C8834004F41C
:1011D00056800146F6DFE4800B010204081020402F
:1011E00080901108E47E019360BCA3FF543F30E57A
:1011F00009541FFEE493A360010ECF54C025E060A4
:10120000A840B8E493A3FAE493A3F8E493A3C8C571
:1012100082C8CAC583CAF0A3C8C582C8CAC583CA62
:10122000DFE9DEE780BE8E288F298B2A8A2B892C66
:10123000C200E4F52D900001E0FFE52DC39F506B47
:10124000E529AE287803CEC313CE13D8F9FDAC063A
:10125000E529AE287802CEC313CE13D8F92DF52F89
:10126000EE3CF52EE52D120EFAE0FEA3E0FFC3954D
:101270002FFDEE952EFCC3ED9529EC95285028E521
:101280002F2FFFE52E3EFEC3E5299FE5289E501730
:10129000E52C452B452A600BAB2AAA2BA92CE52D62
:1012A0001209B1D2008004052D808AA20022C0E07C
:1012B000C0F0C083C082C0D075D000C000C001C0E3
:1012C00002C003C004C005C006C007E5D85487F5B6
:1012D00021F452D8E5F730E508E5F730E6031217B8
:1012E000FB53F7DFE52130E708E5D930E003121AB8
:1012F000CAE52130E008E5DA30E0031218FFE52105
:1013000030E108E5DB30E00312065DE52130E2085C
:10131000E5DC30E003121ACBD007D006D005D004AC
:10132000D003D002D001D000D0D0D082D083D0F072
:10133000D0E0328B408A41894253DBFE120F755355
:10134000E2FDE4F548E548C39546504FAB40AA415D
:10135000A942C003C002C001120F7FC4120FB4D053
:1013600001D002D003120A8BF54A85F049D28012CF
:1013700013AAAB40AA41A942C003C002C001120F88
:101380007F120FB4D001D002D003120A8BF54A8528
:10139000F049C2801213AA054880AAB290AF47153F
:1013A00047EF709E43E202C29022FDAC497F0A7E65
:1013B0000012182C121AAD22AE07E4F54012194B98
:1013C000900001E004FF121952121433900001E062
:1013D000FFE540C39F501212173612172912173615
:1013E000F583121730054080E3900078E0FF121972
:1013F00052900078121730121433E4F540900074C4
:10140000E02401FFE433FEC3E5409FEE6480F874FE
:1014100080985017740425401217240540E5405465
:101420001F70DA121ABE121AB780D27F55121952E3
:10143000021ABE121ABE121AB7228E408F418C4277
:101440008D43AE02AF03120FADC007AF46AB07E44A
:10145000FAF9F8D007120E86900000F0AE47AF48B8
:10146000120FADC007AF49AB07E4FAF9F8D0071285
:101470000E86900082F0E546120F12900076EFF093
:10148000E549120F12900089EFF090007FE540F0DF
:10149000A3E541F0900002E542F0A3E543F090009F
:1014A00081E54AF043DA0153F7DF43F74053DBFEAF
:1014B00075F9FF22AC05AB07E4FEFDFA7FAA12190D
:1014C00052AF03121952EC75F005A424F3F582E42F
:1014D000341BF583E49314600B04701212170A9006
:1014E000000B800612170A90000A120984FAEEC354
:1014F0009A500774082EFE0D80F4ED04FF12195265
:10150000EC75F005A424F2F582E4341BF583E49332
:10151000FF121952E4FEEEC39D500974042E1217F7
:10152000240E80F27F55121952021ABE7C007D648F
:10153000120C06A804A905AA06AB07900006E0FE57
:10154000A3E0FFA3E0FCA3E02FFDEC3EAF05FEE42B
:10155000FDC8FCEDC9FDEECAFEEFCBFF020B4EE568
:101560003E75F005A4241CF582E4341BF583E49356
:10157000FB740193FA740293F922E53E75F005A419
:10158000241BF582E4341BF583E4932290000C02C3
:101590000984C0E0C083C082C0D075D000C004C040
:1015A00005C006C00753C87F9000C7E0FEA3E0FF58
:1015B0004E700353C8FB9000C31216FF50099000F1
:1015C000C7E4F0A3F0800DC39000C8E09DF0900048
:1015D000C7E09CF0D007D006D005D004D0D0D08290
:1015E000D083D0E032C0E0C083C082C0D075D000CC
:1015F000C004C005C006C00753917F9000C9E0FE3B
:10160000A3E0FF4E70035391FB9000C51216FF50EC
:10161000099000C9E4F0A3F0800DC39000CAE09DDA
:10162000F09000C9E09CF0D007D006D005D004D0DF
:10163000D0D082D083D0E032C200D3EB9400EA94C1
:1016400000402FEB2438F582EA34FFF583D3EF9581
:1016500082EE95834028EB24C8FBE43AFAC3EF9B63
:10166000EE9A501A120F554015120F205010D2004A
:10167000800C120F554007120F205002D200A2001A
:1016800022AE07E4FDF54012194B900002E0FF1274
:10169000195290000212173090007AE0FF1219528E
:1016A00090007A121730900086E0FF1219529000D5
:1016B0008612173074042D1217240DBD03F67F55C2
:1016C000121952021ABEAB07AA06E4F9F87F407E4F
:1016D000427D0FFC120B4EA804A905AA06AB077F9A
:1016E000207ED77D757C01120B4EC3E49FFFE49EE4
:1016F000FE22AB07AA06E4F9F87FE87E03FD22E0AC
:10170000FCA3E0FDC3EF9DEE9C22EC75F005A42444
:10171000F4F582E4341BF583E493FB740193FA74CB
:101720000293F922F582E43400F583E0FF021952B6
:10173000A3E0FF021952E54025E0248AF582E43453
:101740000022E024A9F582E43400F583228F409042
:10175000007CE0F5417F0B121AC743DB01120F75C5
:101760001200707D0A7C007F017E001218D6121ACA
:10177000AD43E202E4900085F0900084F09000CB4D
:10178000E540F090007CF0AF4122AD07AC06900040
:1017900078E0FEA3E07802CEC313CE13D8F9FFC3DE
:1017A000900079E09FFB900078E09EFAC3EB9DEA01
:1017B0009C5010A3E02FFF900078E03E120F2850BD
:1017C000028001C3229000C0E0FF9000BEE0B50798
:1017D000057E017F00229000BE121742E0FD7C00D2
:1017E0009000BEE004F0E0B41402E4F09000BDE02C
:1017F000FEEE4204E4F0AE04AF0522120F9940035E
:1018000002198C120E78120F40EFA806088002C34E
:1018100013D8FC30E00B900000E0FF121AC7D29002
:1018200022900082E0FF121AC7C290228E4B8F4C8A
:101830008C4D8D4E1216C6121A0CE54E24BF900028
:10184000CAF0E54D34FF9000C9F09000C5E54BF0BB
:10185000A3E54CF043910422D29053E2FDD2809054
:10186000007F121873C290C2809000021218734356
:10187000E20222E0FCA3E0FD7F0A7E0012182C1297
:101880001AAD22121A83121A8A121A91121A3B12D4
:1018900000261219DC121A59121A45121A4F121A7E
:1018A00018121A98121A9F121AB3021AA68E288FAB
:1018B000298C2A8D2B1216F21216D3121A009000C0
:1018C000C7E52AF0A3E52BF09000C3E528F0A3E5D7
:1018D00029F043C804228E428F438C448D45121652
:1018E000F21216D3121A0C9000C9E544F0A3E54594
:1018F000F09000C5E542F0A3E543F0439104229047
:101900000088E07008900074E004120F0A120F4E75
:10191000900088E014F0120F99500302192453E24A
:10192000FDC28022120E78120F40EFA80608800236
:10193000C313D8FC30E0059000768003900089E066
:101940007D00FCE4FF12196E22AE077FAA12195225
:10195000AF06C2029000C1E0B42002E4F09000C1E2
:10196000E02450F8A607E004F0A3E004F022AB075F
:10197000AF04EB14600C14600E2402700E8DFB8F0C
:10198000FC228DE98FEA228DEB8FEC22E4FDFCFF37
:1019900012196E120F75121ABB53D87853E2FDC29A
:1019A00080C2909000857404F022120F0BE014F0B6
:1019B0009000777401F09000857403F012192412DE
:1019C00018580200707E1DE4FDEF30E70625E06E3A
:1019D000FF8004EF25E0FF0DBD08EE22AF8853889D
:1019E000AF758CA0758DCBEF5440FEEF54104E4276
:1019F0008822C3EF94ACEE940D4003D38001C32240
:101A0000AD07AC06ECF5CBAF058FCA22AD07AC062F
:101A1000ECF593AF058F9222C2DE75D90575F9FFFB
:101A200075960122EE30E707C3E49FFFE49EFE2295
:101A30001219497F55121952021ABE75E34075E119
:101A40000175E20222E59154045391FB4291227503
:101A50008E5475892243885022E5C8540453C8FB2C
:101A600042C82253984FEB4F4DF59822E5C8C3204A
:101A7000E201D322E591C320E201D32253C8FB53F4
:101A8000C87F227597DE7597AD2275A41175D4CEE7
:101A90002275A54175D5772253F77F75DA4A22530F
:101AA000F77F75DB302275E69075A8B022E59120AE
:101AB000E2FB22439810223002FD22C2DE22D2999C
:101AC000228F9922AF99228F8C222222019030708E
:101AD00000064001904B19180012C005DC0002BC42
:101AE000012C461E28080BB8232800044C01904BFB
:101AF000191800251C0BB80003840140461E18006D
:101B0000000072D80702BC012C264040000BB81C14
:101B1000520190010303011846000100FF1ACC0294
:101B200000FF1AD90300FF1AE60400FF1AF30500AC
:101B3000FF1B000601FF1B0D0190307000064001E5
:101B4000904B19180012C005DC0002BC012C461E87
:101B500028080BB8232800044C01904B19180025C5
:101B60001C0BB80003840140461E1800000072D808
:101B70000702BC012C264040000BB81C520190010A
:101B80000303011846000100FF1B380200FF1B453C
:101B90000300FF1B520400FF1B5F0500FF1B6C06C8
:101BA00001FF1B790190307000064001904B19181D
:101BB0000012C005DC0002BC012C461E28080BB830
:101BC000232800044C01904B191800251C0BB80069
:101BD00003840140461E1800000072D80702BC01B1
:101BE0002C264040000BB81C520190010303011841
:101BF00046000100FF1BA40200FF1BB10300FF1BF6
:101C0000BE0400FF1BCB0500FF1BD80601FF1BE530
:00000001FF

View File

@ -1,9 +0,0 @@
#!/bin/sh
SCRIPTPATH="$(readlink -f "$0")"
SCRIPTPATH="${SCRIPTPATH%/*}"
rm -rf "$SCRIPTPATH/html"
echo -e "\n\n\n\n"
#cd "$SCRIPTPATH/" && doxygen && git add $DOCDIR && git commit -a -m "Documentation update."
cd "$SCRIPTPATH/" && doxygen