We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
If there isn't a convenient formula, a so-called Lookup Table is often an appropriate solution.
The entries in the table are your pressure values, and the ADC 8-bit reading is used to index the table:
unsigned int pressure[] = { : 10, // Value for index 42 : 20, // Value for index 49 : 30, // Value for index 57 : 40, // Value for index 64 : 50, // Value for index 71 : 60, // Value for index 79 : 300 // Value for index 255 };
You can, of course, use Excel or similar to compute the table values - and even create the source text...
this looks very interesting! I think, we've already done soething with "index-variables". I remember the []
It's a great "Food for thought". ;-)
Thank You!