Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Sponsor

controlSUITE™ software
Comprehensive.
Intuitive.
Optimized.

Real-world software for real-time control. Details Here!

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | BasicX | New app note for Sharp GP2D12 IR ranger

Discussion forum for the BasicX family of microcontroller chips.

New app note for Sharp GP2D12 IR ranger - Frank Manning - Oct 14 17:07:00 2002

A new BX-24 application note was added to the BasicX web site:

http://www.basicx.com/Products/BX-24/bx-24appnotes.htm

Source code is included for reading a Sharp GP2D12 IR ranger. The
device generates an analog voltage that is a nonlinear function of
distance. Maximum range is 80 cm. The demo program converts
voltage to distance and transmits ASCII data out the Com1 serial
port.

The new app note is at the top of the list on the web page.

-- Frank Manning
-- NetMedia, Inc.





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Array trouble - David E. Basile - Oct 15 18:52:00 2002

I seem to have a problem when set an array. My main program I have Public
PL(1 to 200) as byte. Everything compiles fine and when I run the program I
goes through the first 2 subroutines and then looks like it restarts the
first subroutine again with out continuing on. It doesn't reset the BasicX
but only seems to start a the first subroutine in the program. If I set PL
to something like 50 or so it runs normal or seems to. I say seems to
because I have a com routine and it looks like it might be affected by this
too. The compiler show 284 bytes of ram and 6920 bytes for code.

Any suggestions?

Thanks.
David
[Non-text portions of this message have been removed]



______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Array trouble - Tony Brenke - Oct 16 2:25:00 2002

I would guess that you are using a bx-24? (sence the bx-01 only has 250 bytes of ram)

copy your code to the group and we can se better.
also copy your mpp file.
it will tell you a bunch about memory usage.
--- "David E. Basile" <> wrote:
> I seem to have a problem when set an array. My main program I have Public
> PL(1 to 200) as byte. Everything compiles fine and when I run the program I
> goes through the first 2 subroutines and then looks like it restarts the
> first subroutine again with out continuing on. It doesn't reset the BasicX
> but only seems to start a the first subroutine in the program. If I set PL
> to something like 50 or so it runs normal or seems to. I say seems to
> because I have a com routine and it looks like it might be affected by this
> too. The compiler show 284 bytes of ram and 6920 bytes for code.
>
> Any suggestions?
>
> Thanks.
> David >
> [Non-text portions of this message have been removed] >

__________________________________________________





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Array trouble - David E. Basile - Oct 16 10:31:00 2002

Tony,

I've uploaded the file (http://groups.yahoo.com/group/basicx/files/wip.zip) to the group. I sent you a zip file but the one I just put on line has more comments. I would appreciate any help the group can give me. For the record... I'm not a programmer nor do I claim to be one so please keep that in mind when you look at the code. I've tried to comment as much as I could to make it easier to follow.

Here is the setup. This is for a Halloween display. The major components are a MP3 player QV531 by Quadravox www.quadravox.com, Atomic Clock model 325 by Ultra Link www.ulio.com, and a large servo.

The problem I am having, I believe has to do with the array PL. This is a play list of songs on the MP3 player. When I started this I would just pick a random number each time and play a song but there was to much repetition so with a suggestion from the list I'm using a play list. Before using the array the program worked fine and since I have tested the MP3 player in another program and it worked ok also.

When I was testing I didn't know how many songs I would have so I use an array of 200 for PL. When I do this the program compiles fine but it will only run the first 3 subroutines which are for the servo. It just keeps looping through them and at times will only run them 2 or 3 times and then halt.

If I back the array down to 50 or 60 the program still compiles and runs but has a different problem. At each quarter hour it goes out and plays a small sound byte and then returns to the loop. When it does this on the return the MP3 status will give me an error then 0. The 0 status says the music is finished so play another song. It gets a new song plays for about 3 seconds and then gives me an error, then 0 and plays another song.

Again this used to work before I started using the array for the play list. I'm assuming it is a problem with memory or even my coding style or lack of it. I'm open to suggestions or improvements to make this more efficient but mainly I would like to get it working correctly first. Feel free to contact me on the list or my email

Thanks in advance.
David
----- Original Message -----
From: Tony Brenke
To:
Sent: Wednesday, October 16, 2002 2:25 AM
Subject: Re: [BasicX] Array trouble I would guess that you are using a bx-24? (sence the bx-01 only has 250 bytes of ram)

copy your code to the group and we can se better.
also copy your mpp file.
it will tell you a bunch about memory usage.
--- "David E. Basile" <> wrote:
> I seem to have a problem when set an array. My main program I have Public
> PL(1 to 200) as byte. Everything compiles fine and when I run the program I
> goes through the first 2 subroutines and then looks like it restarts the
> first subroutine again with out continuing on. It doesn't reset the BasicX
> but only seems to start a the first subroutine in the program. If I set PL
> to something like 50 or so it runs normal or seems to. I say seems to
> because I have a com routine and it looks like it might be affected by this
> too. The compiler show 284 bytes of ram and 6920 bytes for code.
>
> Any suggestions?
>
> Thanks.
> David >
> [Non-text portions of this message have been removed] >

__________________________________________________

Yahoo! Groups Sponsor
ADVERTISEMENT Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. [Non-text portions of this message have been removed]





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Array trouble - Tony Brenke - Oct 16 13:52:00 2002

the first thing I ould do is to use the serialport.bas that is in the example section.
it makes working with the comport much simpler.

the def for "Randomize" is missing from the RndSong.bas --- "David E. Basile" <> wrote:
> Tony,
>
> I've uploaded the file (http://groups.yahoo.com/group/basicx/files/wip.zip) to the group. I
> sent you a zip file but the one I just put on line has more comments. I would appreciate any
> help the group can give me. For the record... I'm not a programmer nor do I claim to be one so
> please keep that in mind when you look at the code. I've tried to comment as much as I could to
> make it easier to follow.
>
> Here is the setup. This is for a Halloween display. The major components are a MP3 player
> QV531 by Quadravox www.quadravox.com, Atomic Clock model 325 by Ultra Link www.ulio.com, and a
> large servo.
>
> The problem I am having, I believe has to do with the array PL. This is a play list of songs on
> the MP3 player. When I started this I would just pick a random number each time and play a song
> but there was to much repetition so with a suggestion from the list I'm using a play list.
> Before using the array the program worked fine and since I have tested the MP3 player in another
> program and it worked ok also.
>
> When I was testing I didn't know how many songs I would have so I use an array of 200 for PL.
> When I do this the program compiles fine but it will only run the first 3 subroutines which are
> for the servo. It just keeps looping through them and at times will only run them 2 or 3 times
> and then halt.
>
> If I back the array down to 50 or 60 the program still compiles and runs but has a different
> problem. At each quarter hour it goes out and plays a small sound byte and then returns to the
> loop. When it does this on the return the MP3 status will give me an error then 0. The 0
> status says the music is finished so play another song. It gets a new song plays for about 3
> seconds and then gives me an error, then 0 and plays another song.
>
> Again this used to work before I started using the array for the play list. I'm assuming it is
> a problem with memory or even my coding style or lack of it. I'm open to suggestions or
> improvements to make this more efficient but mainly I would like to get it working correctly
> first. Feel free to contact me on the list or my email
>
> Thanks in advance.
> David
> ----- Original Message -----
> From: Tony Brenke
> To:
> Sent: Wednesday, October 16, 2002 2:25 AM
> Subject: Re: [BasicX] Array trouble > I would guess that you are using a bx-24? (sence the bx-01 only has 250 bytes of ram)
>
> copy your code to the group and we can se better.
> also copy your mpp file.
> it will tell you a bunch about memory usage. >
> --- "David E. Basile" <> wrote:
> > I seem to have a problem when set an array. My main program I have Public
> > PL(1 to 200) as byte. Everything compiles fine and when I run the program I
> > goes through the first 2 subroutines and then looks like it restarts the
> > first subroutine again with out continuing on. It doesn't reset the BasicX
> > but only seems to start a the first subroutine in the program. If I set PL
> > to something like 50 or so it runs normal or seems to. I say seems to
> > because I have a com routine and it looks like it might be affected by this
> > too. The compiler show 284 bytes of ram and 6920 bytes for code.
> >
> > Any suggestions?
> >
> > Thanks.
> > David
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> >
> >
> >
> >
> > __________________________________________________
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT >

__________________________________________________






(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Runtime Error 5 - David E. Basile - Oct 16 21:10:00 2002

Every once in a while when I compile I will get a Runtime Error 5: Invalid
procedure call or argument. The compiler will exit and I'll re-open the
compiler and it will compile without any errors. How do I know if this is a
problem with my code or just a "quirk"?

Thanks.
David [Non-text portions of this message have been removed]





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Runtime Error 5 - Frank Manning - Oct 16 22:55:00 2002

From: "David E. Basile" <>

> Every once in a while when I compile I will get a Runtime
> Error 5: Invalid procedure call or argument. The compiler
> will exit and I'll re-open the compiler and it will compile
> without any errors. How do I know if this is a problem
> with my code or just a "quirk"?

What version of the compiler do you have? Can you reproduce the
error?

-- Frank Manning
-- NetMedia, Inc.





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

RE: Runtime Error 5 - David E. Basile - Oct 16 23:08:00 2002

Frank,

I am using version 2.0 under XP Pro. Can't seem to reproduce it but it
happens about 1 out of every 5 or 6 compiles. Any suggestions?

Thanks.
David
-----Original Message-----
From: Frank Manning [mailto:]
Sent: Wednesday, October 16, 2002 10:56 PM
To:
Subject: Re: [BasicX] Runtime Error 5 From: "David E. Basile" <>

> Every once in a while when I compile I will get a Runtime
> Error 5: Invalid procedure call or argument. The compiler
> will exit and I'll re-open the compiler and it will compile
> without any errors. How do I know if this is a problem
> with my code or just a "quirk"?

What version of the compiler do you have? Can you reproduce the
error?

-- Frank Manning
-- NetMedia, Inc.
Yahoo! Groups Sponsor
ADVERTISEMENT

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. [Non-text portions of this message have been removed]




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Runtime Error 5 - Frank Manning - Oct 16 23:16:00 2002

From: "David E. Basile" <>

> I am using version 2.0 under XP Pro. Can't seem to
> reproduce it but it happens about 1 out of every 5 or
> 6 compiles. Any suggestions?

Does it happen with one particular program, or does it happen with
multiple programs? Does the error message say something about an
unexpected error? Are there any other error codes displayed?

-- Frank Manning
-- NetMedia, Inc.





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

RE: Runtime Error 5 - David E. Basile - Oct 16 23:20:00 2002

This is happening to the program I was having array problems with. I posted
it to the group as wip.zip. I've made some modifications to it but it is
still happening. I've compiled other programs and don't remember getting
this error. No other error codes are displayed. Just the one I mentioned
and once I click OK it closes the compiler.

David
-----Original Message-----
From: Frank Manning [mailto:]
Sent: Wednesday, October 16, 2002 11:17 PM
To:
Subject: Re: [BasicX] Runtime Error 5 From: "David E. Basile" <>

> I am using version 2.0 under XP Pro. Can't seem to
> reproduce it but it happens about 1 out of every 5 or
> 6 compiles. Any suggestions?

Does it happen with one particular program, or does it happen with
multiple programs? Does the error message say something about an
unexpected error? Are there any other error codes displayed?

-- Frank Manning
-- NetMedia, Inc.
Yahoo! Groups Sponsor
ADVERTISEMENT

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. [Non-text portions of this message have been removed]


______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )