Discussion forum for the BasicX family of microcontroller chips.
|
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. |
|
|
|
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] |
|
|
|
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] > __________________________________________________ |
|
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] |
|
|
|
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 > __________________________________________________ |
|
|
|
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] |
|
|
|
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. |
|
|
|
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] |
|
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. |
|
|
|
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] |