OK,今天讲一个简单的毕设
实验现象
if (uS / US_ROUNDTRIP_CM <= 30 && uS / US_ROUNDTRIP_CM >= 15)
{
digitalWrite(Green, HIGH);
digitalWrite(Yello, LOW);
digitalWrite(Red, LOW);
for (int i = 19; i < 21; i++) {
display.drawBitmap((i - 16) * 16, 32, cn_allArray[i], 16, 16, 1);
delay(300);
}
}
if ((uS / US_ROUNDTRIP_CM > 30 && uS / US_ROUNDTRIP_CM < 40) || (uS / US_ROUNDTRIP_CM > 10 && uS / US_ROUNDTRIP_CM < 15))
{
digitalWrite(Green, LOW);
digitalWrite(Yello, HIGH);
digitalWrite(Red, LOW);
for (int i = 19; i < 21; i++) {
display.drawBitmap((i - 16) * 16, 32, cn_allArray[i + 4], 16, 16, 1);
delay(300);
}
}
if (uS / US_ROUNDTRIP_CM <= 10 || uS / US_ROUNDTRIP_CM >= 40)
{
digitalWrite(Green, LOW);
digitalWrite(Yello, LOW);
di