วันจันทร์ที่ 23 กรกฎาคม พ.ศ. 2561

Auto Intensity Control of Power LED using Arduino

 int value = analogRead(LDR);
  Serial.println(value);
  c1= value;
  c2= 500-c1;     // subtracts c2 from 1000 ans saves the result in c1

  if (value < 500)
  {
  digitalWrite(pwmPin, HIGH);
  delayMicroseconds(c2);  
  digitalWrite(pwmPin, LOW); 
  delayMicroseconds(c1);  
  }

  if (value > 500)
  {
    digitalWrite(2,LOW);
  }
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น

งานชิ้นที่ 1

องค์ประกอบหน้าที่ต่างๆของโรงงาน โดยแบ่งหน้าที่ตามความเหมาะสมและความถนัดบริหารโดยมีหัวหน้าใหญ่เป็นผู้จัดตำแหน่งหน้าที่ ...