-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
M300 Beeps much higher pitch than they should be. #2787
Comments
A long time ago, the M300 code looked like this:
Now it looks like this:
I guess we need to know the values of these #define's to figure out which code path it is going down in your code: #define LCD_USE_I2C_BUZZER You can put a xxx(); inside one #if, #else or #elif section at a time to see if you get a compiler error. If not, that section of the code is not active and we don't care about it. |
Hmm I can try that but I downloaded the 1.1.0-RC2 and only things I've changed was some esteps and similar calibration style changes in configuration.h and uncommented "#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER" don't have access to the machine with the modified configuration and arduino on it currently. |
Well... Maybe somebody else can help you that knows more about RAMPS based systems. But without knowing which code paths are active it is very difficult to try to figure out where the problem is. |
Ok I've tried it I get no error if I put it on the line after #if ENABLED(SPEAKER) // a speaker needs a AC ore a pulsed DC (#12) I get an error if I put it after #else // buzzer has its own resonator - needs a DC (#22) And no error if I put it after #else (#27) It's defiantly going down the DC route, which is weird, doesn't that only allow one tone? In 1.0.2 it could do a whole range just fine. Did this on clean 1.1.0-RC2 with only change being removing the "//" on line 713 of configuration.h "#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER" My best guess of what's going wrong here is that the configuration isn't right for that LCD controller anymore, marlin doesn't know what kind of speaker it has anymore but used to in 1.0.2. |
Yes, it is possible the configuration isn't correct... But if you want to try to get back the old functionality, you can try a couple of things. You can replace buzz() with each possible combination and see if one of them does what you want
If that doesn't work... Try:
If that doesn't do it... We can put the original code back in place. |
@KriLL3 |
@KiteLab @Roxy-3DPrintBoard |
@KriLL3 |
Not entirely sure I'd call it progress to have to dig into the configuration to enable the features of a known LCD controller design, before the SD card and multi-frequency speaker were enabled by just specifying that you have that LCD controller... I use octopi so I don't use the SD card but still would like that feature to be accessible... |
Well, to be fair, it sounds like somebody got 'clever' and started using buzzers in an undocumented mode as a speaker. I can understand why that should not be encouraged.
Can you tell me which files I should look at? |
"For one of the new displays it was needed to #undefine SDSUPPORT. ... So the setting was removed from ULTIPANEL." -- Well, the problem is caused by the misuse of ULTIPANEL. When it is overloaded to represent additional displays, the conflict arises. Instead, the ULTIPANEL should be replaced with a more generic display definition. Then, in Conditionals.h, ULTIPANEL can define both that more generic display and the SD support. |
If something is not a true ULTIPANEL clone, shouldn't it have its own header.h file? If something is very close to being a true ULTIPANEL clone, could it's header.h file #include the standard ULTIPANEL file and then #undef what needs to change? |
No, you don't undefine things. Instead, you create a definition for the common property and have both include that common element. A Chevrolet is like a Ford EXCEPT ... Then, a Chevrolet is a Car plus .... Until someone shows up with a Honda Well, it, also, would be a Car plus ... except it is not built by an American manufacturer. We start by removing the "American Manufacturer" property from "Car" since not all cars have this property. But the Ford and Chevrolet still need the property. We can add it back by adding it explicitly to each of those definitions. Either way, we never undefine a property. |
Well... It seems like UltiPanel should be its own thing. It is important enough to have its own files. And to have all of its features included for use. And rather than build up a new thing that is almost an UltiPanel, it doesn't seem that bad (to me) to start with an UltiPanel and un-define the one thing that is different. From a perspective of trying to make the code understandable, that is easier for me to get my head around than looking at two big files, line by line trying to find the one difference. |
You're thinking "flat" rather than "hierarchal". Rather than starting at the specific case (the UltiPanel), think about the more generic feature (the user control panel). The UltiPanel is just a special case of this more general class. Just as when the biologists describe some dog, they don't start by listing every characteristic individually. Similarly, we can say that each of the panels has all of the characteristics common to a panel and need specify only the distinctive components. Now, this "inclusion" can be done either by defining a symbol for the generic class and including that symbol in the specific descriptions or, equivalently, we can use the pre-processor "#include" to pull in a file specifying those properties. In either case, we don't have "two big files" to compare. Instead, we have two small files which contain the distinctions and one larger file that contains the commonality. |
Yes, but some how... The UltiPanel lost its ability to do SD Memory cards. It would seem UltiPanel's should not suffer just because some new display shows up that is close, but not really an UltiPanel. It would seem to me the new display should fend for itself and come up with its own definitions In a perfect world, UltiPanel's should probably get defined by pulling in this and that defination file for the various features. And the new panel could pull in most of the stuff, but just omit the SD Memory card stuff. Right? |
@Roxy-3DPrintBoard
I don't want to scare you, but about everything what has to do with displays, menus, pins, configuration, conditionals, sd-cards, ... . A grep for |
What is the display name and type that is very close to a UltiPanel but is missing the SD Memory card feature? It doesn't seem like it should be allowed to call itself an UltiPanel if it doesn't do everything an UltiPanel does. |
I remembered wrong. The actual reason for the change was different. Anyway, all panels define ether
It's a good thing to have
Or how about For me this is a complex we should return to a bit later, but not handle it right now. |
@KiteLab -- The other is that "ULTIPANEL" appears to have been used in many places where something like "USE_MENU" would be more appropriate. -- your comment about "USE_DISPLAY" being on by default has the right motivation. However,your code snippet is entirely wrong. I don't see any reason why we cannot start engineering this migration in the dev branch. From there, someone will need to look at each code instance to determine if that code applies to all of the MENU systems, or only to the specifically ULTIPANEL ones. But, the transition should not disrupt working configurations. |
@ntoff In the Adruino example they talk about.
That excludes that they could have used a buzzer. You can't use a buzzer as a microphone. The little black cylinders (about 1x1cm) with easer a little hole in the top or covered by a sticker, on our boards can be piezo speakers or piezo buzzers. You can't distinguish them optically, if you can't read the partnumber. They look identical. But there is a simple test. Turn off SPEAKER - when you still can hear a sound you have a buzzer. I have no concerns about using buzzers as speakers. Do it, if you want to. But don't set this as the default for all. |
@KiteLab Thank You for all the work it took to put together that synopsis of what happened with UltiPanel and SD Memory cards!!! That was very helpful in understanding things. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Upgraded from 1.0.2 to 1.1.0-RC2 and using the same g-code as before all of my M300 entries give pretty much the same really high pitched chirp instead of different tones denoted by the S variable, it's not a big issue but I liked having my printer make 2-4 note sounds based on it's state, (homing axis, heating bed, heating extruder, starting to print, done printing) and using a snippet of a song like a ringtone is pretty popular to put into the end g-code, but all those sounds are now indistinguishable high pitched squeaks.
I'm using RAMPS 1.4 with the discount full graphic smart controller
The text was updated successfully, but these errors were encountered: