Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
smartshelf_mc_firmware
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d944c6c3
由
刘韬
编写于
2023-08-29 09:11:46 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
传感器检测循环后关闭当前传感器
1 个父辈
3d33aaef
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
8 行增加
和
19 行删除
.vscode/c_cpp_properties.json
.vscode/settings.json
config.h
matrixSelector.cpp
smart_shell_esp32.ino
.vscode/c_cpp_properties.json
查看文件 @
d944c6c
此文件的差异被折叠,
点击展开。
.vscode/settings.json
0 → 100644
查看文件 @
d944c6c
{
}
\ No newline at end of file
\ No newline at end of file
config.h
查看文件 @
d944c6c
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
//3010~3020
//3010~3020
#define LedTypeEPAddress 3010
#define LedTypeEPAddress 3010
#define RowWidthAddress 3020
#define RowWidthAddress 3020
#define MirrorModeAddress 3022
#define FactoryModeAddress 3050
#define FactoryModeAddress 3050
//3100~3200
//3100~3200
#define SensorCheckAddress 3100
#define SensorCheckAddress 3100
...
...
matrixSelector.cpp
查看文件 @
d944c6c
...
@@ -66,20 +66,7 @@ long matrixSelector::getadc(int pin, boolean txEn = true)
...
@@ -66,20 +66,7 @@ long matrixSelector::getadc(int pin, boolean txEn = true)
{
{
pinMode
(
select_pin
[
i
],
OUTPUT
);
pinMode
(
select_pin
[
i
],
OUTPUT
);
digitalWrite
(
select_pin
[
i
],
HIGH
);
// Serial.print("h");Serial.print(select_pin[i]);
digitalWrite
(
select_pin
[
i
],
HIGH
);
// Serial.print("h");Serial.print(select_pin[i]);
#ifdef _25MM
delay
(
5
);
#endif
#ifdef _54MM
delay
(
10
);
#endif
//if (ledcount<40)
//
delayMicroseconds
(
40
*
1000
/
ledcount
);
delayMicroseconds
(
40
*
1000
/
ledcount
);
//if(pin==20 || pin==40)
// delay(5);
//delay(10-ledcount/10);
// if (sendelay>0) delay(sendelay);
}
}
else
else
{
{
...
@@ -96,6 +83,7 @@ long matrixSelector::getadc(int pin, boolean txEn = true)
...
@@ -96,6 +83,7 @@ long matrixSelector::getadc(int pin, boolean txEn = true)
// delayMicroseconds(100);
// delayMicroseconds(100);
}
}
results
=
results
/
10
;
results
=
results
/
10
;
digitalWrite
(
select_pin
[
a
],
LOW
);
digitalWrite
(
35
,
LOW
);
digitalWrite
(
35
,
LOW
);
digitalWrite
(
34
,
LOW
);
digitalWrite
(
34
,
LOW
);
//if (results == 0 && txEn)
//if (results == 0 && txEn)
...
@@ -119,8 +107,8 @@ bool matrixSelector::getstatus(int pin)
...
@@ -119,8 +107,8 @@ bool matrixSelector::getstatus(int pin)
if
(
diagnosMode
)
if
(
diagnosMode
)
Serial
<<
"
\r\n
pin:"
<<
pin
<<
" max:"
<<
max
<<
" min: "
<<
min
<<
" sample : "
<<
sample
<<
" sen% : "
<<
result
<<
""
;
Serial
<<
"
\r\n
pin:"
<<
pin
<<
" max:"
<<
max
<<
" min: "
<<
min
<<
" sample : "
<<
sample
<<
" sen% : "
<<
result
<<
""
;
if
(
factoryMode
&&
sample
<
2
)
//
if (factoryMode && sample<2)
return
false
;
//
return false;
if
(
result
>
getthreshold
(
pin
))
if
(
result
>
getthreshold
(
pin
))
return
true
;
return
true
;
...
@@ -172,9 +160,7 @@ int matrixSelector::getmin(int pin)
...
@@ -172,9 +160,7 @@ int matrixSelector::getmin(int pin)
int
matrixSelector
::
getthreshold
(
int
pin
)
int
matrixSelector
::
getthreshold
(
int
pin
)
{
{
int
adr
=
addressInt
+
(
pin
*
2
)
+
600
;
int
adr
=
addressInt
+
(
pin
*
2
)
+
600
;
int
threshold
=
readIntFromEEPROM
(
adr
);
int
threshold
=
readIntFromEEPROM
(
adr
);
if
(
threshold
==
0
||
threshold
>
100
)
if
(
threshold
==
0
||
threshold
>
100
)
threshold
=
20
;
threshold
=
20
;
...
@@ -190,11 +176,11 @@ void matrixSelector::setcalnum(HardwareSerial *sl, int startpin, int endpin, int
...
@@ -190,11 +176,11 @@ void matrixSelector::setcalnum(HardwareSerial *sl, int startpin, int endpin, int
int
minadr
=
addressInt
+
(
pin
*
2
)
+
300
;
int
minadr
=
addressInt
+
(
pin
*
2
)
+
300
;
int
thresholdadr
=
addressInt
+
(
pin
*
2
)
+
600
;
int
thresholdadr
=
addressInt
+
(
pin
*
2
)
+
600
;
// while (!EEPROM.isReady()){}
// while (!EEPROM.isReady()){}
sl
->
println
(
pin
)
;
*
sl
<<
pin
<<
","
<<
max
<<
","
<<
min
<<
","
<<
threshold
<<
"
\r\n
"
;
if
(
max
>
0
)
if
(
max
>
0
)
writeIntIntoEEPROM
(
maxadr
,
max
,
true
);
writeIntIntoEEPROM
(
maxadr
,
max
,
true
);
if
(
min
>
0
)
if
(
min
>
=
0
)
writeIntIntoEEPROM
(
minadr
,
min
,
true
);
writeIntIntoEEPROM
(
minadr
,
min
,
true
);
if
(
threshold
>
0
)
if
(
threshold
>
0
)
...
...
smart_shell_esp32.ino
查看文件 @
d944c6c
此文件的差异被折叠,
点击展开。
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论