V2.1
This commit is contained in:
@ -8,8 +8,7 @@ struct IS11_datastruct IS11_datastruct_fanshelv;
|
||||
STRSensorInfo SensorIS11::initSensor()
|
||||
{
|
||||
// IS1Sensor.SetPortName(id);
|
||||
pinMode(5,OUTPUT);
|
||||
pinMode(6,OUTPUT);
|
||||
|
||||
radiance_struct_up.shutter = 1;
|
||||
radiance_struct_down.shutter = 1;
|
||||
|
||||
@ -24,10 +23,9 @@ STRSensorInfo SensorIS11::initSensor()
|
||||
SensorInfo.maxValue = 65535;
|
||||
uint8_t buff[4];
|
||||
String path2 = "/system/index.bin";
|
||||
File file;
|
||||
File file;
|
||||
if(SD_MMC.exists(path2))
|
||||
{
|
||||
|
||||
file = SD_MMC.open(path2,"rb");
|
||||
file.read(buff,4);
|
||||
file.flush();
|
||||
@ -138,13 +136,18 @@ STRSensorInfo SensorIS11::GetSensorInfo()
|
||||
void SensorIS11::SetShutter(int id)
|
||||
{
|
||||
switch (id) {
|
||||
case 1:{ //关
|
||||
digitalWrite(5,LOW);
|
||||
case 1:
|
||||
{ //关
|
||||
// digitalWrite(5,LOW);
|
||||
|
||||
shutter_off();
|
||||
vTaskDelay(200);
|
||||
break;
|
||||
}
|
||||
case 2:{ //开
|
||||
digitalWrite(5,HIGH);
|
||||
case 2:
|
||||
{ //开
|
||||
// digitalWrite(5,HIGH);
|
||||
shutter_up();
|
||||
vTaskDelay(200);
|
||||
break;
|
||||
}
|
||||
@ -158,15 +161,19 @@ void SensorIS11::servo_direction(int direction)
|
||||
switch (direction)
|
||||
{
|
||||
case 0:{
|
||||
// servo_set_angle(12);
|
||||
|
||||
|
||||
shutter_down();
|
||||
servo_down();
|
||||
vTaskDelay(1500);
|
||||
vTaskDelay(500);
|
||||
shutter_off();
|
||||
break;
|
||||
}
|
||||
case 1:{
|
||||
// servo_set_angle(200);
|
||||
shutter_up();
|
||||
servo_up();
|
||||
vTaskDelay(1500);
|
||||
vTaskDelay(500);
|
||||
shutter_off();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user