Create a prospective "inaccurate" analogReadAverage method.
This commit is contained in:
parent
24d6685047
commit
382ba56fa7
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "1.8.59",
|
||||
"version": "1.8.60",
|
||||
"ext_port": 1111,
|
||||
"profiles": {
|
||||
"mcopy": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mcopy-app",
|
||||
"version": "1.8.59",
|
||||
"version": "1.8.60",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mcopy-app",
|
||||
"version": "1.8.59",
|
||||
"version": "1.8.60",
|
||||
"description": "GUI for the mcopy small gauge film optical printer platform",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "1.8.59",
|
||||
"version": "1.8.60",
|
||||
"ext_port": 1111,
|
||||
"profiles": {
|
||||
"mcopy": {
|
||||
|
@ -190,7 +190,8 @@
|
|||
"error": "E",
|
||||
"camera_exposure": "G",
|
||||
"state": "H",
|
||||
"home": "I"
|
||||
"home": "I",
|
||||
"offset": "O"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -303,6 +303,16 @@ long McopyProjector::analogReadAccurateAverage (uint8_t &pin) {
|
|||
return sum / (double) count;
|
||||
}
|
||||
|
||||
long McopyProjector::analogReadAverage (uint8_t &pin) {
|
||||
uint8_t count = 3;
|
||||
double sum = 0.0;
|
||||
for (uint8_t i = 0; i < count; i++) {
|
||||
sum += analogRead(pin);
|
||||
delay(1);
|
||||
}
|
||||
return sum / (double) count;
|
||||
}
|
||||
|
||||
uint16_t McopyProjector::findPeak(long (&arr)[200], uint16_t &steps) {
|
||||
uint16_t maxI = 0;
|
||||
long max = 0;
|
||||
|
|
|
@ -69,6 +69,7 @@ class McopyProjector {
|
|||
long readVcc();
|
||||
long analogReadAccurate (uint8_t &pin);
|
||||
long analogReadAccurateAverage (uint8_t &pin);
|
||||
long analogReadAverage (uint8_t &pin);
|
||||
uint16_t findPeak(long (&arr)[200], uint16_t &steps);
|
||||
void emitters(bool enabled);
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "mcopy",
|
||||
"version": "1.8.59",
|
||||
"version": "1.8.60",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "mcopy",
|
||||
"version": "1.8.59",
|
||||
"version": "1.8.60",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"arduino": "file:app/lib/arduino",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mcopy",
|
||||
"version": "1.8.59",
|
||||
"version": "1.8.60",
|
||||
"description": "Small gauge film optical printer platform",
|
||||
"main": "build.js",
|
||||
"directories": {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "1.8.59",
|
||||
"version": "1.8.60",
|
||||
"ext_port": 1111,
|
||||
"profiles": {
|
||||
"mcopy": {
|
||||
|
|
Loading…
Reference in New Issue