Merge pull request #35 from pyr0ball/loredans-additions

Merging Loredans additions.

Conflicts were resolved in pull from @loredan fork
This commit is contained in:
Alan Weinstock 2019-09-25 15:26:32 -07:00 committed by GitHub
commit 5f963d4dda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 796 additions and 526 deletions

View file

@ -508,229 +508,9 @@ Changelog updated 2019-08-15_15-51-13
- Migrated configs to separate header file, made adjustment to definition [view commit](http://github.com/pyr0ball/pyr0piezo/commit/56c06008d4f7463a284561b5d0a337b573caa5e8)
- Changed compiler behavior for i2c. I2C library is still broken [view commit](http://github.com/pyr0ball/pyr0piezo/commit/29fd45db239fc5beee5414f8e795ab0e6d14cb96)
### v2.1.2 to v2.1.2_docs
### v2.1.2 to v2.1.3
Changelog updated 2019-08-15_16-07-36
*Added Features*
- setting up syntax for changelogs on the docs site #featureadd [view commit](http://github.com/pyr0ball/pyr0piezo/commit/b3909173a6b2a5d6cf281d9b6a4bb987599b960d)
- Added comprehensive changelog generated from script #featureadd [view commit](http://github.com/pyr0ball/pyr0piezo/commit/74d348ea0738d7b17b176e1a6bc22478356a9dc4)
------------------------------------
*Bugfixes*
- fixed syntax for table of contents on changelog #bugfix [view commit](http://github.com/pyr0ball/pyr0piezo/commit/359c8c8eba193dcc738dbb4bd49dbabb26972748)
- added additional separator between sections added by changelog script #bugfix [view commit](http://github.com/pyr0ball/pyr0piezo/commit/ae26c4792bdd6c71721d7d552f588de34bd4fb8c)
------------------------------------
*Full Changelog*
- Migrated from single 60pin FFC to combined 15+40p [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9ab87b5e7af8316f14d91f0f32905a2cf9bfe065)
- Pushing 2.0.2 revised board files before 2.1.1 [view commit](http://github.com/pyr0ball/pyr0piezo/commit/20078fbba5095d68d17d7f252242ccdf624138eb)
- Moved to dual FFC cable (15p-1MM + 40p-0.5mm) [view commit](http://github.com/pyr0ball/pyr0piezo/commit/288184df5825215cbb5168ce213882acb00053d9)
- renamed wiki folder to assets [view commit](http://github.com/pyr0ball/pyr0piezo/commit/c35d25bfaca7ef677f694362d72bcc9297457546)
- Added installation instructions (barely) [view commit](http://github.com/pyr0ball/pyr0piezo/commit/e64b380a74445b9f6ca6972e276d2281b6686246)
- Merge branch 'master' of https://github.com/pyr0ball/pyr0piezo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/012c1f795737ca8284d5820f06e5b173a3524201)
- Added issue template for requesting a new mount [view commit](http://github.com/pyr0ball/pyr0piezo/commit/64d6b7170e7f2bd14590863803e55e8d12c258f6)
- Added issue template to docs [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9836a09d9815bd6af5e9a6b63725888c3dd5d27a)
- Adding install docs filestructure [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5c8083002abf5a97ba01641280d50dc61e172f87)
- added a few other kinematics to the install structure [view commit](http://github.com/pyr0ball/pyr0piezo/commit/ae22f79a6bf08a04917e4dbc04dd12512339747c)
- added menu structure and placeholder for hictop i3 [view commit](http://github.com/pyr0ball/pyr0piezo/commit/b1d58174f6b044423dc5ea50736fd7d7f7e50d0c)
- fixed menu structure for mkdocs [view commit](http://github.com/pyr0ball/pyr0piezo/commit/f4992fcd6497ac6babd728b552baf52eefd7e4a9)
- fixed typo with link for hictop i3 [view commit](http://github.com/pyr0ball/pyr0piezo/commit/7afba4fd389867e309a4d6ce35f0dedc032ccf8d)
- fixed issue with markdown nested bullets on install page [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9db343012f5d8d58d2d6081664139d3afae88049)
- added images for instructions for mp-delta-mini [view commit](http://github.com/pyr0ball/pyr0piezo/commit/421dc64c5309ae4d5b0f392823863c9250e7b149)
- added another pic for mp-delta-mini [view commit](http://github.com/pyr0ball/pyr0piezo/commit/f99fb90b26dbeabde37ded8b6cfadaa312624055)
- renamed ultimaker to "quadrap" to better reflect nomenclature [view commit](http://github.com/pyr0ball/pyr0piezo/commit/da1355f67e769ca19fc217469b383b3114c3f75d)
- renamed ultimaker to quadrap in main menu [view commit](http://github.com/pyr0ball/pyr0piezo/commit/38e144a0a2acef42ac2875345a4d01c0f4853e44)
- Started on documentation for the Monoprice Delta Mini [view commit](http://github.com/pyr0ball/pyr0piezo/commit/d090a3ac410088fc06946538ec17d1a2b5d85caf)
- fixed links in installation.md [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a35d7144ba730c3adaa7acc5cbf3918f194aea1f)
- fixed referential links in mp-delta-mini [view commit](http://github.com/pyr0ball/pyr0piezo/commit/25fcf6a4f852974dc23881da6e9f4a423b3c738a)
- Added instructions for monoprice-delta-mini [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9adfd8df13f709ec940abd4a55756fd96271a749)
- added a link to MPDM's unofficial wiki [view commit](http://github.com/pyr0ball/pyr0piezo/commit/6d3e4e7c5ec851a7644a41253d954307ffb685e0)
- renamed folders [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a0cb30c778c3ced5e4866b2e2f98d68da63a45c2)
- switched to material design theme for documentation site [view commit](http://github.com/pyr0ball/pyr0piezo/commit/cb10ee59afc1e9c3f57703d112152e2979da66a7)
- Added Printer firmware configuration for Marlin [view commit](http://github.com/pyr0ball/pyr0piezo/commit/af1d2a9644de6f9e80da6d760fe82fabb4f67bfa)
- fixed links and header formatting [view commit](http://github.com/pyr0ball/pyr0piezo/commit/670528cf853c4a4b99669d5b83a8eccce8cce52b)
- added script for generating changelog from commits [view commit](http://github.com/pyr0ball/pyr0piezo/commit/13e468ea065c8aa26607f415b52e7863a8c65edc)
- added favicon [view commit](http://github.com/pyr0ball/pyr0piezo/commit/4599c586ec86ea3625da7c6f9529bb54c0d592e7)
- fixed typo in menu [view commit](http://github.com/pyr0ball/pyr0piezo/commit/02cd4381babbccbe45ddf04f0fa8b526161e2fe0)
- added png favicon [view commit](http://github.com/pyr0ball/pyr0piezo/commit/eb376eaa08c4e16bf25582d310a706f825cd358e)
- added info to the changelog script [view commit](http://github.com/pyr0ball/pyr0piezo/commit/7eb7fef94f2443a8c880bf94371dfed151dce220)
- added extra functions to changelog script, added mkdocs deploy [view commit](http://github.com/pyr0ball/pyr0piezo/commit/83d4ba06536c27bbd056d8c018a7c9d176441fe8)
- updated readme and about [view commit](http://github.com/pyr0ball/pyr0piezo/commit/89a2fcd202d6a3d09e5b3f3efcdb0e4277980d7e)
- attempting to override site logo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/af209b216f268ff2a2560cc0c83615f4d5807f97)
- fixed override syntax [view commit](http://github.com/pyr0ball/pyr0piezo/commit/fcbbe91e9c0b4f053bff025b95a5ea379b856357)
- new try [view commit](http://github.com/pyr0ball/pyr0piezo/commit/8d91bb4ce249e6b522ca2dab89224a89c8c28337)
- fixing logo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/6b25d6034b9a211f617fb3ca04b5d10b1438b66b)
- Fixing favicon and site logo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/fe7d7fc12e145c693f1e7f92b36e9d4471720abf)
- fixing nested list spacing [view commit](http://github.com/pyr0ball/pyr0piezo/commit/dcb133f6c080a38ddcfdcb6e8d522375c1312d98)
- resize header logo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/3fae545d165c265db91a17785c78e571fa622377)
- Added wiring diagram for Creality boards [view commit](http://github.com/pyr0ball/pyr0piezo/commit/834f0edd9840f88fec5847efae02224923f27fe1)
- removed unneeded link [view commit](http://github.com/pyr0ball/pyr0piezo/commit/534d0a3af5f27c3e08b1df40a836ddb4ff2c5724)
- added wiring diagrams [view commit](http://github.com/pyr0ball/pyr0piezo/commit/3d6435469051d23d1e9ce79310dd2bff6cf4fbd5)
- Set theme jekyll-theme-hacker [view commit](http://github.com/pyr0ball/pyr0piezo/commit/50ac17b1408907bda199a0e1f5c8a98e752eb89b)
- Update issue templates [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a624b70024417635903ce4538bdb5e920ea7f674)
- added links to schematics in main menu [view commit](http://github.com/pyr0ball/pyr0piezo/commit/978cdfc09f7712a68177fd664d16fd7e05201d6a)
- added links for drawings [view commit](http://github.com/pyr0ball/pyr0piezo/commit/28cbdf5a7dfaf887b7a985a6ccea97bc273489ea)
- rearranged files, added test pads layout [view commit](http://github.com/pyr0ball/pyr0piezo/commit/7a3f182198a4ad50f44baea8bd10e25af56ef0ac)
- renamed drawing and schematics folders [view commit](http://github.com/pyr0ball/pyr0piezo/commit/6fb49d0695d9d32c5f06c8242c86d1f280c98196)
- fixed typo in link [view commit](http://github.com/pyr0ball/pyr0piezo/commit/eb43d782b58c8ac4078c25a1640764e6904afdec)
- fixed issue with pdf location [view commit](http://github.com/pyr0ball/pyr0piezo/commit/826d80b1ef3d8d7047234a1df63154f89ee009fb)
- fixed embedded pdf layout size [view commit](http://github.com/pyr0ball/pyr0piezo/commit/52978f2190ab88eccbe8357a4c2199311c66be55)
- added embedded content for easypiezi pinouts [view commit](http://github.com/pyr0ball/pyr0piezo/commit/93796ef50129b0f0f8f26050e093bbab7f47387c)
- fixed syntax [view commit](http://github.com/pyr0ball/pyr0piezo/commit/ecfe4ce9f3eeb5943960b54a486ae310ea5826ae)
- migrating more pages to embedded pdf [view commit](http://github.com/pyr0ball/pyr0piezo/commit/44b347371f1c1bac9be8303222e94930e1340748)
- added embedded content to layouts section [view commit](http://github.com/pyr0ball/pyr0piezo/commit/568286fb4602497f0b40f83d3dc14593da3e61e0)
- moved wiring diagrams section to installation [view commit](http://github.com/pyr0ball/pyr0piezo/commit/6c10e0eae5167eb2669e157dff772e54728b4899)
- fixed some file encoding issues [view commit](http://github.com/pyr0ball/pyr0piezo/commit/70ca4a6f7f077320650b5938f72d37aaaca95567)
- Fixed syntax issue with changelog script [view commit](http://github.com/pyr0ball/pyr0piezo/commit/11b8eb691f9091e57e7b5c387e041d60c8c8005b)
- setting up syntax for changelogs on the docs site #featureadd [view commit](http://github.com/pyr0ball/pyr0piezo/commit/b3909173a6b2a5d6cf281d9b6a4bb987599b960d)
- fixed some syntax with regex for the changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/e4de789d65ae66166892cfd899ddd3761174e3c9)
- Added comprehensive changelog generated from script #featureadd [view commit](http://github.com/pyr0ball/pyr0piezo/commit/74d348ea0738d7b17b176e1a6bc22478356a9dc4)
- fixed syntax for table of contents on changelog #bugfix [view commit](http://github.com/pyr0ball/pyr0piezo/commit/359c8c8eba193dcc738dbb4bd49dbabb26972748)
- added additional separator between sections added by changelog script #bugfix [view commit](http://github.com/pyr0ball/pyr0piezo/commit/ae26c4792bdd6c71721d7d552f588de34bd4fb8c)
------------------------------------
### v2.1.2_docs to master (Current as of 8/30/2019)
Changelog updated 2019-08-30_18-23-20
*Added Features*
- Added debug output to trigger function [view commit](http://github.com/pyr0ball/pyr0piezo/commit/952a1cdb5f59be1e5ed3c2891674b01113c42c53)
- Added gain factor to serial debug output [view commit](http://github.com/pyr0ball/pyr0piezo/commit/fd172492d7231fa85606eeea16a0e6b3804834b9)
- new version EasyPiezi-v2.1.2 - adds extra test points [view commit](http://github.com/pyr0ball/pyr0piezo/commit/c79ad7d4bd6542f21c0715cb4b44e2b669b5d266)
- added usage output to serial by sending <HELP> [view commit](http://github.com/pyr0ball/pyr0piezo/commit/4d8466d79ab1a585bd651a670ea296856efaffdb)
------------------------------------
*Bugfixes*
- commented out main loop trigger reset [view commit](http://github.com/pyr0ball/pyr0piezo/commit/afad0a1d883980d6ef4709d63f58d407af9f4484)
- fixed definition parameter for I2C config [view commit](http://github.com/pyr0ball/pyr0piezo/commit/b207482bc1ca76ba21ae846b7446e1fdff65ab32)
- Slight adjustment to wire routing for better spacing [view commit](http://github.com/pyr0ball/pyr0piezo/commit/4b5cc640be4b0230fba5ac6a6c0e6388f8372091)
- fixed footprint for RGB LED (default polarity was backwards) [view commit](http://github.com/pyr0ball/pyr0piezo/commit/52f39b6debebb7995a301e34918917907bde0778)
- fixed incorrect resistor values on FFC Direct vreg [view commit](http://github.com/pyr0ball/pyr0piezo/commit/01c530d7c6efe6135643c05cc69230a04d021c35)
- fixed 0606 rgb led footprint [view commit](http://github.com/pyr0ball/pyr0piezo/commit/bc052bccacb0cd8ddf6b6ef20190d60698f783d3)
------------------------------------
*Full Changelog*
- Added latest commits to changelog including docs site [view commit](http://github.com/pyr0ball/pyr0piezo/commit/cc0b19d3913de537ce5d10201302643757b79f09)
- commented out main loop trigger reset [view commit](http://github.com/pyr0ball/pyr0piezo/commit/afad0a1d883980d6ef4709d63f58d407af9f4484)
- fixed definition parameter for I2C config [view commit](http://github.com/pyr0ball/pyr0piezo/commit/b207482bc1ca76ba21ae846b7446e1fdff65ab32)
- Added debug output to trigger function [view commit](http://github.com/pyr0ball/pyr0piezo/commit/952a1cdb5f59be1e5ed3c2891674b01113c42c53)
- Added gain factor to serial debug output [view commit](http://github.com/pyr0ball/pyr0piezo/commit/fd172492d7231fa85606eeea16a0e6b3804834b9)
- removed tags from changelog public output [view commit](http://github.com/pyr0ball/pyr0piezo/commit/58bdb6035f41b391f0bede1c8b9190ed0e275bca)
- added regex filter to changelog.sh [view commit](http://github.com/pyr0ball/pyr0piezo/commit/ceab2568950cfb56454c11ecf20e3f8cbecdafb2)
- Slight adjustment to wire routing for better spacing [view commit](http://github.com/pyr0ball/pyr0piezo/commit/4b5cc640be4b0230fba5ac6a6c0e6388f8372091)
- fixed footprint for RGB LED (default polarity was backwards) [view commit](http://github.com/pyr0ball/pyr0piezo/commit/52f39b6debebb7995a301e34918917907bde0778)
- fixed incorrect resistor values on FFC Direct vreg [view commit](http://github.com/pyr0ball/pyr0piezo/commit/01c530d7c6efe6135643c05cc69230a04d021c35)
- fixed 0606 rgb led footprint [view commit](http://github.com/pyr0ball/pyr0piezo/commit/bc052bccacb0cd8ddf6b6ef20190d60698f783d3)
- new version EasyPiezi-v2.1.2 - adds extra test points [view commit](http://github.com/pyr0ball/pyr0piezo/commit/c79ad7d4bd6542f21c0715cb4b44e2b669b5d266)
- added usage output to serial by sending <HELP> [view commit](http://github.com/pyr0ball/pyr0piezo/commit/4d8466d79ab1a585bd651a670ea296856efaffdb)
------------------------------------
### v2.1.2 to beta-avr-v2.1.3
Changelog updated 2019-09-25_10-00-29
Changelog updated 2019-09-25_14-59-04
*Added Features*
@ -945,4 +725,72 @@ Changelog updated 2019-09-25_10-00-29
- fixed typo #changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/40b20c06701c4e4709961d153f5a9da8f45d9daf)
------------------------------------
### v2.1.3 to v2.1.4
Changelog updated 2019-09-25_14-59-18
*Added Features*
- Added EEPROM support for storing nvol settings [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5d72a5e817c182b90b1c9c7158d99bce744121f7)
- complete overhaul of serial input and debug output [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9e885f316effc105f29027d1b859969f77477851)
- updated serial input explaination to match new schema [view commit](http://github.com/pyr0ball/pyr0piezo/commit/f4af33fe75c8306b567fdcaed92f238a0757499f)
- Added input parameter for vref constant [view commit](http://github.com/pyr0ball/pyr0piezo/commit/e416f1407251516217271dc6d09cad009e482987)
------------------------------------
*Bugfixes*
- synced nomenclature for vfollower variables [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9f172f1c1811d2084bfaf8771f36a87be4b083ab)
- removed duplicate definition [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a58a7d029f7332c47529b393d8b9c7ec140cd19e)
------------------------------------
*Full Changelog*
- Initial PlatformIO conversion [view commit](http://github.com/pyr0ball/pyr0piezo/commit/b35e11696e97826a48bfd4b67bf968b803ecb49f)
- Saving settings to EEPROM and other IMO sensible changes [view commit](http://github.com/pyr0ball/pyr0piezo/commit/6b9ea8ef06b5cac687a1fa3bb2bbc2e86cc9b85d)
- Merge branch 'loredans-additions' of https://github.com/pyr0ball/pyr0piezo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/14651c0d8a27d1431cde9436dea7f583e87e192f)
- Updated gitignore, removed unnecessary files #changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/4165075fa04e9d272c837c94496393b7f12da8a5)
- Merge pull request #34 from loredan/master [view commit](http://github.com/pyr0ball/pyr0piezo/commit/6d471fd928e0e8528847f633a7832416d6675690)
- synced nomenclature for vfollower variables [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9f172f1c1811d2084bfaf8771f36a87be4b083ab)
- Added EEPROM support for storing nvol settings [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5d72a5e817c182b90b1c9c7158d99bce744121f7)
- complete overhaul of serial input and debug output [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9e885f316effc105f29027d1b859969f77477851)
- syntax cleanup #changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/26d7a978d3b91ebc985dd5a2531db3ce93cce9ff)
- more syntax fixes (from merge) #changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9ce36b86075be7ab63fc5a7872633c33d9f57950)
- actually added some of the changes intended for previous commit [view commit](http://github.com/pyr0ball/pyr0piezo/commit/59387f85027443852feffed5704f2e4e79e9d95d)
- restructured AVR firmware directory for vscode/PIO #changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/6618f35f7d874082fde64678715ce25b670e8ce2)
- migrated vscode comfig files [view commit](http://github.com/pyr0ball/pyr0piezo/commit/bf33ef43d7cdac37e594681d37dcbfd043756392)
- updated serial input explaination to match new schema [view commit](http://github.com/pyr0ball/pyr0piezo/commit/f4af33fe75c8306b567fdcaed92f238a0757499f)
- Cleanup remaining merge files #changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5dd279775a475c2e9f271fbf0d9c5aacc25821de)
- fixed variable typo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/d00b0d078a732321b527347aaf95e33d84dfe3f0)
- removed duplicate definition [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a58a7d029f7332c47529b393d8b9c7ec140cd19e)
- Added input parameter for vref constant [view commit](http://github.com/pyr0ball/pyr0piezo/commit/e416f1407251516217271dc6d09cad009e482987)
- slight change in comment structure [view commit](http://github.com/pyr0ball/pyr0piezo/commit/aa6e3148a2f259023d83884bbcfd2365e75ee605)
------------------------------------

View file

@ -1,4 +1,4 @@
###Pyr0-Piezo Changelog v2.1.2 to beta-avr-v2.1.3
###Pyr0-Piezo Changelog v2.1.2 to v2.1.3
#### Added Features

View file

@ -0,0 +1,64 @@
###Pyr0-Piezo Changelog v2.1.3 to v2.1.4
#### Added Features
- Added EEPROM support for storing nvol settings [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5d72a5e817c182b90b1c9c7158d99bce744121f7)
- complete overhaul of serial input and debug output [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9e885f316effc105f29027d1b859969f77477851)
- updated serial input explaination to match new schema [view commit](http://github.com/pyr0ball/pyr0piezo/commit/f4af33fe75c8306b567fdcaed92f238a0757499f)
- Added input parameter for vref constant [view commit](http://github.com/pyr0ball/pyr0piezo/commit/e416f1407251516217271dc6d09cad009e482987)
------------------------------------
#### Bugfixes
- synced nomenclature for vfollower variables [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9f172f1c1811d2084bfaf8771f36a87be4b083ab)
- removed duplicate definition [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a58a7d029f7332c47529b393d8b9c7ec140cd19e)
------------------------------------
#### Full Changelog
- Initial PlatformIO conversion [view commit](http://github.com/pyr0ball/pyr0piezo/commit/b35e11696e97826a48bfd4b67bf968b803ecb49f)
- Saving settings to EEPROM and other IMO sensible changes [view commit](http://github.com/pyr0ball/pyr0piezo/commit/6b9ea8ef06b5cac687a1fa3bb2bbc2e86cc9b85d)
- Merge branch 'loredans-additions' of https://github.com/pyr0ball/pyr0piezo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/14651c0d8a27d1431cde9436dea7f583e87e192f)
- Updated gitignore, removed unnecessary files #changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/4165075fa04e9d272c837c94496393b7f12da8a5)
- Merge pull request #34 from loredan/master [view commit](http://github.com/pyr0ball/pyr0piezo/commit/6d471fd928e0e8528847f633a7832416d6675690)
- synced nomenclature for vfollower variables [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9f172f1c1811d2084bfaf8771f36a87be4b083ab)
- Added EEPROM support for storing nvol settings [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5d72a5e817c182b90b1c9c7158d99bce744121f7)
- complete overhaul of serial input and debug output [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9e885f316effc105f29027d1b859969f77477851)
- syntax cleanup #changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/26d7a978d3b91ebc985dd5a2531db3ce93cce9ff)
- more syntax fixes (from merge) #changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/9ce36b86075be7ab63fc5a7872633c33d9f57950)
- actually added some of the changes intended for previous commit [view commit](http://github.com/pyr0ball/pyr0piezo/commit/59387f85027443852feffed5704f2e4e79e9d95d)
- restructured AVR firmware directory for vscode/PIO #changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/6618f35f7d874082fde64678715ce25b670e8ce2)
- migrated vscode comfig files [view commit](http://github.com/pyr0ball/pyr0piezo/commit/bf33ef43d7cdac37e594681d37dcbfd043756392)
- updated serial input explaination to match new schema [view commit](http://github.com/pyr0ball/pyr0piezo/commit/f4af33fe75c8306b567fdcaed92f238a0757499f)
- Cleanup remaining merge files #changelog [view commit](http://github.com/pyr0ball/pyr0piezo/commit/5dd279775a475c2e9f271fbf0d9c5aacc25821de)
- fixed variable typo [view commit](http://github.com/pyr0ball/pyr0piezo/commit/d00b0d078a732321b527347aaf95e33d84dfe3f0)
- removed duplicate definition [view commit](http://github.com/pyr0ball/pyr0piezo/commit/a58a7d029f7332c47529b393d8b9c7ec140cd19e)
- Added input parameter for vref constant [view commit](http://github.com/pyr0ball/pyr0piezo/commit/e416f1407251516217271dc6d09cad009e482987)
- slight change in comment structure [view commit](http://github.com/pyr0ball/pyr0piezo/commit/aa6e3148a2f259023d83884bbcfd2365e75ee605)

View file

@ -1 +1,92 @@
#Under construction
## Configurations over UART/Serial TTY
To set the below parameters using serial input, use the following:
- To change trigger active duration: `TRG_D` [integer for milliseconds]
- To change gain factor: `GAIN_F` [integer for gain state - see note*]
- To change ADC hysteresis value: `HYST` [integer]
- To change sensor input pullup vRef low threshold: `VFOL` [integer in millivolts]
- To change comparator trigger high threshold: `VCOMP` [integer in millivolts]
- To change the duration between ADC measurements: `LOOP_D` [integer in milliseconds]
You can also enable or disable DEBUG output with: `DEBUG` [0|1]
You can query the current configuration with: `CONFIG`
You can query the current state (including ADC measurements) with: `STATE`
To reset all settings to defaults, use: `RESET`
These commands should be wrapped in this format:
1CMD INT1
Examples:
- `GAIN_F 3` <~ set gain factor to index 3 (6x)
- `VFOL 2350` <~ set the vref floor to 2.35V
- `DEBUG 1` <~ Enable debug output
- `STATE` <~ display current sensor status
*Note for Gain Factor:
The gain STATE is representative of these values:
0 = 3x
1 = 3.5x
2 = 4.33x
3 = 6x
4 = 11x
------------------------
## Calibrating the internal vRef
The adc calculation in this sensor assumes an "ideal" constant value which
is used to convert the internal 1.1v reference.
Each Atmega chip is slightly different, so it won't be completely accurate
without tuning. Most of the time this won't be necessary, so don't mess
with this if you don't know what you're doing!
The reading can be fine-tuned by using a multimeter, and this equation:
```
scale_constant = internal1.1Ref * 1023 * 1000
where
internal1.1Ref = 1.1 * Vcc1 (per voltmeter) / Vcc2 (per readVcc() function)
```
If the scale_constant calculated is different from the default 1125300,
update the voltMeterConstant variable in pP_config.h with the correct value.
## Configuration in firmware
All default configurations are stored in `pP_config.h`.
`#define GAIN_FACTOR_DEFAULT 2`
- Gain adjustment factor. 0=3x, 1=3.5x, 2=4.33x, 3=6x, 4=11x
`#define FOLLOWER_THRESHOLD_DEFAULT 1450`
- Voltage follower default voltage in millivolts (1/1000V)
`#define COMP_THRESHOLD_DEFAULT 2850`
- Comparatore Vref default voltage in mV
`#define InitCount 6`
- Number of times to blink the LED on start
`#define LOOP_DUR_DEFAULT 50`
- Duration of time between ADC checks and other loop functions
`#define TRG_DUR_DEFAULT 20`
- Duration of the Z-axis pulse sent, in ms
`#define HYST_DEFAULT 20`
- Software hysteresis for ADC/DAC adjustment, in mV (±20 default)
`extern long voltMeterConstant = 1125300L;`
- For fine tuning input voltage sense
`extern byte pP_i2c_address = 0xa0;`
- I2C Bus Slave Address

View file

@ -0,0 +1,7 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
.vscode/settings.json
.travis.yml

View file

@ -0,0 +1,6 @@
{
"board": "MiniCore:avr:328",
"configuration": "bootloader=uart0,variant=modelPB,BOD=1v8,LTO=Os,clock=8MHz_internal",
"programmer": "AVRISP mkII",
"sketch": "src\\Pyr0_Piezo_Sensor_v2.x.x.cpp"
}

View file

@ -0,0 +1,23 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${HOME}\\AppData\\Local\\Arduino15\\packages\\MiniCore\\hardware\\avr\\2.0.3\\**",
"${workspaceFolder}\\**",
"D:\\Arduino\\**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:\\Program Files\\LLVM\\bin\\clang.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64",
"forcedInclude": []
}
],
"version": 4
}

View file

@ -0,0 +1,7 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}

View file

@ -1,41 +0,0 @@
// Configurable settings:
#if !(defined(GAIN_FACTOR))
int GAIN_FACTOR = 2; // Gain adjustment factor. 0=3x, 1=3.5x, 2=4.33x, 3=6x, 4=11x
#endif
#ifndef senseThrs
#define senseThrs 1450
#endif
#ifndef compThrs
#define compThrs 2850
#endif
#ifndef InitCount
#define InitCount 6 // Number of times to blink the LED on start
#endif
#if !(defined(LOOP_DUR))
int LOOP_DUR = 50; // duration of time between ADC checks and other loop functions
#endif
#if !(defined(TRG_DUR))
int TRG_DUR = 20; // duration of the Z-axis pulse sent, in ms
#endif
#if !(defined(Hyst))
int Hyst = 20; // Hysteresis value for ADC measurements
#endif
#if !(defined(voldMeterConstant))
long voltMeterConstant = 1125300L; // For fine tuning input voltage sense
#endif
#ifdef I2C_INPUT
#if !(defined(pP_i2c_address))
byte pP_i2c_address = 0xa0; // I2C Bus Address
#endif
#endif

View file

@ -1,211 +0,0 @@
/*------------------------------------------------*/
void parseData() {
// split the data into its parts
char * strtokIndx; // this is used by strtok() as an index
strtokIndx = strtok(inputBuffer,","); // get the first part - the string
strcpy(serialMessageIn, strtokIndx); // copy it to serialMessageIn
strtokIndx = strtok(NULL, ","); // this continues where the previous call left off
serialInt = atoi(strtokIndx); // convert this part to an integer
}
/*------------------------------------------------*/
void identifyMarkers() {
char x = Serial.read();
// char y = Wire.read();
if (x == endMarker) {
readInProgress = false;
serialIncoming = true;
inputBuffer[bytesRecvd] = 0;
parseData();
}
else if(readInProgress) {
inputBuffer[bytesRecvd] = x;
bytesRecvd ++;
if (bytesRecvd == buffSize) {
bytesRecvd = buffSize - 1;
}
}
else if (x == startMarker) {
bytesRecvd = 0;
readInProgress = true;
}
#ifdef I2C
if (y == endMarker) {
readInProgress = false;
serialIncoming = true;
inputBuffer[bytesRecvd] = 0;
parseData();
}
if(readInProgress) {
inputBuffer[bytesRecvd] = y;
bytesRecvd ++;
if (bytesRecvd == buffSize) {
bytesRecvd = buffSize - 1;
}
}
if (y == startMarker) {
bytesRecvd = 0;
readInProgress = true;
}
#endif
}
/*------------------------------------------------*/
void updateTrigDuration() {
if (serialInt >= 0) {
TRG_DUR = serialInt;
}
}
/*------------------------------------------------*/
void updateGainFactor() {
if (serialInt >= 0) {
GAIN_FACTOR = serialInt;
}
}
/*------------------------------------------------*/
void updateVComp() {
if (serialInt >= 0) {
compInt = serialInt;
//senseInt = compInt; // syncing these params til #24 is fixed
}
}
/*------------------------------------------------*/
void updateVAdj() {
if (serialInt >= 0) {
senseThrs = serialInt;
//compInt = senseInt; // syncing these params til #24 is fixed
}
}
/*------------------------------------------------*/
void updateHysteresis() {
if (serialInt >= 0) {
Hyst = serialInt;
}
}
/*------------------------------------------------*/
void updateParams() {
if (strcmp(serialMessageIn, "TRG_D") == 0) {
updateTrigDuration();
}
else if (strcmp(serialMessageIn, "GAIN_F") == 0) {
updateGainFactor();
}
else if (strcmp(serialMessageIn, "VCOMP") == 0) {
updateVComp();
}
else if (strcmp(serialMessageIn, "VADJ") == 0) {
updateVAdj();
}
else if (strcmp(serialMessageIn, "HYST") == 0) {
updateHysteresis();
}
else if (strcmp(serialMessageIn, "HELP") == 0) {
Serial.println("To change trigger active duration: TRG_D [integer for milliseconds]");
Serial.println("To change gain factor: GAIN_F [integer for gain state - see note*]");
Serial.println("To change ADC hysteresis value: HYST [integer]");
Serial.println("To change sensor input pullup vRef low threshold: VADJ [float value]");
Serial.println("To change comparator trigger high threshold: VCOMP [float value]");
Serial.println("");
Serial.println("These commands should be wrapped in this format:");
Serial.println("<CMD, INT>");
Serial.println("");
Serial.println("Examples:");
Serial.println("<GAIN_F, 3> <~ set gain factor to index 3 (6x)");
Serial.println("<VADJ, 2350> <~ set the vref floor to 2.35V");
parseData();
}
}
/*------------------------------------------------*/
void serialInput() {
// receive data from Serial and save it into inputBuffer
if(Serial.available() > 0) {
// the order of these IF clauses is significant
identifyMarkers();
}
}
/*------------------------------------------------*/
void serialReply() {
#ifndef VERBOSE
if (serialIncoming) {
serialIncoming = false;
#endif
#ifdef DEBUG
Serial.print("Vcc:");
Serial.println(Vin);
Serial.print("Comp Sense:");
Serial.print(VComp);
Serial.print(" ");
Serial.print("Comparator State:");
Serial.print(ADJ_COMP);
Serial.print(" ");
Serial.println(compInt);
Serial.print("Amp Sense:");
Serial.print(VAdj);
Serial.print(" ");
Serial.print("Follower State:");
Serial.print(ADJ_FOLLOW);
Serial.print(" ");
Serial.println(senseInt);
Serial.print("Gain Factor:");
Serial.print(GAIN_FACTOR);
switch (GAIN_FACTOR) {
case 0:
Serial.println(" 3x");
break;
case 1:
Serial.println(" 3.5x");
break;
case 2:
Serial.println(" 4.33x");
break;
case 3:
Serial.println(" 6x");
break;
case 4:
Serial.println(" 11x");
break;
default:
Serial.println(" INVALID");
break;
}
#endif
Serial.print("Delay:");
Serial.println(TRG_DUR);
Serial.print("Error State:");
Serial.println(ERR_STATE);
Serial.println("------------------");
#ifndef VERBOSE
}
#endif
}

View file

@ -0,0 +1,26 @@
;PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:ATmega88P]
platform = atmelavr
board = ATmega88P
framework = arduino
upload_protocol = stk500v1
; each flag in a new line
upload_flags =
-P$UPLOAD_PORT
-b$UPLOAD_SPEED
; edit these lines
upload_port = COM4
upload_speed = 19200
board_build.f_cpu = 1000000L

View file

@ -27,23 +27,34 @@
by Alan "pyr0ball" Weinstock
This code is in the public domain.
*/
------------------------------------------------------------*/
/* To set the below parameters using serial input, use the following:
/*-----------------------------------------------------------
To set the below parameters using serial input, use the following:
To change trigger active duration: TRG_D [integer for milliseconds]
To change gain factor: GAIN_F [integer for gain state - see note*]
To change ADC hysteresis value: HYST [integer]
To change sensor input pullup vRef low threshold: VADJ [float value]
To change comparator trigger high threshold: VCOMP [float value]
To change sensor input pullup vRef low threshold: VFOL [integer in millivolts]
To change comparator trigger high threshold: VCOMP [integer in millivolts]
To change the duration between ADC measurements: LOOP_D [integer in milliseconds]
To update the internal vRef constant value **(see notes below): CONST [long value]
You can also enable or disable DEBUG output with: DEBUG [0|1]
You can query the current configuration with: CONFIG
You can query the current state (including ADC measurements) with: STATE
To reset all settings to defaults, use: RESET
These commands should be wrapped in this format:
<CMD, INT>
CMD INT
Examples:
<GAIN_F, 3> <~ set gain factor to index 3 (6x)
<VADJ, 2350> <~ set the vref floor to 2.35V
GAIN_F 3 <~ set gain factor to index 3 (6x)
VFOL 2350 <~ set the vref floor to 2.35V
DEBUG 1 <~ Enable debug output
STATE <~ display current sensor status
*Note for Gain Factor:
The gain STATE is representative of these values:
@ -52,9 +63,24 @@ The gain STATE is representative of these values:
2 = 4.33x
3 = 6x
4 = 11x
*/
/*------------------------------------------------------------*/
**Note for calibrating internal 1.1v vRef:
The ADC reading function assumes an "ideal" multiplier constant. Each Atmega
chip is slightly different, so it won't be completely accurate without tuning.
Most of the time this won't be necessary, so don't mess with this if you don't
know what you're doing!
The reading can be fine-tuned by using a multimeter, and this equation:
scale_constant = internal1.1Ref * 1023 * 1000
where
internal1.1Ref = 1.1 * Vcc1 (per voltmeter) / Vcc2 (per readVcc() function)
If the scale_constant calculated is different from the default 1125300,
update the voltMeterConstant variable in pP_config.h with the correct value
------------------------------------------------------------*/
// Debug output toggle. Uncomment to enable
#define DEBUG true
@ -64,6 +90,8 @@ The gain STATE is representative of these values:
//#define VERBOSE true
// Headers, variables, and functions
include <Arduino.h>
include <EEPROM.h>
#include "LightChrono.h"
#include "pP_pins.h"
#include "pP_config.h"
@ -103,6 +131,10 @@ void setup() {
delay(2); // Wait for vref to settle
Serial.println("Initializing Pyr0-Piezo Sensor...");
restoreConfig();
adjustGain();
}
/*------------------------------------------------*/
@ -122,35 +154,46 @@ void loop() {
serialInput();
// Set any new parameters from serial input
if (serialIncoming) {
updateParams();
}
// Set the amplification gain factor
adjustGain();
// Check voltage of first and second stages and compare against thresholds
adjustVin();
readVin();
VComp = analogRead(VCOMP_SENSE_PIN);
VAdj = analogRead(V_FOLLOW_PIN);
VFol = analogRead(V_FOLLOW_PIN);
// Voltage Follower adjustment
VLast = VOld - Vin;
if (VLast > Hyst || VLast < -Hyst) {
adjustFollow();
}
// Voltage Comparator adjustment
if (VLast > Hyst || VLast < -Hyst) {
adjustComp();
// Alert the user that auto-calibration is ongoing
ERR_STATE = 1;
} else {
ERR_STATE = 0;
}
// Alert the user that auto-calibration is ongoing
calibrateAlert();
// Blink LED's on init
if (BlinkCount > 0) {
BlinkState = !BlinkState;
digitalWrite(ERR_LED, BlinkState);
digitalWrite(TRG_OUT, BlinkState);
--BlinkCount;
} else {
// Check for error state
checkError();
}
// Reply with status
serialReply();
// Print state if debug is on
if (Debug > 0) {
serialPrintState();
}
// Sets trigger output state to false after completing loop
//digitalWrite(TRG_OUT, HIGH);
sensorHReading = 0;

View file

@ -0,0 +1,77 @@
#include "pP_config.h"
#include <EEPROM.h>
int GAIN_FACTOR = GAIN_FACTOR_DEFAULT; // Gain adjustment factor. 0=3x, 1=3.5x, 2=4.33x, 3=6x, 4=11x
int followerThrs = FOLLOWER_THRESHOLD_DEFAULT;
int compThrs = COMP_THRESHOLD_DEFAULT;
int LOOP_DUR = LOOP_DUR_DEFAULT; // duration of time between ADC checks and other loop functions
int TRG_DUR = TRG_DUR_DEFAULT; // duration of the Z-axis pulse sent, in ms
int Hyst = HYST_DEFAULT; // Hysteresis value for ADC measurements
int Debug = 0;
void resetEEPROM() {
resetConfig();
EEPROM.put(GAIN_FACTOR_ADDRESS, GAIN_FACTOR);
EEPROM.put(FOLLOWER_THRESHOLD_ADDRESS, followerThrs);
EEPROM.put(COMP_THRESHOLD_ADDRESS, compThrs);
EEPROM.put(LOOP_DUR_ADDRESS, LOOP_DUR);
EEPROM.put(TRG_DUR_ADDRESS, TRG_DUR);
EEPROM.put(HYST_ADDRESS, Hyst);
EEPROM.put(VM_CONST_ADDRESS, voltMeterConstant);
}
// Restore config from EEPROM, otherwise reset config and write to EEPROM
void restoreConfig() {
int temp;
EEPROM.get(GAIN_FACTOR_ADDRESS, temp);
if (temp < 0 || temp > 4) {
resetEEPROM();
} else {
GAIN_FACTOR = temp;
}
EEPROM.get(FOLLOWER_THRESHOLD_ADDRESS, temp);
if (temp < 0 || temp > 5000) {
resetEEPROM();
} else {
followerThrs = temp;
}
EEPROM.get(COMP_THRESHOLD_ADDRESS, temp);
if (temp < 0 || temp > 5000) {
resetEEPROM();
} else {
compThrs = temp;
}
EEPROM.get(LOOP_DUR_ADDRESS, temp);
if (temp < 0 && temp > 1000) {
resetEEPROM();
} else {
LOOP_DUR = temp;
}
EEPROM.get(TRG_DUR_ADDRESS, temp);
if (temp < 0 || temp > 1000) {
resetEEPROM();
} else {
TRG_DUR = temp;
}
EEPROM.get(HYST_ADDRESS, temp);
if (temp < 0 || temp > 1000) {
resetEEPROM();
} else {
Hyst = temp;
}
}
void resetConfig() {
GAIN_FACTOR = GAIN_FACTOR_DEFAULT;
followerThrs = FOLLOWER_THRESHOLD_DEFAULT;
compThrs = COMP_THRESHOLD_DEFAULT;
LOOP_DUR = LOOP_DUR_DEFAULT;
TRG_DUR = TRG_DUR_DEFAULT;
Hyst = HYST_DEFAULT;
}

View file

@ -0,0 +1,65 @@
#ifndef PP_CONFIG_H
#define PP_CONFIG_H
// Configurable settings:
#define GAIN_FACTOR_DEFAULT 2 // Gain adjustment factor. 0=3x, 1=3.5x, 2=4.33x, 3=6x, 4=11x
#define GAIN_FACTOR_ADDRESS 0
#if !(defined(GAIN_FACTOR))
extern int GAIN_FACTOR;
#endif
#define FOLLOWER_THRESHOLD_DEFAULT 1450 // Voltage follower default voltage in mV
#define FOLLOWER_THRESHOLD_ADDRESS 4
#if !(defined(followerThrs))
extern int followerThrs;
#endif
#define COMP_THRESHOLD_DEFAULT 2850 // Comparatore Vref default voltage in mV
#define COMP_THRESHOLD_ADDRESS 8
#if !(defined(compThrs))
extern int compThrs;
#endif
#ifndef InitCount
#define InitCount 6 // Number of times to blink the LED on start
#endif
#define LOOP_DUR_DEFAULT 50 // duration of time between ADC checks and other loop functions
#define LOOP_DUR_ADDRESS 12
#if !(defined(LOOP_DUR))
extern int LOOP_DUR;
#endif
#define TRG_DUR_DEFAULT 20 // duration of the Z-axis pulse sent, in ms
#define TRG_DUR_ADDRESS 16
#if !(defined(TRG_DUR))
extern int TRG_DUR;
#endif
#define HYST_DEFAULT 20
#define HYST_ADDRESS 20
#if !(defined(Hyst))
extern int Hyst; // Hysteresis value for ADC measurements
#endif
#if !(defined(Debug))
extern int Debug;
#endif
#define VM_CONST_ADDRESS 28
#if !(defined(voltMeterConstant))
extern long voltMeterConstant = 1125300L; // For fine tuning input voltage sense
#endif
#ifdef I2C_INPUT
#define I2C_SLAVE_ADDRESS 24
#if !(defined(pP_i2c_address))
extern byte pP_i2c_address = 0xa0; // I2C Bus Address
#endif
#endif
void restoreConfig();
void resetConfig();
#endif

View file

@ -40,7 +40,8 @@ long readVcc() {
return result; // Vcc in millivolts
}
/* The above function assumes an "ideal" multiplier constant.
/*-------------------------------------------------
The above function assumes an "ideal" multiplier constant.
Each Atmega chip is slightly different, so it won't be completely accurate
without tuning. Most of the time this won't be necessary, so don't mess
with this if you don't know what you're doing!
@ -53,18 +54,17 @@ where
internal1.1Ref = 1.1 * Vcc1 (per voltmeter) / Vcc2 (per readVcc() function)
If the scale_constant calculated is different from the default 1125300,
update the voltMeterConstant variable in pP_config.h with the correct value*/
update the voltMeterConstant variable in pP_config.h with the correct value
--------------------------------------------------*/
/*------------------------------------------------*/
void adjustVin() {
void readVin() {
VOld = Vin;
Vin = readVcc(), DEC;
senseLong = senseThrs * 1024L;
compLong = compThrs * 1024L;
senseInt = (long long) senseLong / Vin;
followerLong = followerThrs * 1023L;
compLong = compThrs * 1023L;
followerInt = (long long) followerLong / Vin;
compInt = (long long) compLong / Vin;
senseInt = (int) senseInt;
followerInt = (int) followerInt;
compInt = (int) compInt;
}
@ -74,7 +74,7 @@ update the voltMeterConstant variable in pP_config.h with the correct value*/
/* Compares diffs of threshold vs read value
if positive, adjusts the follower to within
the range set above*/
ADJ_FOLLOW = (senseInt / 4);
ADJ_FOLLOW = (followerInt / 4);
// Analog output (PWM) of duty cycle
analogWrite(V_FOL_PWM, ADJ_FOLLOW);
@ -106,7 +106,6 @@ void adjustGain() {
pinMode(GADJ_R2, INPUT);
pinMode(GADJ_R1, INPUT);
pinMode(GADJ_R0, INPUT);
ERR_STATE = 0;
}
else if (GAIN_FACTOR > 0) {
pinMode(GADJ_R3, OUTPUT);
@ -114,25 +113,21 @@ void adjustGain() {
pinMode(GADJ_R2, INPUT);
pinMode(GADJ_R1, INPUT);
pinMode(GADJ_R0, INPUT);
ERR_STATE = 0;
}
else if (GAIN_FACTOR > 1) {
pinMode(GADJ_R2, OUTPUT);
digitalWrite(GADJ_R2, LOW);
pinMode(GADJ_R1, INPUT);
pinMode(GADJ_R0, INPUT);
ERR_STATE = 0;
}
else if (GAIN_FACTOR > 2) {
pinMode(GADJ_R1, OUTPUT);
digitalWrite(GADJ_R1, LOW);
pinMode(GADJ_R0, INPUT);
ERR_STATE = 0;
}
else if (GAIN_FACTOR > 3) {
pinMode(GADJ_R0, OUTPUT);
digitalWrite(GADJ_R0, LOW);
ERR_STATE = 0;
}
}

View file

@ -31,7 +31,7 @@ void pP_i2c::i2cInput(int bytesReceived) {
}
switch (cmdRcvd[0]) {
case 0x00:
senseInt = (long) cmdRcvd[1];
followerInt = (long) cmdRcvd[1];
return;
break;
case 0x01:

View file

@ -0,0 +1,275 @@
void parseData() {
// split the data into its parts
char *strtokIndx; // this is used by strtok() as an index
strtokIndx = strtok(inputBuffer, " "); // get the first part - the string
strcpy(serialMessageIn, strtokIndx); // copy it to serialMessageIn
strtokIndx = strtok(NULL, " "); // this continues where the previous call left off
serialInt = atoi(strtokIndx); // convert this part to an integer
}
/*------------------------------------------------*/
void identifyMarkers() {
char x = Serial.read();
// char y = Wire.read();
if (x == endMarker) {
serialIncoming = true;
inputBuffer[bytesRecvd] = 0;
parseData();
bytesRecvd = 0;
} else {
inputBuffer[bytesRecvd] = x;
bytesRecvd++;
if (bytesRecvd == buffSize)
{
bytesRecvd = buffSize - 1;
}
}
#ifdef I2C_INPUT
if (y == endMarker) {
readInProgress = false;
serialIncoming = true;
inputBuffer[bytesRecvd] = 0;
parseData();
}
if (readInProgress) {
inputBuffer[bytesRecvd] = y;
bytesRecvd++;
if (bytesRecvd == buffSize) {
bytesRecvd = buffSize - 1;
}
}
if (y == startMarker) {
bytesRecvd = 0;
readInProgress = true;
}
#endif
}
/*------------------------------------------------*/
void updateGainFactor()
{
if (serialInt >= 0)
{
GAIN_FACTOR = serialInt;
adjustGain();
EEPROM.put(GAIN_FACTOR_ADDRESS, GAIN_FACTOR);
}
}
/*------------------------------------------------*/
void updateVFol() {
if (serialInt >= 0)
{
followerThrs = serialInt;
adjustFollow();
EEPROM.put(FOLLOWER_THRESHOLD_ADDRESS, followerThrs);
}
}
/*------------------------------------------------*/
void updateVComp() {
if (serialInt >= 0)
{
compThrs = serialInt;
adjustComp();
EEPROM.put(COMP_THRESHOLD_ADDRESS, compThrs);
}
}
/*------------------------------------------------*/
void updateLoopDuration()
{
if (serialInt >= 0)
{
LOOP_DUR = serialInt;
EEPROM.put(LOOP_DUR_ADDRESS, LOOP_DUR);
}
}
/*------------------------------------------------*/
void updateTrigDuration() {
if (serialInt >= 0)
{
TRG_DUR = serialInt;
EEPROM.put(TRG_DUR_ADDRESS, TRG_DUR);
}
}
/*------------------------------------------------*/
void updateHysteresis() {
if (serialInt >= 0)
{
Hyst = serialInt;
EEPROM.put(HYST_ADDRESS, Hyst);
}
}
/*------------------------------------------------*/
void updateConstant() {
if (serialInt >= 0)
{
voltMeterConstant = serialInt;
EEPROM.put(VM_CONST_ADDRESS, voltMeterConstant);
}
}
/*------------------------------------------------*/
void updateDebug() {
if (serialInt > 0) {
Debug = 1;
} else if (serialInt == 0) {
Debug = 0;
}
}
/*------------------------------------------------*/
void serialPrintConfig()
{
Serial.print("GAIN_F ");
Serial.print(GAIN_FACTOR);
switch (GAIN_FACTOR)
{
case 0:
Serial.println(" 3x");
break;
case 1:
Serial.println(" 3.5x");
break;
case 2:
Serial.println(" 4.33x");
break;
case 3:
Serial.println(" 6x");
break;
case 4:
Serial.println(" 11x");
break;
default:
Serial.println(" INVALID");
break;
}
Serial.print("VFOL ");
Serial.println(followerThrs);
Serial.print("VCOMP ");
Serial.println(compThrs);
Serial.print("LOOP_D ");
Serial.println(LOOP_DUR);
Serial.print("TRG_D ");
Serial.println(TRG_DUR);
Serial.print("HYST ");
Serial.println(Hyst);
Serial.print("VM_CONST ");
Serial.println(voltMeterConstant);
}
void serialPrintState()
{
Serial.print("{");
Serial.print("\"Vcc\":");
Serial.print(Vin);
Serial.print(",");
Serial.print("\"VComp\":");
Serial.print(VComp);
Serial.print(",");
Serial.print("\"VFol\":");
Serial.print(VFol);
Serial.print(",");
Serial.print("\"Err\":");
Serial.print(ERR_STATE);
Serial.println("}");
}
void updateParams() {
serialIncoming = false;
if (strcmp(serialMessageIn, "GAIN_F") == 0) {
updateGainFactor();
}
else if (strcmp(serialMessageIn, "VFOL") == 0) {
updateVFol();
}
else if (strcmp(serialMessageIn, "VCOMP") == 0) {
updateVComp();
}
else if (strcmp(serialMessageIn, "LOOP_D") == 0) {
updateTrigDuration();
}
else if (strcmp(serialMessageIn, "TRG_D") == 0) {
updateTrigDuration();
}
else if (strcmp(serialMessageIn, "HYST") == 0) {
updateHysteresis();
}
else if (strcmp(serialMessageIn, "CONST") == 0) {
updateConstant();
}
else if (strcmp(serialMessageIn, "DEBUG") == 0) {
updateDebug();
}
else if (strcmp(serialMessageIn, "CONFIG") == 0) {
serialPrintConfig();
}
else if (strcmp(serialMessageIn, "RESET") == 0) {
resetConfig();
serialPrintConfig();
}
else if (strcmp(serialMessageIn, "STATE") == 0) {
serialPrintState();
}
else if (strcmp(serialMessageIn, "HELP") == 0) {
// Serial.println("To change gain factor: GAIN_F [integer for gain state - see note*]");
// Serial.println("To change voltage follower voltage (low threshold): VFOL [float value]");
// Serial.println("To change comparator voltage (high threshold): VCOMP [float value]");
// Serial.println("To change main loop period: LOOP_D [integer for milliseconds]");
// Serial.println("To change trigger active duration: TRG_D [integer for milliseconds]");
// Serial.println("To change ADC hysteresis value: HYST [integer]");
// Serial.println("To enable or disable debug output: DEBUG [0|1]");
// Serial.println("To print current config: CONFIG");
// Serial.println("To reset config to defaults: RESET");
// Serial.println("To print current state: STATE");
// Serial.println("");
// Serial.println("Commands are entered in this format:");
// Serial.println("CMD VAL");
// Serial.println("Commands are confirmed with Enter key");
// Serial.println("");
// Serial.println("Examples:");
// Serial.println("GAIN_F 3 <~ set gain factor to index 3 (6x)");
// Serial.println("VFOL 2350 <~ set the vref floor to 2.35V");
}
parseData();
}
void serialInput() {
// receive data from Serial and save it into inputBuffer
if (Serial.available() > 0) {
// the order of these IF clauses is significant
identifyMarkers();
}
}

View file

@ -10,20 +10,16 @@ int VLast = 0;
// Convert threshold values based on the input voltage
long senseLong = senseThrs * 1024L;
long compLong = compThrs * 1024L;
long senseInt;
long followerLong = followerThrs * 1023L;
long compLong = compThrs * 1023L;
long followerInt;
long compInt;
// Voltage Comparator Adjustment parameters
int VComp = 0;
int diffCompL = VComp - compInt;
int diffCompH = compInt - VComp;
// Voltage Follower Adjustment parameters
int VAdj = 0;
int diffAdjL = VAdj - senseInt;
int diffAdjH = senseInt - VAdj;
int VFol = 0;
// Error blink parameters
@ -33,10 +29,8 @@ int BlinkCount = InitCount * 2; // Multiply Blink count by 2 to handle
// Serial Input Parsing Variables
#define buffSize 40
char inputBuffer[buffSize];
#define startMarker '<'
#define endMarker '>'
#define endMarker '\n'
byte bytesRecvd = 0;
bool readInProgress = false;
bool serialIncoming = false;
char serialMessageIn[buffSize] = {0};
int serialInt = 0;

View file

@ -73,7 +73,8 @@ nav:
- Changelog:
- Version List: 'changelog.md'
- Logs:
- 'v2.1.2-v2.1.3': 'changelogs/changelog_2019-09-25_v2.1.2_beta-avr-v2.1.3.md'
- 'v2.1.3-v2.1.4': 'changelogs/changelog_2019-09-25_v2.1.3_v2.1.4.md'
- 'v2.1.2-v2.1.3': 'changelogs/changelog_2019-09-25_v2.1.2_v2.1.3.md'
- 'v2.1.1-v2.1.2': 'changelogs/changelog_2019-08-15_v2.1.1_v2.1.2.md'
- 'v2.0.2-v2.1.1': 'changelogs/changelog_2019-08-15_v2.0.2_v2.1.1.md'
- 'v2.0.1_hw-v2.0.2': 'changelogs/changelog_2019-08-15_v2.0.1_hw_v2.0.2.md'