Data acquisition problem
Yannick
Posts: 5
Hi,
I am doing this little project in school: I need to enter a frequency between 1.0 and 100.0 Hz and display the numbers on a LCD with parallel interface. The user needs to be able to erase one number at a time if a mistake is made. The final number (ex: 54.6 ) needs to be stocked in memory and be sent to another application when the user presses another button.
So my question is: what's the best data structure to realize these different operations? Are there objects that already do that or that could help me?
thanks and have a nice day!
Yannick
I am doing this little project in school: I need to enter a frequency between 1.0 and 100.0 Hz and display the numbers on a LCD with parallel interface. The user needs to be able to erase one number at a time if a mistake is made. The final number (ex: 54.6 ) needs to be stocked in memory and be sent to another application when the user presses another button.
So my question is: what's the best data structure to realize these different operations? Are there objects that already do that or that could help me?
thanks and have a nice day!
Yannick
Comments
the best datastructure for realize operation is the type "program"
yes there are objects for for parallel LCDs
sending data to another application depends highly on the send-path
what send-path are you using ?
Stefan
I believe it is a good idea to store each·value as an integer and then add a decimal point character in the display routine.
The other application to which I need to send the data is a digital potentiometer with a serial interface (I think it's the send-path you meant Stefan). I already have an object to send serial data but they are in the binary format.
So my next question is: how can I convert the number with each value stored seperately as an integer to a binary format number? I believe I have seen an integer to binary converter somewhere but I'm not sure it would work if every value is stored seperately, especially with the decimal part.
Thanks again for your help
Yannick
Most of the Propeller display objects (like those for the LCD and for a TV) have a decimal, hexadecimal, and binary display routine. After you look up the definitions I asked, you might try answering your question yourself and consider whether and what these display routines have to do with your digital potentiometer.
English is not my first language so maybe I got mix-up with my words. I will ask my question with this example:
The·resistance I want·is 54.6 ohms, but I store it 546. To send this data to the digital potentiometer, I need to convert it·back to its decimal number display and then to the binary format. Is there an object that can perform this operation?··Maybe I'm wrong but the propeller display objects·like for·TV and LCD convert an integer to binary, not a decimal number to binary.
I hope I·am a little more clear! Thanks
Yannick
I think I made a mistake between decimal and float....
So if I store 546, I need to convert it back to it's Floating-point format (54.6) and then to binary. Is there an object to do that: integer to float to binary?
Thanks
I'm not directly answering your question about a conversion object because conversions are not always necessary.
You might tell us about the digital potentiometer, how data is sent to it, and what the format of that data has to be. You should have a datasheet or other documentation that describes this. Different digital potentiometers do work differently and we need to know the specific requirements.
Inside the Propeller, all numbers are normally stored and manipulated in binary form. For external display, to make them humanly useful, we convert them to the equivalent character decimal, hexadecimal or binary form.
The floating point routines for the Propeller use a standard floating point format described as IEEE 754 32-bit single precision. This is described in detail in one of the Wikipedia articles.