センサーの値0...1023を0...約3.3Vに変換してあそぶ(3倍して15.625掛けて16で割り1/10足す)(オンラインコンパイラ)


参考

https://qiita.com/caa45040/items/69a4bcd4a03cdc447e76


x 単位は、mV


結果

![o_coq306.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/5efc7437-7c31-699b-57f3-6fa34e8bc61b.jpeg)


プログラム

オンラインコンパイラ


```c++

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    printf("START\n");
    
    unsigned short vo;
    for(int s=0;s<1025;s++){
        
        vo = s;
        
        vo = vo + vo + vo;
        vo = ((vo * 15U)+(vo >> 1)+(vo >> 3))>>4;
        vo = vo + (vo / 10);
        
        printf("(%d)[%d]\n",s,vo);
        
    }//for
    printf("\n");
}//main

```


```

START
(0)[0]
(1)[2]
(2)[5]
(3)[8]
(4)[12]
(5)[15]
(6)[18]
(7)[22]
(8)[25]
(9)[28]
(10)[31]
(11)[35]
(12)[38]
(13)[41]
(14)[45]
(15)[47]
(16)[50]
(17)[53]
(18)[57]
(19)[60]
(20)[63]
(21)[67]
(22)[70]
(23)[73]
(24)[77]
(25)[80]
(26)[83]
(27)[86]
(28)[90]
(29)[92]
(30)[95]
(31)[99]
(32)[102]
(33)[105]
(34)[108]
(35)[112]
(36)[115]
(37)[118]
(38)[122]
(39)[125]
(40)[128]
(41)[132]
(42)[135]
(43)[137]
(44)[140]
(45)[144]
(46)[147]
(47)[150]
(48)[154]
(49)[157]
(50)[160]
(51)[163]
(52)[167]
(53)[170]
(54)[173]
(55)[177]
(56)[180]
(57)[182]
(58)[185]
(59)[189]
(60)[192]
(61)[195]
(62)[199]
(63)[202]
(64)[205]
(65)[209]
(66)[212]
(67)[215]
(68)[218]
(69)[222]
(70)[225]
(71)[227]
(72)[231]
(73)[234]
(74)[237]
(75)[240]
(76)[244]
(77)[247]
(78)[250]
(79)[254]
(80)[257]
(81)[260]
(82)[264]
(83)[267]
(84)[270]
(85)[272]
(86)[276]
(87)[279]
(88)[282]
(89)[286]
(90)[289]
(91)[292]
(92)[295]
(93)[299]
(94)[302]
(95)[305]
(96)[309]
(97)[312]
(98)[315]
(99)[319]
(100)[321]
(101)[324]
(102)[327]
(103)[331]
(104)[334]
(105)[337]
(106)[341]
(107)[344]
(108)[347]
(109)[350]
(110)[354]
(111)[357]
(112)[360]
(113)[364]
(114)[366]
(115)[369]
(116)[372]
(117)[376]
(118)[379]
(119)[382]
(120)[386]
(121)[389]
(122)[392]
(123)[396]
(124)[399]
(125)[402]
(126)[405]
(127)[409]
(128)[412]
(129)[414]
(130)[418]
(131)[421]
(132)[424]
(133)[427]
(134)[431]
(135)[434]
(136)[437]
(137)[441]
(138)[444]
(139)[447]
(140)[451]
(141)[454]
(142)[457]
(143)[459]
(144)[463]
(145)[466]
(146)[469]
(147)[473]
(148)[476]
(149)[479]
(150)[482]
(151)[486]
(152)[489]
(153)[492]
(154)[496]
(155)[499]
(156)[502]
(157)[504]
(158)[508]
(159)[511]
(160)[514]
(161)[518]
(162)[521]
(163)[524]
(164)[528]
(165)[531]
(166)[534]
(167)[537]
(168)[541]
(169)[544]
(170)[547]
(171)[550]
(172)[553]
(173)[556]
(174)[559]
(175)[563]
(176)[566]
(177)[569]
(178)[573]
(179)[576]
(180)[579]
(181)[583]
(182)[586]
(183)[589]
(184)[592]
(185)[595]
(186)[598]
(187)[601]
(188)[605]
(189)[608]
(190)[611]
(191)[614]
(192)[618]
(193)[621]
(194)[624]
(195)[628]
(196)[631]
(197)[634]
(198)[638]
(199)[640]
(200)[643]
(201)[646]
(202)[650]
(203)[653]
(204)[656]
(205)[660]
(206)[663]
(207)[666]
(208)[669]
(209)[673]
(210)[676]
(211)[679]
(212)[683]
(213)[685]
(214)[688]
(215)[691]
(216)[695]
(217)[698]
(218)[701]
(219)[705]
(220)[708]
(221)[711]
(222)[715]
(223)[718]
(224)[721]
(225)[724]
(226)[728]
(227)[731]
(228)[733]
(229)[737]
(230)[740]
(231)[743]
(232)[746]
(233)[750]
(234)[753]
(235)[756]
(236)[760]
(237)[763]
(238)[766]
(239)[770]
(240)[773]
(241)[776]
(242)[778]
(243)[782]
(244)[785]
(245)[788]
(246)[792]
(247)[795]
(248)[798]
(249)[801]
(250)[805]
(251)[808]
(252)[811]
(253)[815]
(254)[818]
(255)[821]
(256)[825]
(257)[827]
(258)[830]
(259)[833]
(260)[837]
(261)[840]
(262)[843]
(263)[847]
(264)[850]
(265)[853]
(266)[856]
(267)[860]
(268)[863]
(269)[866]
(270)[870]
(271)[872]
(272)[875]
(273)[878]
(274)[882]
(275)[885]
(276)[888]
(277)[892]
(278)[895]
(279)[898]
(280)[902]
(281)[905]
(282)[908]
(283)[911]
(284)[915]
(285)[917]
(286)[920]
(287)[924]
(288)[927]
(289)[930]
(290)[933]
(291)[937]
(292)[940]
(293)[943]
(294)[947]
(295)[950]
(296)[953]
(297)[957]
(298)[960]
(299)[962]
(300)[965]
(301)[969]
(302)[972]
(303)[975]
(304)[979]
(305)[982]
(306)[985]
(307)[988]
(308)[992]
(309)[995]
(310)[998]
(311)[1002]
(312)[1005]
(313)[1007]
(314)[1010]
(315)[1014]
(316)[1017]
(317)[1020]
(318)[1024]
(319)[1027]
(320)[1030]
(321)[1034]
(322)[1037]
(323)[1040]
(324)[1043]
(325)[1047]
(326)[1050]
(327)[1052]
(328)[1056]
(329)[1059]
(330)[1062]
(331)[1065]
(332)[1069]
(333)[1072]
(334)[1075]
(335)[1079]
(336)[1082]
(337)[1085]
(338)[1089]
(339)[1092]
(340)[1095]
(341)[1097]
(342)[1101]
(343)[1104]
(344)[1107]
(345)[1111]
(346)[1114]
(347)[1117]
(348)[1120]
(349)[1124]
(350)[1127]
(351)[1130]
(352)[1134]
(353)[1137]
(354)[1140]
(355)[1144]
(356)[1146]
(357)[1149]
(358)[1152]
(359)[1156]
(360)[1159]
(361)[1162]
(362)[1166]
(363)[1169]
(364)[1172]
(365)[1175]
(366)[1179]
(367)[1182]
(368)[1185]
(369)[1189]
(370)[1191]
(371)[1194]
(372)[1197]
(373)[1201]
(374)[1204]
(375)[1207]
(376)[1211]
(377)[1214]
(378)[1217]
(379)[1221]
(380)[1224]
(381)[1227]
(382)[1230]
(383)[1234]
(384)[1237]
(385)[1239]
(386)[1243]
(387)[1246]
(388)[1249]
(389)[1252]
(390)[1256]
(391)[1259]
(392)[1262]
(393)[1266]
(394)[1269]
(395)[1272]
(396)[1276]
(397)[1279]
(398)[1282]
(399)[1284]
(400)[1288]
(401)[1291]
(402)[1294]
(403)[1298]
(404)[1301]
(405)[1304]
(406)[1307]
(407)[1311]
(408)[1314]
(409)[1317]
(410)[1321]
(411)[1324]
(412)[1327]
(413)[1329]
(414)[1333]
(415)[1336]
(416)[1339]
(417)[1343]
(418)[1346]
(419)[1349]
(420)[1353]
(421)[1356]
(422)[1359]
(423)[1362]
(424)[1366]
(425)[1369]
(426)[1372]
(427)[1375]
(428)[1378]
(429)[1381]
(430)[1384]
(431)[1388]
(432)[1391]
(433)[1394]
(434)[1398]
(435)[1401]
(436)[1404]
(437)[1408]
(438)[1411]
(439)[1414]
(440)[1417]
(441)[1420]
(442)[1423]
(443)[1426]
(444)[1430]
(445)[1433]
(446)[1436]
(447)[1439]
(448)[1443]
(449)[1446]
(450)[1449]
(451)[1453]
(452)[1456]
(453)[1459]
(454)[1463]
(455)[1465]
(456)[1468]
(457)[1471]
(458)[1475]
(459)[1478]
(460)[1481]
(461)[1485]
(462)[1488]
(463)[1491]
(464)[1494]
(465)[1498]
(466)[1501]
(467)[1504]
(468)[1508]
(469)[1510]
(470)[1513]
(471)[1516]
(472)[1520]
(473)[1523]
(474)[1526]
(475)[1530]
(476)[1533]
(477)[1536]
(478)[1540]
(479)[1543]
(480)[1546]
(481)[1549]
(482)[1553]
(483)[1556]
(484)[1558]
(485)[1562]
(486)[1565]
(487)[1568]
(488)[1571]
(489)[1575]
(490)[1578]
(491)[1581]
(492)[1585]
(493)[1588]
(494)[1591]
(495)[1595]
(496)[1598]
(497)[1601]
(498)[1603]
(499)[1607]
(500)[1610]
(501)[1613]
(502)[1617]
(503)[1620]
(504)[1623]
(505)[1626]
(506)[1630]
(507)[1633]
(508)[1636]
(509)[1640]
(510)[1643]
(511)[1646]
(512)[1650]
(513)[1652]
(514)[1655]
(515)[1658]
(516)[1662]
(517)[1665]
(518)[1668]
(519)[1672]
(520)[1675]
(521)[1678]
(522)[1681]
(523)[1685]
(524)[1688]
(525)[1691]
(526)[1695]
(527)[1697]
(528)[1700]
(529)[1703]
(530)[1707]
(531)[1710]
(532)[1713]
(533)[1717]
(534)[1720]
(535)[1723]
(536)[1727]
(537)[1730]
(538)[1733]
(539)[1736]
(540)[1740]
(541)[1742]
(542)[1745]
(543)[1749]
(544)[1752]
(545)[1755]
(546)[1758]
(547)[1762]
(548)[1765]
(549)[1768]
(550)[1772]
(551)[1775]
(552)[1778]
(553)[1782]
(554)[1785]
(555)[1787]
(556)[1790]
(557)[1794]
(558)[1797]
(559)[1800]
(560)[1804]
(561)[1807]
(562)[1810]
(563)[1813]
(564)[1817]
(565)[1820]
(566)[1823]
(567)[1827]
(568)[1830]
(569)[1832]
(570)[1835]
(571)[1839]
(572)[1842]
(573)[1845]
(574)[1849]
(575)[1852]
(576)[1855]
(577)[1859]
(578)[1862]
(579)[1865]
(580)[1868]
(581)[1872]
(582)[1875]
(583)[1877]
(584)[1881]
(585)[1884]
(586)[1887]
(587)[1890]
(588)[1894]
(589)[1897]
(590)[1900]
(591)[1904]
(592)[1907]
(593)[1910]
(594)[1914]
(595)[1917]
(596)[1920]
(597)[1922]
(598)[1926]
(599)[1929]
(600)[1932]
(601)[1936]
(602)[1939]
(603)[1942]
(604)[1945]
(605)[1949]
(606)[1952]
(607)[1955]
(608)[1959]
(609)[1962]
(610)[1965]
(611)[1969]
(612)[1971]
(613)[1974]
(614)[1977]
(615)[1981]
(616)[1984]
(617)[1987]
(618)[1991]
(619)[1994]
(620)[1997]
(621)[2000]
(622)[2004]
(623)[2007]
(624)[2010]
(625)[2014]
(626)[2016]
(627)[2019]
(628)[2022]
(629)[2026]
(630)[2029]
(631)[2032]
(632)[2036]
(633)[2039]
(634)[2042]
(635)[2046]
(636)[2049]
(637)[2052]
(638)[2055]
(639)[2059]
(640)[2062]
(641)[2064]
(642)[2068]
(643)[2071]
(644)[2074]
(645)[2077]
(646)[2081]
(647)[2084]
(648)[2087]
(649)[2091]
(650)[2094]
(651)[2097]
(652)[2101]
(653)[2104]
(654)[2107]
(655)[2109]
(656)[2113]
(657)[2116]
(658)[2119]
(659)[2123]
(660)[2126]
(661)[2129]
(662)[2132]
(663)[2136]
(664)[2139]
(665)[2142]
(666)[2146]
(667)[2149]
(668)[2152]
(669)[2154]
(670)[2158]
(671)[2161]
(672)[2164]
(673)[2168]
(674)[2171]
(675)[2174]
(676)[2178]
(677)[2181]
(678)[2184]
(679)[2187]
(680)[2191]
(681)[2194]
(682)[2197]
(683)[2200]
(684)[2203]
(685)[2206]
(686)[2209]
(687)[2213]
(688)[2216]
(689)[2219]
(690)[2223]
(691)[2226]
(692)[2229]
(693)[2233]
(694)[2236]
(695)[2239]
(696)[2242]
(697)[2245]
(698)[2248]
(699)[2251]
(700)[2255]
(701)[2258]
(702)[2261]
(703)[2264]
(704)[2268]
(705)[2271]
(706)[2274]
(707)[2278]
(708)[2281]
(709)[2284]
(710)[2288]
(711)[2290]
(712)[2293]
(713)[2296]
(714)[2300]
(715)[2303]
(716)[2306]
(717)[2310]
(718)[2313]
(719)[2316]
(720)[2319]
(721)[2323]
(722)[2326]
(723)[2329]
(724)[2333]
(725)[2335]
(726)[2338]
(727)[2341]
(728)[2345]
(729)[2348]
(730)[2351]
(731)[2355]
(732)[2358]
(733)[2361]
(734)[2365]
(735)[2368]
(736)[2371]
(737)[2374]
(738)[2378]
(739)[2381]
(740)[2383]
(741)[2387]
(742)[2390]
(743)[2393]
(744)[2396]
(745)[2400]
(746)[2403]
(747)[2406]
(748)[2410]
(749)[2413]
(750)[2416]
(751)[2420]
(752)[2423]
(753)[2426]
(754)[2428]
(755)[2432]
(756)[2435]
(757)[2438]
(758)[2442]
(759)[2445]
(760)[2448]
(761)[2451]
(762)[2455]
(763)[2458]
(764)[2461]
(765)[2465]
(766)[2468]
(767)[2471]
(768)[2475]
(769)[2477]
(770)[2480]
(771)[2483]
(772)[2487]
(773)[2490]
(774)[2493]
(775)[2497]
(776)[2500]
(777)[2503]
(778)[2506]
(779)[2510]
(780)[2513]
(781)[2516]
(782)[2520]
(783)[2522]
(784)[2525]
(785)[2528]
(786)[2532]
(787)[2535]
(788)[2538]
(789)[2542]
(790)[2545]
(791)[2548]
(792)[2552]
(793)[2555]
(794)[2558]
(795)[2561]
(796)[2565]
(797)[2567]
(798)[2570]
(799)[2574]
(800)[2577]
(801)[2580]
(802)[2583]
(803)[2587]
(804)[2590]
(805)[2593]
(806)[2597]
(807)[2600]
(808)[2603]
(809)[2607]
(810)[2610]
(811)[2612]
(812)[2615]
(813)[2619]
(814)[2622]
(815)[2625]
(816)[2629]
(817)[2632]
(818)[2635]
(819)[2638]
(820)[2642]
(821)[2645]
(822)[2648]
(823)[2652]
(824)[2655]
(825)[2657]
(826)[2660]
(827)[2664]
(828)[2667]
(829)[2670]
(830)[2674]
(831)[2677]
(832)[2680]
(833)[2684]
(834)[2687]
(835)[2690]
(836)[2693]
(837)[2697]
(838)[2700]
(839)[2702]
(840)[2706]
(841)[2709]
(842)[2712]
(843)[2715]
(844)[2719]
(845)[2722]
(846)[2725]
(847)[2729]
(848)[2732]
(849)[2735]
(850)[2739]
(851)[2742]
(852)[2745]
(853)[2747]
(854)[2751]
(855)[2754]
(856)[2757]
(857)[2761]
(858)[2764]
(859)[2767]
(860)[2770]
(861)[2774]
(862)[2777]
(863)[2780]
(864)[2784]
(865)[2787]
(866)[2790]
(867)[2794]
(868)[2796]
(869)[2799]
(870)[2802]
(871)[2806]
(872)[2809]
(873)[2812]
(874)[2816]
(875)[2819]
(876)[2822]
(877)[2825]
(878)[2829]
(879)[2832]
(880)[2835]
(881)[2839]
(882)[2841]
(883)[2844]
(884)[2847]
(885)[2851]
(886)[2854]
(887)[2857]
(888)[2861]
(889)[2864]
(890)[2867]
(891)[2871]
(892)[2874]
(893)[2877]
(894)[2880]
(895)[2884]
(896)[2887]
(897)[2889]
(898)[2893]
(899)[2896]
(900)[2899]
(901)[2902]
(902)[2906]
(903)[2909]
(904)[2912]
(905)[2916]
(906)[2919]
(907)[2922]
(908)[2926]
(909)[2929]
(910)[2932]
(911)[2934]
(912)[2938]
(913)[2941]
(914)[2944]
(915)[2948]
(916)[2951]
(917)[2954]
(918)[2957]
(919)[2961]
(920)[2964]
(921)[2967]
(922)[2971]
(923)[2974]
(924)[2977]
(925)[2979]
(926)[2983]
(927)[2986]
(928)[2989]
(929)[2993]
(930)[2996]
(931)[2999]
(932)[3003]
(933)[3006]
(934)[3009]
(935)[3012]
(936)[3016]
(937)[3019]
(938)[3022]
(939)[3025]
(940)[3028]
(941)[3031]
(942)[3034]
(943)[3038]
(944)[3041]
(945)[3044]
(946)[3048]
(947)[3051]
(948)[3054]
(949)[3058]
(950)[3061]
(951)[3064]
(952)[3067]
(953)[3070]
(954)[3073]
(955)[3076]
(956)[3080]
(957)[3083]
(958)[3086]
(959)[3089]
(960)[3093]
(961)[3096]
(962)[3099]
(963)[3103]
(964)[3106]
(965)[3109]
(966)[3113]
(967)[3115]
(968)[3118]
(969)[3121]
(970)[3125]
(971)[3128]
(972)[3131]
(973)[3135]
(974)[3138]
(975)[3141]
(976)[3144]
(977)[3148]
(978)[3151]
(979)[3154]
(980)[3158]
(981)[3160]
(982)[3163]
(983)[3166]
(984)[3170]
(985)[3173]
(986)[3176]
(987)[3180]
(988)[3183]
(989)[3186]
(990)[3190]
(991)[3193]
(992)[3196]
(993)[3199]
(994)[3203]
(995)[3206]
(996)[3208]
(997)[3212]
(998)[3215]
(999)[3218]
(1000)[3221]
(1001)[3225]
(1002)[3228]
(1003)[3231]
(1004)[3235]
(1005)[3238]
(1006)[3241]
(1007)[3245]
(1008)[3248]
(1009)[3251]
(1010)[3253]
(1011)[3257]
(1012)[3260]
(1013)[3263]
(1014)[3267]
(1015)[3270]
(1016)[3273]
(1017)[3276]
(1018)[3280]
(1019)[3283]
(1020)[3286]
(1021)[3290]
(1022)[3293]
(1023)[3296]
(1024)[3300]


```