02-22-2007 02:23 PM - edited 02-22-2007 02:23 PM
Message Edited by roberto.venetz on 02-22-2007 02:23 PM
02-22-2007 02:40 PM
02-22-2007 03:08 PM
02-22-2007 03:13 PM
02-23-2007 08:18 AM
First, thank you for the informations.
I'm not surprise when you tell me that my program is not optimized and maybe a bit difficult to understand. I'm doing my first steps with this software and I built my application using a lot of example I found.
- I don't have any idea how long the arrays will get in the worst case scenario;
- The construction for the waveform is something I found and it seemed to be what I need;
- The rate loop is determined by the Bluetooth reception. The application has to wait for two bytes each step before going on, and the microcontroller manages the sending rate.
Look at my attached program
02-23-2007 09:16 AM
02-23-2007 01:43 PM
I'll take a look to your modifications, thanks.
The step you seem to not understand is used to concatenate the two received bytes to build a word. Isn't it correct?
02-23-2007 03:45 PM - edited 02-23-2007 03:45 PM
@roberto.venetz wrote:
The step you seem to not understand is used to concatenate the two received bytes to build a word. Isn't it correct?
We understand your code very well, but this is NOT the way to do it! You have a two-byte string. Simply typecast it to a U16. Voila! (see lower part of image).
You should keep all your data as U16, it will take 4x less memory than your DBLs (leave ot the "to DBL").. The only place you might need U32 is for the FLOW, which is the product of two U16.
What is with all the globals. Is this program part of a bigger system? Most of the globals are not used anywhere. Are they used elsewhere?
Message Edited by altenbach on 02-23-2007 01:47 PM
02-24-2007 03:54 PM
@altenbach wrote:(I've see that before but it is very hard to comprehend why people use "delete from array" and then only use the "deleted portion" output to get a subset. What's wrong with "index array" or "array subset"????)
02-24-2007 04:59 PM
Yes, as long as you have a reason it's probably OK! 😄
@TonP wrote:
I use that trick/feature to get the latest element!