Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Arduino.h>
- #define movPin 2
- #define Sound 8
- void setup() {
- Serial.begin(9600);
- pinMode(movPin, INPUT);
- pinMode(Sound, OUTPUT);
- }
- void SIGNALIZACIA(){
- int val = digitalRead(movPin);
- //Serial.println(val);
- if (val){
- tone(Sound, 100, 20);
- }
- tone(Sound, 0, 20);
- }
- void loop(){
- SIGNALIZACIA();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement