Arudino学习(一)读取超声波数值

Arudino学习(一)读取超声波数值_第1张图片

Arudino学习(一)读取超声波数值_第2张图片



GPIO的arudino程序

unsigned int EchoPin = 2;           // connect Pin 2(Arduino digital io) to Echo/RX at US-100
unsigned int TrigPin = 3;           // connect Pin 3(Arduino digital io) to Trig/TX at US-100
unsigned long Time_Echo_us = 0;
unsigned long Len_mm  = 0;
void setup()
{  //Initialize
    Serial.begin(9600);                        //Serial: output result to Serial monitor
    pinMode(EchoPin, INPUT);                    //Set EchoPin as input, to receive mea

你可能感兴趣的:(arudino)