Using a Sick WS15-D1130 Infrared Diode pair to act as a hardware motion detection sensor for Zoneminder. Also testing out an Omrom photo electric sensor, the E3F2-R2C4. This is a tripwire alarm sensor. When the beam is blocked, the alarm is activated.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.8 KiB

5 years ago
  1. /*
  2. * ZMHW Changes:
  3. * Use the appropriate pin.
  4. * Make sure to alight all three colours. Bad connections can cause
  5. * some colours to fail, but others will work, so we always want
  6. * to test all three RGB values. Not just one.
  7. *
  8. */
  9. // NeoPixel Ring simple sketch (c) 2013 Shae Erisson
  10. // released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library
  11. #include <Adafruit_NeoPixel.h>
  12. #ifdef __AVR__
  13. #include <avr/power.h>
  14. #endif
  15. // Which pin on the Arduino is connected to the NeoPixels?
  16. // On a Trinket or Gemma we suggest changing this to 1
  17. #define PIN 5
  18. // How many NeoPixels are attached to the Arduino?
  19. #define NUMPIXELS 1
  20. // When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
  21. // Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
  22. // example for more information on possible values.
  23. Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
  24. int delayval = 500; // delay for half a second
  25. void setup() {
  26. // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
  27. #if defined (__AVR_ATtiny85__)
  28. if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
  29. #endif
  30. // End of trinket special code
  31. pixels.begin(); // This initializes the NeoPixel library.
  32. }
  33. void loop() {
  34. // For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.
  35. for(int i=0;i<NUMPIXELS;i++){
  36. // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
  37. pixels.setPixelColor(i, pixels.Color(50,150,50)); // Moderately bright green color.
  38. pixels.show(); // This sends the updated pixel color to the hardware.
  39. delay(delayval); // Delay for a period of time (in milliseconds).
  40. }
  41. }