Thứ Tư, 5 tháng 12, 2018

Thiết bị hỗ trợ người khiếm thị

hongthu  /  at  04:24  /  KHÔNG CÓ BÌNH LUẬN

Thiết bị hỗ trợ người khiếm thị ( 80 cm < khoảng an toàn < 120 cm)
#include <SRF04.h>
SRF04 srf04(13, 12);
void setup() {
  Serial.begin(9600);
  pinMode(11, OUTPUT);
}
void loop() {
  int value = srf04.getDistance();
  Serial.println(value);
  if (80<=value && value<=120){
    digitalWrite(11, HIGH);
    delay(500);
    digitalWrite(11, LOW);
    delay(500);
  }
  while(value<80 || 120<value){
    digitalWrite(11, HIGH);
    delay(100);
    digitalWrite(11, LOW);
    delay(100);
    value = srf04.getDistance();
    Serial.println(value);
  }

Share
TRONG MỤC: Posted on: Thứ Tư, 5 tháng 12, 2018

0 nhận xét:

Bài đăng nổi bật

CÀI ĐẶT PHẦN MỀM GIẢ LẬP ARDUINO

phần mềm giả lập arduino và các thiết bị điện: proteus Phần mềm vẽ mạch: Fritzing DOWN PROTEUS  DOWN FRITZING Cài thư viện cho proteus -...

Copyright © 2013 LẬP TRÌNH ROBOT . WP Theme-junkie converted by Bloggertheme9
Blogger templates. Proudly Powered by Blogger.