v0.0.2
This commit is contained in:
parent
e52b2750dd
commit
3f40eba93a
1 changed files with 5 additions and 8 deletions
|
|
@ -16,9 +16,6 @@ WiFiUDP client;
|
|||
const int triggerPin = D6;
|
||||
const int echoPin = D5;
|
||||
|
||||
SPI_DEVICE_TXBIT_LSBFIRST;
|
||||
|
||||
|
||||
void setup() {
|
||||
delay(5000);
|
||||
WiFi.begin(WIFI_SSID, WIFI_PASS);
|
||||
|
|
@ -46,11 +43,11 @@ void setup() {
|
|||
void loop() {
|
||||
|
||||
digitalWrite(triggerPin, LOW);
|
||||
delayMicroseconds(2);
|
||||
delayMicroseconds(20);
|
||||
digitalWrite(triggerPin, HIGH);
|
||||
delayMicroseconds(10);
|
||||
digitalWrite(triggerPin, LOW);
|
||||
duration = pulseIn(echoPin, HIGH);
|
||||
delayMicroseconds(200);
|
||||
digitalWrite(triggerPin, LOW);
|
||||
duration = pulseIn(echoPin, HIGH, 40000);
|
||||
distance = (duration*.0343)/2;
|
||||
|
||||
if(WiFi.status() != WL_CONNECTED) {
|
||||
|
|
@ -68,7 +65,7 @@ void loop() {
|
|||
for(int i=0;i<4;i++) {
|
||||
buff[i] = array[3-i];
|
||||
}
|
||||
Serial.print("Data flipped is: ");
|
||||
Serial.print("Data flipped is: 0x");
|
||||
for(int i=0;i<4;i++) {
|
||||
Serial.print(buff[i], HEX);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue