Results 1 to 7 of 7
Thread: 8051 +
Hybrid View
-
28th April 2013 17:08 #1
8051 +
,
,
. , . 3 sharp gp2y0a21yk0f. ADC 0808 0 255 , . , ADC- (.)

ADC- :
SensorVoltage=AdcValue*0.01953 [V]
., :
distance=27*(SensorVoltage)^(-1.15)
, 8051 .
X470 AORUS ULTRA GAMING | Ryzen5 2600 |2x16GB Corsair LPX 3200Mhz | EVGA GeForce GTX 1080 Ti SC Black Edition Gaming|512GB Samsung 970 Pro +
512GB ADATA SU800| Corsair HX1200i | Corsair Graphite 600t |BENQ PD3200U
-
28th April 2013 19:22 #2Registered User
Join Date: Jul:2004
Location:
Posts: 621
, 256 , - ? 0-255 ADC-
-
28th April 2013 19:50 #3
, , -
. .
:
[]=27/([ ADC]*0.01953)^1,15
, - 255 , ? 89C51 , ?X470 AORUS ULTRA GAMING | Ryzen5 2600 |2x16GB Corsair LPX 3200Mhz | EVGA GeForce GTX 1080 Ti SC Black Edition Gaming|512GB Samsung 970 Pro +
512GB ADATA SU800| Corsair HX1200i | Corsair Graphite 600t |BENQ PD3200U
-
28th April 2013 21:15 #4
-
28th April 2013 23:39 #5
-
29th April 2013 00:16 #6Registered User
Join Date: Jul:2004
Location:
Posts: 621
, -:
math.h,Code:printf("float adcToDistance[256] = {\n"); printf("\t%.4lf", 0.0); // Formula is undefined for i == 0 for (int i = 1; i < 256; ++i) { printf(",\n\t%.4lf", 27.0 / pow(i * 0.01953, 1.15)); } printf("\n};\n");
-
28th April 2013 19:52 #7
, . , , 16 , . , , ( ).
ADC Sense=AdcVal*Vmax/255, Vmax/256. , 256 255 . . , .
AdcVal*Vmax/255, distance=27*(SensorVoltage)^(-1.15)
d=27/(AdcVal*Vmax/255)^1.15
d=27/(AdcVal/51)^1.15
d=27*51^1.15/AdcVal^1.15
d=2483.5/AdcVal^1.15
AdcVal^1.15.
. 16 , , - .
. , - 10 , - , , , .D80; 50/1.8D; Tamron 70-300; 18-55 VR;




Reply With Quote

Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in