Hi, all.
I'm visiting a german technical school and we have do start a Project work in February. For the coarse advance planning I would like to have a Basic structure of the Programming with Keil µ-Vison. We already programmed some stuff with µ-Vision, but not deep enough
I would like to read the digitized value of a pressure sensor with a microcontroller, let the Software evaluate it, and show the pressure value on a Display.
so is it possible, to build a Table (like Excel, .csv, etc.) and let the programm compare the Value of the input Port from the microcontroller withe the values in the table and take appropriate pressure value.
Or is there another possibility, do assign the values, so that I can change the assignments quick and easy?
please excuse my bad english.
Thank you in advance!
Jonas
Ok, maby It can be solve by using an algebra.
I give a nother Example not with Number, with Text.
in a Table are the days and the arrival time (start work or Train arrival time, etc.)
Day --- Time
Monday --- 08:00 Tuesday --- 08:15 Wednesday --- 07:56 Thursday --- 08:03 Friday --- 08:25 Saturday --- 09:23 Sunday --- 08:11
Now the program ask for witch day, the time schould be displayed. the user specifies the Day and on the Display appears the time.
So I can change the time easily in the table.
This post discusses something completely different from your first post: I would like to read the digitized value of a pressure sensor with a microcontroller, let the Software evaluate it, and show the pressure value on a Display.
Are you sure that you know exactly what you want to do?
Your first example showed a perfectly linear conversion between measurement and ADC value.
Your second example is on the other hand a perfect match for a lookup table, since there is no correlation between the input parameter and the requested answer.
Note that for the masurement example, you can create a linear transfer function from analog pressure to expected ADC value, or from a ADC value to a pressure.
For the time example, you are not guaranteed to be able to have a reverse transfer function or reverse lookup table, since several days may have the same time.
"I give another Example not with Number, with Text."
Don't think of them as text; think of them as numbers
enum { day_sun = 0; day_mon; day_tue; day_wed; day_thu; day_fri; day_sat; }
So your table of times is just indexed by the day number.
You can convert day numberse to text (for display) with a lookup table
char *day_string[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }
"So I can change the time easily in the table."
Changing them in the table is easy; The question is, how will you get the data to the microcontroller; eg: A keypad? A serial link? Some kind of plug-in memory device? etc, etc,...