'crash'에 해당되는 글 1건

  1. 2017.09.24 Crash Collision Sensor Detection Module [S230]

Crash Collision Sensor Detection Module [S230]





https://www.youtube.com/watch?v=1yeZcZQk-Y8


*GitHubhttps://github.com/rdiot/rdiot-s230.git


* Specs 

Wrobot Crash Sensor is arduino compatible and can be used for for robot collision detection, touch collision detection. 

It is based on the high sensitivity crash sensor. 

With the Arduino sensor expansion board, in combination, it can be very easy to achieve robot collision detection, touch collision detection. 


When touch, output low level ; when release, maintain a high level

Wrobot Crash Sensor pin definitions : (1) Output (2) Vcc (3) GND

Features :

1.Based on the high sensitivity crash sensor

2.Can be used for robot collision detection, touch collision detection

3.Type : Digital

4.Sensitivity : High

5.Power Supply : 5V

6.Pin Definitions : (1) Output (2) Vcc (3) GND

7.When touch, output low level ; when release, maintain a high level

8.Apply to a variety of platforms including Arduino/51/AVR/ARM


* Contents

- connect

OUT - D3

VCC - 5V

GND - GND

 

- Key Code

int ledPin = 13;                // choose the pin for the LED
int inputPin = 3;               // connect sensor to input pin 3
 
 
void setup() {
  Serial.begin(9600);           // Init the serial port
   
  pinMode(ledPin, OUTPUT);      // declare LED as output
  pinMode(inputPin, INPUT);     // declare Micro switch as input
}
 
void loop(){
  int val = digitalRead(inputPin);  // read input value
  if (val == HIGH) {                // check if the input is HIGH
    digitalWrite(ledPin, LOW);      // turn LED OFF
  } else {
    digitalWrite(ledPin, HIGH);     // turn LED ON
    Serial.println("Switch Pressed!");
  }
  delay(50);
}


Posted by RD IoT RDIoT

댓글을 달아 주세요