Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
tone function is missing
29-08-2016, 08:14 AM,
#1
tone function is missing
Why is it not supported? How hard would it be to add it to Pinguino?
Reply
29-08-2016, 12:01 PM,
#2
RE: tone function is missing
(29-08-2016, 08:14 AM)Hershell Wrote: Why is it not supported? How hard would it be to add it to Pinguino?

Hi,
Simple audio functions are supported for both 8- and 32-bit PIC :
  • Audio.init
  • Audio.tone
  • Audio.noTone
  • Audio.staccato
  • Audio.legato
For compatibility reasons there are also :
  • tone (the same as  Audio.tone)
  • noTone (the same as Audio.noTone)

... except for 32-bit PIC which I guess you're using.
I fixed it and I will publish it in v12 ASAP.

You might also take a look at examples/03.Analog/Audio/tone.pde
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
31-08-2016, 09:47 AM, (This post was last modified: 31-08-2016, 09:49 AM by Hershell.)
#3
RE: tone function is missing
I am using Pinguino IDE 11.0-beta.4
8bit Pinguino, 2550.
The code is:
Code:
double pulse;

void setup()
{
    pinMode(11,INPUT);
    pinMode(13,OUTPUT);
    pinMode(8,OUTPUT);  
}

void loop()
{
    digitalWrite(13,HIGH);
    delayMicroseconds(5000);
    digitalWrite(13,LOW);
    delayMicroseconds(100);
    
    pulse = pulseIn(11,HIGH,5000);
    
    if(pulse > 920)
    {
        tone(8, 1);
        delay(3000);
        noTone(8);
    }
}
It gives errors but uncomennting the if body fixes stuff.

The worst thing is that error log looks like that:
Code:
Pinguino IDE 11.0
Python 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32
Commands available: "clear", "restart"

[OUT] Compiling: C:/Users/Admin/32.pde
[OUT] Board: Pinguino 2550
[OUT] Proc: 18f2550
[OUT] Arch: 8
[OUT] Bootloader: v4
[DEBUG] Starting 'verify' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Starting 'preprocess' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Starting 'remove_comments' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'remove_comments': 0.00 s
[DEBUG] Ending 'remove_comments'
[DEBUG] Starting 'remove_comments' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'remove_comments': 0.00 s
[DEBUG] Ending 'remove_comments'
[DEBUG] Starting 'get_regobject_libinstructions' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Starting 'read_lib' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'read_lib': 0.67 s
[DEBUG] Ending 'read_lib'
[DEBUG] Time spent for 'get_regobject_libinstructions': 0.68 s
[DEBUG] Ending 'get_regobject_libinstructions'
[DEBUG] Starting 'replace_word' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'replace_word': 0.04 s
[DEBUG] Ending 'replace_word'
[DEBUG] Time spent for 'preprocess': 0.81 s
[DEBUG] Ending 'preprocess'
[DEBUG] Starting 'compile' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'compile': 1.91 s
[DEBUG] Ending 'compile'
[DEBUG] Time spent for 'verify': 2.75 s
[DEBUG] Ending 'verify'
[OUT] ERROR: 828:  token -> '13' ; column 15
[OUT]
That error message is meaningles for me, why is this so?
Also:
http://wiki.pinguino.cc/index.php/Tone Wrote:tone
This command is not currently supported by the Pinguino IDE


EDIT: also that example you've mentioned does not compile for me
Code:
[OUT] Compiling: C:\pinguino 11\user\examples.Analog\Audio    one.pde
[OUT] Board: Pinguino 2550
[OUT] Proc: 18f2550
[OUT] Arch: 8
[OUT] Bootloader: v4
[DEBUG] Starting 'verify' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Starting 'preprocess' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Starting 'remove_comments' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'remove_comments': 0.00 s
[DEBUG] Ending 'remove_comments'
[DEBUG] Starting 'remove_comments' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'remove_comments': 0.00 s
[DEBUG] Ending 'remove_comments'
[DEBUG] Starting 'get_regobject_libinstructions' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'get_regobject_libinstructions': 0.00 s
[DEBUG] Ending 'get_regobject_libinstructions'
[DEBUG] Starting 'replace_word' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'replace_word': 0.04 s
[DEBUG] Ending 'replace_word'
[DEBUG] Time spent for 'preprocess': 0.11 s
[DEBUG] Ending 'preprocess'
[DEBUG] Starting 'compile' from 'qtgui.pinguino_api.pinguino_tools'
[DEBUG] Time spent for 'compile': 0.05 s
[DEBUG] Ending 'compile'
[DEBUG] Time spent for 'verify': 0.18 s
[DEBUG] Ending 'verify'
[OUT] ERROR: 828:  token -> '13' ; column 15
[OUT]
>>>
Reply
31-08-2016, 01:46 PM,
#4
RE: tone function is missing
examples/03.Analog/Audio/tone.pde compiles with v12
You are right : in v11 there is a problem.

André
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)