Hello, I'm working on an assignment that deals with a lookup table. I've been supplied limited information about Arduino coding and had to do research on my own. I've search several websites and was hoping to find an example similar to mine but to no previal. I'm hoping someone can help me out since this is the first time I've been exposed to this coding enviroment. Here is what I have:
Assignment setup:
Analog Input 0 // Wind Direction in degrees (0° to 360°)
Analog Input 1 // Wind Speed in miles per hour (MPH)
Analog Input 2 // Temperature in degrees Fahrenheit (0° to 128° F)
Analog Input 3 // Barometric Pressure in millibars (950 mb to 1050 mb). Note: 1 atmosphere pressure (sea level) ≈ 1 bar ≈ 1000 mb
Each of these sensors has an output that ranges from 0.000 to 5.000V. The relationship between
each sensor’s voltage output and its particular physical value is shown in the look-up table below.
Write a program to read each of these sensors and display their values in degrees, MPH, Celsius,
and atmosphere to the serial monitor once every 2 seconds. The display message should take
the form:
“Wind Direction = XXX.XX degrees”
“Wind Speed = XXX.XXX MPH”
“Temperature = XXX.X degrees C”
“Barometric Pressure = XXXX atm”
Notes on display:
- There should be a blank row between each block of values in your display.
- You don’t need leading zeros in your numerical value.
- You don’t need fractional values for the barometric pressure.
- You can spell out the word “degrees” or use the ASCII code for ‘°’.
You must use the provided look-up table (below) in your program to translate voltages to
physical values.
Notes on program:
- Review arrays and 2-D arrays.
- Review Analog Input
- No need for interpolation, just give the closest value in the table.
- Verify your program to catch the syntax errors.
Table:
Table to text:
{0.000, 0.000, 0.00, 0.0, 950},
{0.156, 3.125,11.25, 4.0, 953},
{0.313, 6.250,22.50, 8.0, 956},
{0.469, 9.375,33.75, 12.0, 959},
{0.625, 12.500, 45.00, 16.0, 963},
{0.781, 15.625, 56.25, 20.0, 966},
{0.938, 18.750, 67.50, 24.0, 969},
{1.094, 21.875, 78.75, 28.0, 972},
{1.250, 25.000, 90.00, 32.0, 975},
{1.406, 28.125, 101.25, 36.0, 978},
{1.563, 31.250, 112.50, 40.0, 981},
{1.719, 34.375, 123.75, 44.0, 984},
{1.875, 37.500, 135.00, 48.0, 988},
{2.031, 40.625, 146.25, 52.0, 991},
{2.188, 43.750, 157.50, 56.0, 994},
{2.344, 46.875, 168.75, 60.0, 997},
{2.500, 50.000, 180.00, 64.0, 1000},
{2.656, 53.125, 191.25, 68.0, 1003},
{2.813, 56.250, 202.50, 72.0, 1006},
{2.969, 59.375, 213.75, 76.0, 1009},
{3.125, 62.500, 225.00, 80.0, 1013},
{3.281, 65.625, 236.25, 84.0, 1016},
{3.438, 68.750, 247.50, 88.0, 1019},
{3.594, 71.875, 258.75, 92.0, 1022},
{3.750, 75.000, 270.00, 96.0, 1025},
{3.906, 78.125, 281.25, 100.0, 1028},
{4.063, 81.250, 292.50, 104.0, 1031},
{4.219, 84.375, 303.75, 108.0, 1034},
{4.375, 87.500, 315.00, 112.0, 1038},
{4.531, 90.625, 326.25, 116.0, 1041},
{4.688, 93.750, 337.50, 120.0, 1044},
{4.844, 96.875, 348.75, 124.0, 1047},
{5.000, 100.000, 360.00, 128.0, 1050},
I even tried to find/hire tutor(s) for this subject with no luck or way to expensive. Even if you know of a close example that I could use as a template would be helpful as well. Thanks for reading/helping.