My Marlin configs for Fabrikator Mini and CTC i3 Pro B
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * neopixel.cpp
  24. */
  25. #include "MarlinConfig.h"
  26. #if ENABLED(NEOPIXEL_LED)
  27. #include "neopixel.h"
  28. Adafruit_NeoPixel pixels(NEOPIXEL_PIXELS, NEOPIXEL_PIN, NEOPIXEL_TYPE + NEO_KHZ800);
  29. void set_neopixel_color(const uint32_t color) {
  30. for (uint16_t i = 0; i < pixels.numPixels(); ++i)
  31. pixels.setPixelColor(i, color);
  32. pixels.show();
  33. }
  34. void setup_neopixel() {
  35. SET_OUTPUT(NEOPIXEL_PIN);
  36. pixels.setBrightness(NEOPIXEL_BRIGHTNESS); // 0 - 255 range
  37. pixels.begin();
  38. pixels.show(); // initialize to all off
  39. #if ENABLED(NEOPIXEL_STARTUP_TEST)
  40. safe_delay(1000);
  41. set_neopixel_color(pixels.Color(255, 0, 0, 0)); // red
  42. safe_delay(1000);
  43. set_neopixel_color(pixels.Color(0, 255, 0, 0)); // green
  44. safe_delay(1000);
  45. set_neopixel_color(pixels.Color(0, 0, 255, 0)); // blue
  46. safe_delay(1000);
  47. #endif
  48. set_neopixel_color(pixels.Color(NEO_WHITE)); // white
  49. }
  50. #endif // NEOPIXEL_LED