![]() |
Forum Index : Microcontroller and PC projects : MM+ Explore100 Piezo question
Author | Message | ||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2948 |
Does anyone know if there is a way to use the GUI graphics commands with an option to sound or silence the Piezo (rather than it sound every time a GUI control is 'touched'. I do not want to remove the Piezo as I will occasionally want 'clicks' from GUI controls. I could PWM the Piezo from an I/O pin but this adds more lines of code - something I'm trying to avoid . Alternatively I may use a single I/O pin to enable/disable the Piezo (I have a spare AND gate that could drive the transistor base). BUT I was wondering if there was a command/parameter that I have overlooked. Any help, or other ideas welcomed . . . . . Thanks, WW |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10400 |
Try these UNTESTED [code] Csub buzzoff 'no parameters 00000000 3C029D00 8C420090 03E00008 A0400037 End Csub ' Csub buzzon 'call with pin number connected to the buzzer 00000000 3C029D00 8C420090 8C830000 03E00008 A0430037 End Csub |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2948 |
Thats brilliant - well half brilliant. The buzzoff() works. But buzzon(39) gives a CPU exception 10 error. At address 0x9D0017C4 if thats any help! WW |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10400 |
Not for me it doesn't ![]() |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2948 |
I get buzzed() to 'switch off' pin 39 from OPTION LIST (as in your screen-shot above), but buzzon(39) restarts the MM every time. This occurs both at prompt and in code. Triple checked everything. CPU is at 100. v5.2 (as per Geoff's website). My pins/OPTIONS are slightly different to yours as follows: DISPLAY 24, 66 LCDPANEL SSD1963_7, LANDSCAPE, 48 TOUCH 1, 40, (39) KEYBOARD UK SDCARD 47 LCDPANEL CONSOLE RTC 67, 66 |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10400 |
Can you post a screenshot of exactly the sequence I did above. You do have the later version 5.2? Geoff did a very minor update after a couple of weeks. All the CFunction does is change the value of the OPTION location for the buzzer so the difference can only be that the location is different somehow. UPDATE Change the subroutine definition to CSUB BUZZON(INTEGER) I bet you haven't set the default data type to be integer and it is passing the number as a float |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2948 |
Made no difference I'm afraid - still getting the issue! So looks like it maybe the Firmware version ![]() WW |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2948 |
PRINT mm.ver
returns 5.02 |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2948 |
I am by no means a C Function/Sub creator; but does your statement above mean that every time there is a firmware update then any CSubs could 'fail' in the 'newer' firmware? ![]() |
||||
Phil23 Guru ![]() Joined: 27/03/2016 Location: AustraliaPosts: 1667 |
As an alternative to turning the option for the beep pin on & off. Are you able to make the cFunction change the length of the click? Page 18 indicates that around 3mS is used to produce a click. If function could change this internally to zero, the click could be disabled, but the beeper would still be available for alarms etc without the need to change the options again. Phil. |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2948 |
I like your thinking - a better alternative IMHO ![]() |
||||
kiiid Guru ![]() Joined: 11/05/2013 Location: United KingdomPosts: 671 |
While still on the topic - I don't like that GUI BEEP requires a display being defined. It would have been much better if it was only BEEP and completely independent from any LCD. Then if necessary it could be linked to a touch even by some option command. http://rittle.org -------------- |
||||
Phil23 Guru ![]() Joined: 27/03/2016 Location: AustraliaPosts: 1667 |
Interesting, I would have downloaded my copy as soon as it went up. Wonder if that has any bearings on some of my issues? How are the versions distinguished? Do they all report as MM.Ver 5.02? Phil. Edit; Just looked at what I have been using here, And what's currently on Geoff's site, Looks like only Plus had some changes. |
||||
paceman Guru ![]() Joined: 07/10/2011 Location: AustraliaPosts: 1329 |
The change was made at the bottom of this thread. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |