{"action":"created","issue":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/8280","repository_url":"https://api.github.com/repos/MarlinFirmware/Marlin","labels_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/8280/labels{/name}","comments_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/8280/comments","events_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/8280/events","html_url":"https://github.com/MarlinFirmware/Marlin/issues/8280","id":271325545,"number":8280,"title":"Custom Menu Running neopixel Function","user":{"login":"timmit99","id":8399317,"avatar_url":"https://avatars1.githubusercontent.com/u/8399317?v=4","gravatar_id":"","url":"https://api.github.com/users/timmit99","html_url":"https://github.com/timmit99","followers_url":"https://api.github.com/users/timmit99/followers","following_url":"https://api.github.com/users/timmit99/following{/other_user}","gists_url":"https://api.github.com/users/timmit99/gists{/gist_id}","starred_url":"https://api.github.com/users/timmit99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timmit99/subscriptions","organizations_url":"https://api.github.com/users/timmit99/orgs","repos_url":"https://api.github.com/users/timmit99/repos","events_url":"https://api.github.com/users/timmit99/events{/privacy}","received_events_url":"https://api.github.com/users/timmit99/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":58,"created_at":"2017-11-05T23:36:02Z","updated_at":"2017-11-06T10:52:32Z","closed_at":null,"author_association":"NONE","body":"I am working to add the ability to controll the color of the neopixel strips on my printer from the LCD. I have gotten the single R, G, and B  controls to work, setting the strip to full red,green,or blue. Now i'm trying to add a sub-menu that will allow live updating of the colors. I want the function to run when the color component (Red Green or BLue) is selected however on compile it gives me an error telling my that \"pixels\" and \"set_neopixel_color\" aren't declared in this scope.\r\n\r\nI am running Marlin 1.1.6\r\n\r\nThe error is as follows:\r\n\r\n> Arduino: 1.8.2 (Windows 10), Board: \"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)\"\r\n> \r\n> sketch\\ultralcd.cpp: In function 'void update_led_strip()':\r\n> \r\n> ultralcd.cpp:1034: error: 'pixels' was not declared in this scope\r\n> \r\n>    set_neopixel_color(pixels.Color(led_red_brightness, led_green_brightness, led_blue_brightness, 0));\r\n>                       ^\r\n> ultralcd.cpp:1034: error: 'set_neopixel_color' was not declared in this scope\r\n> \r\n>    set_neopixel_color(pixels.Color(led_red_brightness, led_green_brightness, led_blue_brightness, 0));\r\n>                                                                                                     ^\r\n> Multiple libraries were found for \"LiquidCrystal.h\"\r\n>  Used: C:\\Program Files (x86)\\Arduino\\libraries\\LiquidCrystal\r\n>  Not used: C:\\Users\\Timothy Abraham\\Documents\\Arduino\\libraries\\NewliquidCrystal\r\n> exit status 1\r\n> 'pixels' was not declared in this scope\r\n> \r\n> This report would have more information with\r\n> \"Show verbose output during compilation\"\r\n> option enabled in File -> Preferences.\r\n\r\nHere is the code i have added to acomplish this directly \r\n\r\nThis is the top of ultralcd.cpp:\r\n```\r\nvoid lcd_main_menu();\r\nvoid lcd_tune_menu();\r\nvoid lcd_prepare_menu();\r\nvoid lcd_move_menu();\r\nvoid lcd_control_menu();\r\nvoid lcd_control_temperature_menu();\r\nvoid lcd_control_temperature_preheat_material1_settings_menu();\r\nvoid lcd_control_temperature_preheat_material2_settings_menu();\r\nvoid lcd_control_motion_menu();\r\nvoid lcd_control_filament_menu();\r\n```\r\nand i added:\r\n```\r\nvoid lcd_led_menu();\r\nvoid lcd_led_custom_menu();\r\n\r\n```\r\nas well as adding the following directly at the end of the \"lcd_main_menu\" function\r\n\r\n```\r\n  MENU_ITEM(submenu, \"LED Control\", lcd_led_menu);\r\n  END_MENU();\r\n}    // end of main menu function\r\n\r\nvoid lcd_led_menu() {\r\n  START_MENU();\r\n  MENU_BACK(MSG_MAIN);\r\n\r\n  MENU_ITEM(gcode, \"Turn Off Lights\" , PSTR(\"M150\")); \r\n  MENU_ITEM(gcode, \"Turn on Red Lights\" ,   PSTR(\"M150 R255 U0 B0\"));\r\n  MENU_ITEM(gcode, \"Turn on Green Lights\" , PSTR(\"M150 R0 U255 B0\"));\r\n  MENU_ITEM(gcode, \"Turn on Blue Lights\" ,  PSTR(\"M150 R0 U0 B255\"));\r\n  MENU_ITEM(submenu, \"Custom LED\", lcd_led_custom_menu);\r\n\r\n  END_MENU();\r\n}\r\n\r\nuint8_t led_red_brightness;\r\nuint8_t led_green_brightness;\r\nuint8_t led_blue_brightness;\r\n\r\nvoid update_led_strip() {\r\n  set_neopixel_color(pixels.Color(led_red_brightness, led_green_brightness, led_blue_brightness, 0));\r\n}\r\n\r\nvoid lcd_led_custom_menu() {\r\n  START_MENU();\r\n  MENU_BACK(\"LED Control\");\r\n  \r\n  MENU_ITEM_EDIT_CALLBACK(int8, \"Red Intensity\", &led_red_brightness, 0, 255, update_led_strip, true);\r\n  MENU_ITEM_EDIT_CALLBACK(int8, \"Blue Intensity\", &led_green_brightness, 0, 255, update_led_strip, true);\r\n  MENU_ITEM_EDIT_CALLBACK(int8, \"Green Intensity\", &led_blue_brightness, 0, 255, update_led_strip, true);\r\n  \r\n  END_MENU();\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/comments/342113676","html_url":"https://github.com/MarlinFirmware/Marlin/issues/8280#issuecomment-342113676","issue_url":"https://api.github.com/repos/MarlinFirmware/Marlin/issues/8280","id":342113676,"user":{"login":"Tannoo","id":26955383,"avatar_url":"https://avatars1.githubusercontent.com/u/26955383?v=4","gravatar_id":"","url":"https://api.github.com/users/Tannoo","html_url":"https://github.com/Tannoo","followers_url":"https://api.github.com/users/Tannoo/followers","following_url":"https://api.github.com/users/Tannoo/following{/other_user}","gists_url":"https://api.github.com/users/Tannoo/gists{/gist_id}","starred_url":"https://api.github.com/users/Tannoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tannoo/subscriptions","organizations_url":"https://api.github.com/users/Tannoo/orgs","repos_url":"https://api.github.com/users/Tannoo/repos","events_url":"https://api.github.com/users/Tannoo/events{/privacy}","received_events_url":"https://api.github.com/users/Tannoo/received_events","type":"User","site_admin":false},"created_at":"2017-11-06T10:52:32Z","updated_at":"2017-11-06T10:52:32Z","author_association":"CONTRIBUTOR","body":"Clicking the line number will do the same, but only for that line."}}
{"actor":{"display_login":"Tannoo"}}