#1 2016-10-04 22:43:08

NoName
Customer
Из Київ
Зарегистрирован: 2014-07-08
Сообщений: 1,404

Homemade arduino boat

решил и я сделать свой велосипед
лавры Pedro ( http://forum.arduino.ua/viewtopic.php?id=263&p=1 ) & boston dynamics  не дают покоя )

с механикой увлекаться не будем, потому используем готовые решения,
и акцентируем внимание на dyi remote control
у меня есть  такая штука,  без управления
centuryboat4.jpg

сделал распределение мощностей на винты, такой вариaнт нормальный?
кто-то делал такую игрушку?
90 & 270 не нравятся,

angle = 0°  L  = 100%  R  = 100% 
angle = 1°  L  = 100%  R  = 99.9848% 
angle = 2°  L  = 100%  R  = 99.9391% 
angle = 3°  L  = 100%  R  = 99.863% 
angle = 4°  L  = 100%  R  = 99.7564% 
angle = 5°  L  = 100%  R  = 99.6195% 
angle = 6°  L  = 100%  R  = 99.4522% 
angle = 7°  L  = 100%  R  = 99.2546% 
angle = 8°  L  = 100%  R  = 99.0268% 
angle = 9°  L  = 100%  R  = 98.7688% 
angle = 10°  L  = 100%  R  = 98.4808% 
angle = 11°  L  = 100%  R  = 98.1627% 
angle = 12°  L  = 100%  R  = 97.8148% 
angle = 13°  L  = 100%  R  = 97.437% 
angle = 14°  L  = 100%  R  = 97.0296% 
angle = 15°  L  = 100%  R  = 96.5926% 
angle = 16°  L  = 100%  R  = 96.1262% 
angle = 17°  L  = 100%  R  = 95.6305% 
angle = 18°  L  = 100%  R  = 95.1057% 
angle = 19°  L  = 100%  R  = 94.5519% 
angle = 20°  L  = 100%  R  = 93.9693% 
angle = 21°  L  = 100%  R  = 93.358% 
angle = 22°  L  = 100%  R  = 92.7184% 
angle = 23°  L  = 100%  R  = 92.0505% 
angle = 24°  L  = 100%  R  = 91.3545% 
angle = 25°  L  = 100%  R  = 90.6308% 
angle = 26°  L  = 100%  R  = 89.8794% 
angle = 27°  L  = 100%  R  = 89.1007% 
angle = 28°  L  = 100%  R  = 88.2948% 
angle = 29°  L  = 100%  R  = 87.462% 
angle = 30°  L  = 100%  R  = 86.6025% 
angle = 31°  L  = 100%  R  = 85.7167% 
angle = 32°  L  = 100%  R  = 84.8048% 
angle = 33°  L  = 100%  R  = 83.8671% 
angle = 34°  L  = 100%  R  = 82.9038% 
angle = 35°  L  = 100%  R  = 81.9152% 
angle = 36°  L  = 100%  R  = 80.9017% 
angle = 37°  L  = 100%  R  = 79.8635% 
angle = 38°  L  = 100%  R  = 78.8011% 
angle = 39°  L  = 100%  R  = 77.7146% 
angle = 40°  L  = 100%  R  = 76.6044% 
angle = 41°  L  = 100%  R  = 75.471% 
angle = 42°  L  = 100%  R  = 74.3145% 
angle = 43°  L  = 100%  R  = 73.1354% 
angle = 44°  L  = 100%  R  = 71.934% 
angle = 45°  L  = 100%  R  = 70.7107% 
angle = 46°  L  = 100%  R  = 69.4658% 
angle = 47°  L  = 100%  R  = 68.1998% 
angle = 48°  L  = 100%  R  = 66.9131% 
angle = 49°  L  = 100%  R  = 65.6059% 
angle = 50°  L  = 100%  R  = 64.2788% 
angle = 51°  L  = 100%  R  = 62.932% 
angle = 52°  L  = 100%  R  = 61.5662% 
angle = 53°  L  = 100%  R  = 60.1815% 
angle = 54°  L  = 100%  R  = 58.7785% 
angle = 55°  L  = 100%  R  = 57.3576% 
angle = 56°  L  = 100%  R  = 55.9193% 
angle = 57°  L  = 100%  R  = 54.4639% 
angle = 58°  L  = 100%  R  = 52.9919% 
angle = 59°  L  = 100%  R  = 51.5038% 
angle = 60°  L  = 100%  R  = 50% 
angle = 61°  L  = 100%  R  = 48.481% 
angle = 62°  L  = 100%  R  = 46.9472% 
angle = 63°  L  = 100%  R  = 45.399% 
angle = 64°  L  = 100%  R  = 43.8371% 
angle = 65°  L  = 100%  R  = 42.2618% 
angle = 66°  L  = 100%  R  = 40.6737% 
angle = 67°  L  = 100%  R  = 39.0731% 
angle = 68°  L  = 100%  R  = 37.4607% 
angle = 69°  L  = 100%  R  = 35.8368% 
angle = 70°  L  = 100%  R  = 34.202% 
angle = 71°  L  = 100%  R  = 32.5568% 
angle = 72°  L  = 100%  R  = 30.9017% 
angle = 73°  L  = 100%  R  = 29.2372% 
angle = 74°  L  = 100%  R  = 27.5637% 
angle = 75°  L  = 100%  R  = 25.8819% 
angle = 76°  L  = 100%  R  = 24.1922% 
angle = 77°  L  = 100%  R  = 22.4951% 
angle = 78°  L  = 100%  R  = 20.7912% 
angle = 79°  L  = 100%  R  = 19.0809% 
angle = 80°  L  = 100%  R  = 17.3648% 
angle = 81°  L  = 100%  R  = 15.6434% 
angle = 82°  L  = 100%  R  = 13.9173% 
angle = 83°  L  = 100%  R  = 12.1869% 
angle = 84°  L  = 100%  R  = 10.4528% 
angle = 85°  L  = 100%  R  = 8.71557% 
angle = 86°  L  = 100%  R  = 6.97565% 
angle = 87°  L  = 100%  R  = 5.2336% 
angle = 88°  L  = 100%  R  = 3.48995% 
angle = 89°  L  = 100%  R  = 1.74524% 
angle = 90°  L  = 100%  R  = 6.12303e-15% 
angle = 91°  L  = -100%  R  = -1.74524% 
angle = 92°  L  = -100%  R  = -3.48995% 
angle = 93°  L  = -100%  R  = -5.2336% 
angle = 94°  L  = -100%  R  = -6.97565% 
angle = 95°  L  = -100%  R  = -8.71557% 
angle = 96°  L  = -100%  R  = -10.4528% 
angle = 97°  L  = -100%  R  = -12.1869% 
angle = 98°  L  = -100%  R  = -13.9173% 
angle = 99°  L  = -100%  R  = -15.6434% 
angle = 100°  L  = -100%  R  = -17.3648% 
angle = 101°  L  = -100%  R  = -19.0809% 
angle = 102°  L  = -100%  R  = -20.7912% 
angle = 103°  L  = -100%  R  = -22.4951% 
angle = 104°  L  = -100%  R  = -24.1922% 
angle = 105°  L  = -100%  R  = -25.8819% 
angle = 106°  L  = -100%  R  = -27.5637% 
angle = 107°  L  = -100%  R  = -29.2372% 
angle = 108°  L  = -100%  R  = -30.9017% 
angle = 109°  L  = -100%  R  = -32.5568% 
angle = 110°  L  = -100%  R  = -34.202% 
angle = 111°  L  = -100%  R  = -35.8368% 
angle = 112°  L  = -100%  R  = -37.4607% 
angle = 113°  L  = -100%  R  = -39.0731% 
angle = 114°  L  = -100%  R  = -40.6737% 
angle = 115°  L  = -100%  R  = -42.2618% 
angle = 116°  L  = -100%  R  = -43.8371% 
angle = 117°  L  = -100%  R  = -45.399% 
angle = 118°  L  = -100%  R  = -46.9472% 
angle = 119°  L  = -100%  R  = -48.481% 
angle = 120°  L  = -100%  R  = -50% 
angle = 121°  L  = -100%  R  = -51.5038% 
angle = 122°  L  = -100%  R  = -52.9919% 
angle = 123°  L  = -100%  R  = -54.4639% 
angle = 124°  L  = -100%  R  = -55.9193% 
angle = 125°  L  = -100%  R  = -57.3576% 
angle = 126°  L  = -100%  R  = -58.7785% 
angle = 127°  L  = -100%  R  = -60.1815% 
angle = 128°  L  = -100%  R  = -61.5662% 
angle = 129°  L  = -100%  R  = -62.932% 
angle = 130°  L  = -100%  R  = -64.2788% 
angle = 131°  L  = -100%  R  = -65.6059% 
angle = 132°  L  = -100%  R  = -66.9131% 
angle = 133°  L  = -100%  R  = -68.1998% 
angle = 134°  L  = -100%  R  = -69.4658% 
angle = 135°  L  = -100%  R  = -70.7107% 
angle = 136°  L  = -100%  R  = -71.934% 
angle = 137°  L  = -100%  R  = -73.1354% 
angle = 138°  L  = -100%  R  = -74.3145% 
angle = 139°  L  = -100%  R  = -75.471% 
angle = 140°  L  = -100%  R  = -76.6044% 
angle = 141°  L  = -100%  R  = -77.7146% 
angle = 142°  L  = -100%  R  = -78.8011% 
angle = 143°  L  = -100%  R  = -79.8635% 
angle = 144°  L  = -100%  R  = -80.9017% 
angle = 145°  L  = -100%  R  = -81.9152% 
angle = 146°  L  = -100%  R  = -82.9038% 
angle = 147°  L  = -100%  R  = -83.8671% 
angle = 148°  L  = -100%  R  = -84.8048% 
angle = 149°  L  = -100%  R  = -85.7167% 
angle = 150°  L  = -100%  R  = -86.6025% 
angle = 151°  L  = -100%  R  = -87.462% 
angle = 152°  L  = -100%  R  = -88.2948% 
angle = 153°  L  = -100%  R  = -89.1007% 
angle = 154°  L  = -100%  R  = -89.8794% 
angle = 155°  L  = -100%  R  = -90.6308% 
angle = 156°  L  = -100%  R  = -91.3545% 
angle = 157°  L  = -100%  R  = -92.0505% 
angle = 158°  L  = -100%  R  = -92.7184% 
angle = 159°  L  = -100%  R  = -93.358% 
angle = 160°  L  = -100%  R  = -93.9693% 
angle = 161°  L  = -100%  R  = -94.5519% 
angle = 162°  L  = -100%  R  = -95.1057% 
angle = 163°  L  = -100%  R  = -95.6305% 
angle = 164°  L  = -100%  R  = -96.1262% 
angle = 165°  L  = -100%  R  = -96.5926% 
angle = 166°  L  = -100%  R  = -97.0296% 
angle = 167°  L  = -100%  R  = -97.437% 
angle = 168°  L  = -100%  R  = -97.8148% 
angle = 169°  L  = -100%  R  = -98.1627% 
angle = 170°  L  = -100%  R  = -98.4808% 
angle = 171°  L  = -100%  R  = -98.7688% 
angle = 172°  L  = -100%  R  = -99.0268% 
angle = 173°  L  = -100%  R  = -99.2546% 
angle = 174°  L  = -100%  R  = -99.4522% 
angle = 175°  L  = -100%  R  = -99.6195% 
angle = 176°  L  = -100%  R  = -99.7564% 
angle = 177°  L  = -100%  R  = -99.863% 
angle = 178°  L  = -100%  R  = -99.9391% 
angle = 179°  L  = -100%  R  = -99.9848% 
angle = 180°  L  = -100%  R  = -100% 
angle = 181°  L  = -99.9848%  R  = -100% 
angle = 182°  L  = -99.9391%  R  = -100% 
angle = 183°  L  = -99.863%  R  = -100% 
angle = 184°  L  = -99.7564%  R  = -100% 
angle = 185°  L  = -99.6195%  R  = -100% 
angle = 186°  L  = -99.4522%  R  = -100% 
angle = 187°  L  = -99.2546%  R  = -100% 
angle = 188°  L  = -99.0268%  R  = -100% 
angle = 189°  L  = -98.7688%  R  = -100% 
angle = 190°  L  = -98.4808%  R  = -100% 
angle = 191°  L  = -98.1627%  R  = -100% 
angle = 192°  L  = -97.8148%  R  = -100% 
angle = 193°  L  = -97.437%  R  = -100% 
angle = 194°  L  = -97.0296%  R  = -100% 
angle = 195°  L  = -96.5926%  R  = -100% 
angle = 196°  L  = -96.1262%  R  = -100% 
angle = 197°  L  = -95.6305%  R  = -100% 
angle = 198°  L  = -95.1057%  R  = -100% 
angle = 199°  L  = -94.5519%  R  = -100% 
angle = 200°  L  = -93.9693%  R  = -100% 
angle = 201°  L  = -93.358%  R  = -100% 
angle = 202°  L  = -92.7184%  R  = -100% 
angle = 203°  L  = -92.0505%  R  = -100% 
angle = 204°  L  = -91.3545%  R  = -100% 
angle = 205°  L  = -90.6308%  R  = -100% 
angle = 206°  L  = -89.8794%  R  = -100% 
angle = 207°  L  = -89.1007%  R  = -100% 
angle = 208°  L  = -88.2948%  R  = -100% 
angle = 209°  L  = -87.462%  R  = -100% 
angle = 210°  L  = -86.6025%  R  = -100% 
angle = 211°  L  = -85.7167%  R  = -100% 
angle = 212°  L  = -84.8048%  R  = -100% 
angle = 213°  L  = -83.8671%  R  = -100% 
angle = 214°  L  = -82.9038%  R  = -100% 
angle = 215°  L  = -81.9152%  R  = -100% 
angle = 216°  L  = -80.9017%  R  = -100% 
angle = 217°  L  = -79.8635%  R  = -100% 
angle = 218°  L  = -78.8011%  R  = -100% 
angle = 219°  L  = -77.7146%  R  = -100% 
angle = 220°  L  = -76.6044%  R  = -100% 
angle = 221°  L  = -75.471%  R  = -100% 
angle = 222°  L  = -74.3145%  R  = -100% 
angle = 223°  L  = -73.1354%  R  = -100% 
angle = 224°  L  = -71.934%  R  = -100% 
angle = 225°  L  = -70.7107%  R  = -100% 
angle = 226°  L  = -69.4658%  R  = -100% 
angle = 227°  L  = -68.1998%  R  = -100% 
angle = 228°  L  = -66.9131%  R  = -100% 
angle = 229°  L  = -65.6059%  R  = -100% 
angle = 230°  L  = -64.2788%  R  = -100% 
angle = 231°  L  = -62.932%  R  = -100% 
angle = 232°  L  = -61.5662%  R  = -100% 
angle = 233°  L  = -60.1815%  R  = -100% 
angle = 234°  L  = -58.7785%  R  = -100% 
angle = 235°  L  = -57.3576%  R  = -100% 
angle = 236°  L  = -55.9193%  R  = -100% 
angle = 237°  L  = -54.4639%  R  = -100% 
angle = 238°  L  = -52.9919%  R  = -100% 
angle = 239°  L  = -51.5038%  R  = -100% 
angle = 240°  L  = -50%  R  = -100% 
angle = 241°  L  = -48.481%  R  = -100% 
angle = 242°  L  = -46.9472%  R  = -100% 
angle = 243°  L  = -45.399%  R  = -100% 
angle = 244°  L  = -43.8371%  R  = -100% 
angle = 245°  L  = -42.2618%  R  = -100% 
angle = 246°  L  = -40.6737%  R  = -100% 
angle = 247°  L  = -39.0731%  R  = -100% 
angle = 248°  L  = -37.4607%  R  = -100% 
angle = 249°  L  = -35.8368%  R  = -100% 
angle = 250°  L  = -34.202%  R  = -100% 
angle = 251°  L  = -32.5568%  R  = -100% 
angle = 252°  L  = -30.9017%  R  = -100% 
angle = 253°  L  = -29.2372%  R  = -100% 
angle = 254°  L  = -27.5637%  R  = -100% 
angle = 255°  L  = -25.8819%  R  = -100% 
angle = 256°  L  = -24.1922%  R  = -100% 
angle = 257°  L  = -22.4951%  R  = -100% 
angle = 258°  L  = -20.7912%  R  = -100% 
angle = 259°  L  = -19.0809%  R  = -100% 
angle = 260°  L  = -17.3648%  R  = -100% 
angle = 261°  L  = -15.6434%  R  = -100% 
angle = 262°  L  = -13.9173%  R  = -100% 
angle = 263°  L  = -12.1869%  R  = -100% 
angle = 264°  L  = -10.4528%  R  = -100% 
angle = 265°  L  = -8.71557%  R  = -100% 
angle = 266°  L  = -6.97565%  R  = -100% 
angle = 267°  L  = -5.2336%  R  = -100% 
angle = 268°  L  = -3.48995%  R  = -100% 
angle = 269°  L  = -1.74524%  R  = -100% 
angle = 270°  L  = -1.83691e-14%  R  = -100% 
angle = 271°  L  = 1.74524%  R  = 100% 
angle = 272°  L  = 3.48995%  R  = 100% 
angle = 273°  L  = 5.2336%  R  = 100% 
angle = 274°  L  = 6.97565%  R  = 100% 
angle = 275°  L  = 8.71557%  R  = 100% 
angle = 276°  L  = 10.4528%  R  = 100% 
angle = 277°  L  = 12.1869%  R  = 100% 
angle = 278°  L  = 13.9173%  R  = 100% 
angle = 279°  L  = 15.6434%  R  = 100% 
angle = 280°  L  = 17.3648%  R  = 100% 
angle = 281°  L  = 19.0809%  R  = 100% 
angle = 282°  L  = 20.7912%  R  = 100% 
angle = 283°  L  = 22.4951%  R  = 100% 
angle = 284°  L  = 24.1922%  R  = 100% 
angle = 285°  L  = 25.8819%  R  = 100% 
angle = 286°  L  = 27.5637%  R  = 100% 
angle = 287°  L  = 29.2372%  R  = 100% 
angle = 288°  L  = 30.9017%  R  = 100% 
angle = 289°  L  = 32.5568%  R  = 100% 
angle = 290°  L  = 34.202%  R  = 100% 
angle = 291°  L  = 35.8368%  R  = 100% 
angle = 292°  L  = 37.4607%  R  = 100% 
angle = 293°  L  = 39.0731%  R  = 100% 
angle = 294°  L  = 40.6737%  R  = 100% 
angle = 295°  L  = 42.2618%  R  = 100% 
angle = 296°  L  = 43.8371%  R  = 100% 
angle = 297°  L  = 45.399%  R  = 100% 
angle = 298°  L  = 46.9472%  R  = 100% 
angle = 299°  L  = 48.481%  R  = 100% 
angle = 300°  L  = 50%  R  = 100% 
angle = 301°  L  = 51.5038%  R  = 100% 
angle = 302°  L  = 52.9919%  R  = 100% 
angle = 303°  L  = 54.4639%  R  = 100% 
angle = 304°  L  = 55.9193%  R  = 100% 
angle = 305°  L  = 57.3576%  R  = 100% 
angle = 306°  L  = 58.7785%  R  = 100% 
angle = 307°  L  = 60.1815%  R  = 100% 
angle = 308°  L  = 61.5662%  R  = 100% 
angle = 309°  L  = 62.932%  R  = 100% 
angle = 310°  L  = 64.2788%  R  = 100% 
angle = 311°  L  = 65.6059%  R  = 100% 
angle = 312°  L  = 66.9131%  R  = 100% 
angle = 313°  L  = 68.1998%  R  = 100% 
angle = 314°  L  = 69.4658%  R  = 100% 
angle = 315°  L  = 70.7107%  R  = 100% 
angle = 316°  L  = 71.934%  R  = 100% 
angle = 317°  L  = 73.1354%  R  = 100% 
angle = 318°  L  = 74.3145%  R  = 100% 
angle = 319°  L  = 75.471%  R  = 100% 
angle = 320°  L  = 76.6044%  R  = 100% 
angle = 321°  L  = 77.7146%  R  = 100% 
angle = 322°  L  = 78.8011%  R  = 100% 
angle = 323°  L  = 79.8635%  R  = 100% 
angle = 324°  L  = 80.9017%  R  = 100% 
angle = 325°  L  = 81.9152%  R  = 100% 
angle = 326°  L  = 82.9038%  R  = 100% 
angle = 327°  L  = 83.8671%  R  = 100% 
angle = 328°  L  = 84.8048%  R  = 100% 
angle = 329°  L  = 85.7167%  R  = 100% 
angle = 330°  L  = 86.6025%  R  = 100% 
angle = 331°  L  = 87.462%  R  = 100% 
angle = 332°  L  = 88.2948%  R  = 100% 
angle = 333°  L  = 89.1007%  R  = 100% 
angle = 334°  L  = 89.8794%  R  = 100% 
angle = 335°  L  = 90.6308%  R  = 100% 
angle = 336°  L  = 91.3545%  R  = 100% 
angle = 337°  L  = 92.0505%  R  = 100% 
angle = 338°  L  = 92.7184%  R  = 100% 
angle = 339°  L  = 93.358%  R  = 100% 
angle = 340°  L  = 93.9693%  R  = 100% 
angle = 341°  L  = 94.5519%  R  = 100% 
angle = 342°  L  = 95.1057%  R  = 100% 
angle = 343°  L  = 95.6305%  R  = 100% 
angle = 344°  L  = 96.1262%  R  = 100% 
angle = 345°  L  = 96.5926%  R  = 100% 
angle = 346°  L  = 97.0296%  R  = 100% 
angle = 347°  L  = 97.437%  R  = 100% 
angle = 348°  L  = 97.8148%  R  = 100% 
angle = 349°  L  = 98.1627%  R  = 100% 
angle = 350°  L  = 98.4808%  R  = 100% 
angle = 351°  L  = 98.7688%  R  = 100% 
angle = 352°  L  = 99.0268%  R  = 100% 
angle = 353°  L  = 99.2546%  R  = 100% 
angle = 354°  L  = 99.4522%  R  = 100% 
angle = 355°  L  = 99.6195%  R  = 100% 
angle = 356°  L  = 99.7564%  R  = 100% 
angle = 357°  L  = 99.863%  R  = 100% 
angle = 358°  L  = 99.9391%  R  = 100% 
angle = 359°  L  = 99.9848%  R  = 100% 
angle = 0°  L  = 100%  R  = 100% 

в принципе куплю танк, небольшой,  на проводном управлении
плавать за убежавшими проектами неудобно )

#2 2016-10-05 13:36:27

NoName
Customer
Из Київ
Зарегистрирован: 2014-07-08
Сообщений: 1,404

Re: Homemade arduino boat

всем бобрового утра
некие соображение по  невнятным векторам 90 и 270

так как нам "мозги" пока не нужны  в лодке )
примем волевое решение  - в системе управления,  вектора на 90 и  270 град  условно допустимы
при таких векторах   ограничимся 10% процентами   от необходимой мощности,
есть небольшие перекосы на 0 и  180, но систему скорее всего придется калибровать на прямолинейное движение, там и будем разбираться
также делать плавный запуск и изменение мощности, так что с пивом пойдет )

в примере  расчетная мощность  от максимума 60%
angle - вектор  по часовой,  0 направление по оси вперед.

angle = 0°  L  = 60%  R  = 60% 
angle = 1°  L  = 60.0956%  R  = 60.0864% 
angle = 2°  L  = 60.1728%  R  = 60.1362% 
angle = 3°  L  = 60.2318%  R  = 60.1492% 
angle = 4°  L  = 60.2724%  R  = 60.1256% 
angle = 5°  L  = 60.2946%  R  = 60.0652% 
angle = 6°  L  = 60.2985%  R  = 59.9682% 
angle = 7°  L  = 60.284%  R  = 59.8346% 
angle = 8°  L  = 60.2511%  R  = 59.6648% 
angle = 9°  L  = 60.1999%  R  = 59.4587% 
angle = 10°  L  = 60.1304%  R  = 59.2168% 
angle = 11°  L  = 60.0425%  R  = 58.9393% 
angle = 12°  L  = 59.9363%  R  = 58.6266% 
angle = 13°  L  = 59.8119%  R  = 58.2789% 
angle = 14°  L  = 59.6693%  R  = 57.8968% 
angle = 15°  L  = 59.5085%  R  = 57.4808% 
angle = 16°  L  = 59.3295%  R  = 57.0312% 
angle = 17°  L  = 59.1325%  R  = 56.5487% 
angle = 18°  L  = 58.9175%  R  = 56.0339% 
angle = 19°  L  = 58.6845%  R  = 55.4873% 
angle = 20°  L  = 58.4337%  R  = 54.9097% 
angle = 21°  L  = 58.165%  R  = 54.3017% 
angle = 22°  L  = 57.8787%  R  = 53.6642% 
angle = 23°  L  = 57.5747%  R  = 52.9978% 
angle = 24°  L  = 57.2531%  R  = 52.3034% 
angle = 25°  L  = 56.9142%  R  = 51.5818% 
angle = 26°  L  = 56.5579%  R  = 50.8339% 
angle = 27°  L  = 56.1843%  R  = 50.0606% 
angle = 28°  L  = 55.7937%  R  = 49.2629% 
angle = 29°  L  = 55.386%  R  = 48.4417% 
angle = 30°  L  = 54.9615%  R  = 47.5981% 
angle = 31°  L  = 54.5203%  R  = 46.733% 
angle = 32°  L  = 54.0624%  R  = 45.8475% 
angle = 33°  L  = 53.5881%  R  = 44.9427% 
angle = 34°  L  = 53.0974%  R  = 44.0197% 
angle = 35°  L  = 52.5906%  R  = 43.0797% 
angle = 36°  L  = 52.0677%  R  = 42.1237% 
angle = 37°  L  = 51.529%  R  = 41.1529% 
angle = 38°  L  = 50.9746%  R  = 40.1685% 
angle = 39°  L  = 50.4047%  R  = 39.1718% 
angle = 40°  L  = 49.8194%  R  = 38.1639% 
angle = 41°  L  = 49.2189%  R  = 37.146% 
angle = 42°  L  = 48.6035%  R  = 36.1194% 
angle = 43°  L  = 47.9732%  R  = 35.0854% 
angle = 44°  L  = 47.3283%  R  = 34.0452% 
angle = 45°  L  = 46.669%  R  = 33% 
angle = 46°  L  = 45.9955%  R  = 31.9512% 
angle = 47°  L  = 45.308%  R  = 30.9% 
angle = 48°  L  = 44.6067%  R  = 29.8477% 
angle = 49°  L  = 43.8918%  R  = 28.7956% 
angle = 50°  L  = 43.1635%  R  = 27.745% 
angle = 51°  L  = 42.4221%  R  = 26.6971% 
angle = 52°  L  = 41.6678%  R  = 25.6532% 
angle = 53°  L  = 40.9007%  R  = 24.6147% 
angle = 54°  L  = 40.1212%  R  = 23.5827% 
angle = 55°  L  = 39.3295%  R  = 22.5585% 
angle = 56°  L  = 38.5258%  R  = 21.5434% 
angle = 57°  L  = 37.7104%  R  = 20.5385% 
angle = 58°  L  = 36.8834%  R  = 19.5452% 
angle = 59°  L  = 36.0453%  R  = 18.5647% 
angle = 60°  L  = 35.1962%  R  = 17.5981% 
angle = 61°  L  = 34.3363%  R  = 16.6466% 
angle = 62°  L  = 33.466%  R  = 15.7113% 
angle = 63°  L  = 32.5855%  R  = 14.7935% 
angle = 64°  L  = 31.695%  R  = 13.8942% 
angle = 65°  L  = 30.7949%  R  = 13.0145% 
angle = 66°  L  = 29.8855%  R  = 12.1555% 
angle = 67°  L  = 28.9669%  R  = 11.3183% 
angle = 68°  L  = 28.0395%  R  = 10.5038% 
angle = 69°  L  = 27.1036%  R  = 9.71305% 
angle = 70°  L  = 26.1594%  R  = 8.94703% 
angle = 71°  L  = 25.2072%  R  = 8.20666% 
angle = 72°  L  = 24.2474%  R  = 7.49285% 
angle = 73°  L  = 23.2801%  R  = 6.80645% 
angle = 74°  L  = 22.3058%  R  = 6.14831% 
angle = 75°  L  = 21.3247%  R  = 5.51924% 
angle = 76°  L  = 20.3371%  R  = 4.91999% 
angle = 77°  L  = 19.3433%  R  = 4.35129% 
angle = 78°  L  = 18.3436%  R  = 3.81385% 
angle = 79°  L  = 17.3383%  R  = 3.3083% 
angle = 80°  L  = 16.3277%  R  = 2.83528% 
angle = 81°  L  = 15.3122%  R  = 2.39536% 
angle = 82°  L  = 14.292%  R  = 1.98906% 
angle = 83°  L  = 13.2674%  R  = 1.61689% 
angle = 84°  L  = 12.2388%  R  = 1.27931% 
angle = 85°  L  = 11.2065%  R  = 0.976712% 
angle = 86°  L  = 10.1708%  R  = 0.709477% 
angle = 87°  L  = 9.13193%  R  = 0.477928% 
angle = 88°  L  = 8.09031%  R  = 0.282348% 
angle = 89°  L  = 7.04623%  R  = 0.122974% 
angle = 90°  L  = 6%  R  = 3.67382e-16% 
angle = 91°  L  = -7.04623%  R  = -0.122974% 
angle = 92°  L  = -8.09031%  R  = -0.282348% 
angle = 93°  L  = -9.13193%  R  = -0.477928% 
angle = 94°  L  = -10.1708%  R  = -0.709477% 
angle = 95°  L  = -11.2065%  R  = -0.976712% 
angle = 96°  L  = -12.2388%  R  = -1.27931% 
angle = 97°  L  = -13.2674%  R  = -1.61689% 
angle = 98°  L  = -14.292%  R  = -1.98906% 
angle = 99°  L  = -15.3122%  R  = -2.39536% 
angle = 100°  L  = -16.3277%  R  = -2.83528% 
angle = 101°  L  = -17.3383%  R  = -3.3083% 
angle = 102°  L  = -18.3436%  R  = -3.81385% 
angle = 103°  L  = -19.3433%  R  = -4.35129% 
angle = 104°  L  = -20.3371%  R  = -4.91999% 
angle = 105°  L  = -21.3247%  R  = -5.51924% 
angle = 106°  L  = -22.3058%  R  = -6.14831% 
angle = 107°  L  = -23.2801%  R  = -6.80645% 
angle = 108°  L  = -24.2474%  R  = -7.49285% 
angle = 109°  L  = -25.2072%  R  = -8.20666% 
angle = 110°  L  = -26.1594%  R  = -8.94703% 
angle = 111°  L  = -27.1036%  R  = -9.71305% 
angle = 112°  L  = -28.0395%  R  = -10.5038% 
angle = 113°  L  = -28.9669%  R  = -11.3183% 
angle = 114°  L  = -29.8855%  R  = -12.1555% 
angle = 115°  L  = -30.7949%  R  = -13.0145% 
angle = 116°  L  = -31.695%  R  = -13.8942% 
angle = 117°  L  = -32.5855%  R  = -14.7935% 
angle = 118°  L  = -33.466%  R  = -15.7113% 
angle = 119°  L  = -34.3363%  R  = -16.6466% 
angle = 120°  L  = -35.1962%  R  = -17.5981% 
angle = 121°  L  = -36.0453%  R  = -18.5647% 
angle = 122°  L  = -36.8834%  R  = -19.5452% 
angle = 123°  L  = -37.7104%  R  = -20.5385% 
angle = 124°  L  = -38.5258%  R  = -21.5434% 
angle = 125°  L  = -39.3295%  R  = -22.5585% 
angle = 126°  L  = -40.1212%  R  = -23.5827% 
angle = 127°  L  = -40.9007%  R  = -24.6147% 
angle = 128°  L  = -41.6678%  R  = -25.6532% 
angle = 129°  L  = -42.4221%  R  = -26.6971% 
angle = 130°  L  = -43.1635%  R  = -27.745% 
angle = 131°  L  = -43.8918%  R  = -28.7956% 
angle = 132°  L  = -44.6067%  R  = -29.8477% 
angle = 133°  L  = -45.308%  R  = -30.9% 
angle = 134°  L  = -45.9955%  R  = -31.9512% 
angle = 135°  L  = -46.669%  R  = -33% 
angle = 136°  L  = -47.3283%  R  = -34.0452% 
angle = 137°  L  = -47.9732%  R  = -35.0854% 
angle = 138°  L  = -48.6035%  R  = -36.1194% 
angle = 139°  L  = -49.2189%  R  = -37.146% 
angle = 140°  L  = -49.8194%  R  = -38.1639% 
angle = 141°  L  = -50.4047%  R  = -39.1718% 
angle = 142°  L  = -50.9746%  R  = -40.1685% 
angle = 143°  L  = -51.529%  R  = -41.1529% 
angle = 144°  L  = -52.0677%  R  = -42.1237% 
angle = 145°  L  = -52.5906%  R  = -43.0797% 
angle = 146°  L  = -53.0974%  R  = -44.0197% 
angle = 147°  L  = -53.5881%  R  = -44.9427% 
angle = 148°  L  = -54.0624%  R  = -45.8475% 
angle = 149°  L  = -54.5203%  R  = -46.733% 
angle = 150°  L  = -54.9615%  R  = -47.5981% 
angle = 151°  L  = -55.386%  R  = -48.4417% 
angle = 152°  L  = -55.7937%  R  = -49.2629% 
angle = 153°  L  = -56.1843%  R  = -50.0606% 
angle = 154°  L  = -56.5579%  R  = -50.8339% 
angle = 155°  L  = -56.9142%  R  = -51.5818% 
angle = 156°  L  = -57.2531%  R  = -52.3034% 
angle = 157°  L  = -57.5747%  R  = -52.9978% 
angle = 158°  L  = -57.8787%  R  = -53.6642% 
angle = 159°  L  = -58.165%  R  = -54.3017% 
angle = 160°  L  = -58.4337%  R  = -54.9097% 
angle = 161°  L  = -58.6845%  R  = -55.4873% 
angle = 162°  L  = -58.9175%  R  = -56.0339% 
angle = 163°  L  = -59.1325%  R  = -56.5487% 
angle = 164°  L  = -59.3295%  R  = -57.0312% 
angle = 165°  L  = -59.5085%  R  = -57.4808% 
angle = 166°  L  = -59.6693%  R  = -57.8968% 
angle = 167°  L  = -59.8119%  R  = -58.2789% 
angle = 168°  L  = -59.9363%  R  = -58.6266% 
angle = 169°  L  = -60.0425%  R  = -58.9393% 
angle = 170°  L  = -60.1304%  R  = -59.2168% 
angle = 171°  L  = -60.1999%  R  = -59.4587% 
angle = 172°  L  = -60.2511%  R  = -59.6648% 
angle = 173°  L  = -60.284%  R  = -59.8346% 
angle = 174°  L  = -60.2985%  R  = -59.9682% 
angle = 175°  L  = -60.2946%  R  = -60.0652% 
angle = 176°  L  = -60.2724%  R  = -60.1256% 
angle = 177°  L  = -60.2318%  R  = -60.1492% 
angle = 178°  L  = -60.1728%  R  = -60.1362% 
angle = 179°  L  = -60.0956%  R  = -60.0864% 
angle = 180°  L  = -60%  R  = -60% 
angle = 181°  L  = -60.0864%  R  = -60.0956% 
angle = 182°  L  = -60.1362%  R  = -60.1728% 
angle = 183°  L  = -60.1492%  R  = -60.2318% 
angle = 184°  L  = -60.1256%  R  = -60.2724% 
angle = 185°  L  = -60.0652%  R  = -60.2946% 
angle = 186°  L  = -59.9682%  R  = -60.2985% 
angle = 187°  L  = -59.8346%  R  = -60.284% 
angle = 188°  L  = -59.6648%  R  = -60.2511% 
angle = 189°  L  = -59.4587%  R  = -60.1999% 
angle = 190°  L  = -59.2168%  R  = -60.1304% 
angle = 191°  L  = -58.9393%  R  = -60.0425% 
angle = 192°  L  = -58.6266%  R  = -59.9363% 
angle = 193°  L  = -58.2789%  R  = -59.8119% 
angle = 194°  L  = -57.8968%  R  = -59.6693% 
angle = 195°  L  = -57.4808%  R  = -59.5085% 
angle = 196°  L  = -57.0312%  R  = -59.3295% 
angle = 197°  L  = -56.5487%  R  = -59.1325% 
angle = 198°  L  = -56.0339%  R  = -58.9175% 
angle = 199°  L  = -55.4873%  R  = -58.6845% 
angle = 200°  L  = -54.9097%  R  = -58.4337% 
angle = 201°  L  = -54.3017%  R  = -58.165% 
angle = 202°  L  = -53.6642%  R  = -57.8787% 
angle = 203°  L  = -52.9978%  R  = -57.5747% 
angle = 204°  L  = -52.3034%  R  = -57.2531% 
angle = 205°  L  = -51.5818%  R  = -56.9142% 
angle = 206°  L  = -50.8339%  R  = -56.5579% 
angle = 207°  L  = -50.0606%  R  = -56.1843% 
angle = 208°  L  = -49.2629%  R  = -55.7937% 
angle = 209°  L  = -48.4417%  R  = -55.386% 
angle = 210°  L  = -47.5981%  R  = -54.9615% 
angle = 211°  L  = -46.733%  R  = -54.5203% 
angle = 212°  L  = -45.8475%  R  = -54.0624% 
angle = 213°  L  = -44.9427%  R  = -53.5881% 
angle = 214°  L  = -44.0197%  R  = -53.0974% 
angle = 215°  L  = -43.0797%  R  = -52.5906% 
angle = 216°  L  = -42.1237%  R  = -52.0677% 
angle = 217°  L  = -41.1529%  R  = -51.529% 
angle = 218°  L  = -40.1685%  R  = -50.9746% 
angle = 219°  L  = -39.1718%  R  = -50.4047% 
angle = 220°  L  = -38.1639%  R  = -49.8194% 
angle = 221°  L  = -37.146%  R  = -49.2189% 
angle = 222°  L  = -36.1194%  R  = -48.6035% 
angle = 223°  L  = -35.0854%  R  = -47.9732% 
angle = 224°  L  = -34.0452%  R  = -47.3283% 
angle = 225°  L  = -33%  R  = -46.669% 
angle = 226°  L  = -31.9512%  R  = -45.9955% 
angle = 227°  L  = -30.9%  R  = -45.308% 
angle = 228°  L  = -29.8477%  R  = -44.6067% 
angle = 229°  L  = -28.7956%  R  = -43.8918% 
angle = 230°  L  = -27.745%  R  = -43.1635% 
angle = 231°  L  = -26.6971%  R  = -42.4221% 
angle = 232°  L  = -25.6532%  R  = -41.6678% 
angle = 233°  L  = -24.6147%  R  = -40.9007% 
angle = 234°  L  = -23.5827%  R  = -40.1212% 
angle = 235°  L  = -22.5585%  R  = -39.3295% 
angle = 236°  L  = -21.5434%  R  = -38.5258% 
angle = 237°  L  = -20.5385%  R  = -37.7104% 
angle = 238°  L  = -19.5452%  R  = -36.8834% 
angle = 239°  L  = -18.5647%  R  = -36.0453% 
angle = 240°  L  = -17.5981%  R  = -35.1962% 
angle = 241°  L  = -16.6466%  R  = -34.3363% 
angle = 242°  L  = -15.7113%  R  = -33.466% 
angle = 243°  L  = -14.7935%  R  = -32.5855% 
angle = 244°  L  = -13.8942%  R  = -31.695% 
angle = 245°  L  = -13.0145%  R  = -30.7949% 
angle = 246°  L  = -12.1555%  R  = -29.8855% 
angle = 247°  L  = -11.3183%  R  = -28.9669% 
angle = 248°  L  = -10.5038%  R  = -28.0395% 
angle = 249°  L  = -9.71305%  R  = -27.1036% 
angle = 250°  L  = -8.94703%  R  = -26.1594% 
angle = 251°  L  = -8.20666%  R  = -25.2072% 
angle = 252°  L  = -7.49285%  R  = -24.2474% 
angle = 253°  L  = -6.80645%  R  = -23.2801% 
angle = 254°  L  = -6.14831%  R  = -22.3058% 
angle = 255°  L  = -5.51924%  R  = -21.3247% 
angle = 256°  L  = -4.91999%  R  = -20.3371% 
angle = 257°  L  = -4.35129%  R  = -19.3433% 
angle = 258°  L  = -3.81385%  R  = -18.3436% 
angle = 259°  L  = -3.3083%  R  = -17.3383% 
angle = 260°  L  = -2.83528%  R  = -16.3277% 
angle = 261°  L  = -2.39536%  R  = -15.3122% 
angle = 262°  L  = -1.98906%  R  = -14.292% 
angle = 263°  L  = -1.61689%  R  = -13.2674% 
angle = 264°  L  = -1.27931%  R  = -12.2388% 
angle = 265°  L  = -0.976712%  R  = -11.2065% 
angle = 266°  L  = -0.709477%  R  = -10.1708% 
angle = 267°  L  = -0.477928%  R  = -9.13193% 
angle = 268°  L  = -0.282348%  R  = -8.09031% 
angle = 269°  L  = -0.122974%  R  = -7.04623% 
angle = 270°  L  = -1.10215e-15%  R  = -6% 
angle = 271°  L  = 0.122974%  R  = 7.04623% 
angle = 272°  L  = 0.282348%  R  = 8.09031% 
angle = 273°  L  = 0.477928%  R  = 9.13193% 
angle = 274°  L  = 0.709477%  R  = 10.1708% 
angle = 275°  L  = 0.976712%  R  = 11.2065% 
angle = 276°  L  = 1.27931%  R  = 12.2388% 
angle = 277°  L  = 1.61689%  R  = 13.2674% 
angle = 278°  L  = 1.98906%  R  = 14.292% 
angle = 279°  L  = 2.39536%  R  = 15.3122% 
angle = 280°  L  = 2.83528%  R  = 16.3277% 
angle = 281°  L  = 3.3083%  R  = 17.3383% 
angle = 282°  L  = 3.81385%  R  = 18.3436% 
angle = 283°  L  = 4.35129%  R  = 19.3433% 
angle = 284°  L  = 4.91999%  R  = 20.3371% 
angle = 285°  L  = 5.51924%  R  = 21.3247% 
angle = 286°  L  = 6.14831%  R  = 22.3058% 
angle = 287°  L  = 6.80645%  R  = 23.2801% 
angle = 288°  L  = 7.49285%  R  = 24.2474% 
angle = 289°  L  = 8.20666%  R  = 25.2072% 
angle = 290°  L  = 8.94703%  R  = 26.1594% 
angle = 291°  L  = 9.71305%  R  = 27.1036% 
angle = 292°  L  = 10.5038%  R  = 28.0395% 
angle = 293°  L  = 11.3183%  R  = 28.9669% 
angle = 294°  L  = 12.1555%  R  = 29.8855% 
angle = 295°  L  = 13.0145%  R  = 30.7949% 
angle = 296°  L  = 13.8942%  R  = 31.695% 
angle = 297°  L  = 14.7935%  R  = 32.5855% 
angle = 298°  L  = 15.7113%  R  = 33.466% 
angle = 299°  L  = 16.6466%  R  = 34.3363% 
angle = 300°  L  = 17.5981%  R  = 35.1962% 
angle = 301°  L  = 18.5647%  R  = 36.0453% 
angle = 302°  L  = 19.5452%  R  = 36.8834% 
angle = 303°  L  = 20.5385%  R  = 37.7104% 
angle = 304°  L  = 21.5434%  R  = 38.5258% 
angle = 305°  L  = 22.5585%  R  = 39.3295% 
angle = 306°  L  = 23.5827%  R  = 40.1212% 
angle = 307°  L  = 24.6147%  R  = 40.9007% 
angle = 308°  L  = 25.6532%  R  = 41.6678% 
angle = 309°  L  = 26.6971%  R  = 42.4221% 
angle = 310°  L  = 27.745%  R  = 43.1635% 
angle = 311°  L  = 28.7956%  R  = 43.8918% 
angle = 312°  L  = 29.8477%  R  = 44.6067% 
angle = 313°  L  = 30.9%  R  = 45.308% 
angle = 314°  L  = 31.9512%  R  = 45.9955% 
angle = 315°  L  = 33%  R  = 46.669% 
angle = 316°  L  = 34.0452%  R  = 47.3283% 
angle = 317°  L  = 35.0854%  R  = 47.9732% 
angle = 318°  L  = 36.1194%  R  = 48.6035% 
angle = 319°  L  = 37.146%  R  = 49.2189% 
angle = 320°  L  = 38.1639%  R  = 49.8194% 
angle = 321°  L  = 39.1718%  R  = 50.4047% 
angle = 322°  L  = 40.1685%  R  = 50.9746% 
angle = 323°  L  = 41.1529%  R  = 51.529% 
angle = 324°  L  = 42.1237%  R  = 52.0677% 
angle = 325°  L  = 43.0797%  R  = 52.5906% 
angle = 326°  L  = 44.0197%  R  = 53.0974% 
angle = 327°  L  = 44.9427%  R  = 53.5881% 
angle = 328°  L  = 45.8475%  R  = 54.0624% 
angle = 329°  L  = 46.733%  R  = 54.5203% 
angle = 330°  L  = 47.5981%  R  = 54.9615% 
angle = 331°  L  = 48.4417%  R  = 55.386% 
angle = 332°  L  = 49.2629%  R  = 55.7937% 
angle = 333°  L  = 50.0606%  R  = 56.1843% 
angle = 334°  L  = 50.8339%  R  = 56.5579% 
angle = 335°  L  = 51.5818%  R  = 56.9142% 
angle = 336°  L  = 52.3034%  R  = 57.2531% 
angle = 337°  L  = 52.9978%  R  = 57.5747% 
angle = 338°  L  = 53.6642%  R  = 57.8787% 
angle = 339°  L  = 54.3017%  R  = 58.165% 
angle = 340°  L  = 54.9097%  R  = 58.4337% 
angle = 341°  L  = 55.4873%  R  = 58.6845% 
angle = 342°  L  = 56.0339%  R  = 58.9175% 
angle = 343°  L  = 56.5487%  R  = 59.1325% 
angle = 344°  L  = 57.0312%  R  = 59.3295% 
angle = 345°  L  = 57.4808%  R  = 59.5085% 
angle = 346°  L  = 57.8968%  R  = 59.6693% 
angle = 347°  L  = 58.2789%  R  = 59.8119% 
angle = 348°  L  = 58.6266%  R  = 59.9363% 
angle = 349°  L  = 58.9393%  R  = 60.0425% 
angle = 350°  L  = 59.2168%  R  = 60.1304% 
angle = 351°  L  = 59.4587%  R  = 60.1999% 
angle = 352°  L  = 59.6648%  R  = 60.2511% 
angle = 353°  L  = 59.8346%  R  = 60.284% 
angle = 354°  L  = 59.9682%  R  = 60.2985% 
angle = 355°  L  = 60.0652%  R  = 60.2946% 
angle = 356°  L  = 60.1256%  R  = 60.2724% 
angle = 357°  L  = 60.1492%  R  = 60.2318% 
angle = 358°  L  = 60.1362%  R  = 60.1728% 
angle = 359°  L  = 60.0864%  R  = 60.0956% 
angle = 0°  L  = 60%  R  = 60% 

#3 2016-10-06 00:16:47

NoName
Customer
Из Київ
Зарегистрирован: 2014-07-08
Сообщений: 1,404

Re: Homemade arduino boat

пока не собрал железо,
до выходных пауза

"Я только начинаю изучать возможности и способы программирования ардуино, поэтому вопрос соответствующего уровня." (c)Bart

посмотрите плс,
исходники  на удаление, простой набросок ,  буду править на выходных
пока же прошу спецов посмотреть, и если "накосячил" - сообщите плс,

/*
 * // file name wifi_car.ino
 * ----------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 00):
 * <devgate.info эт gmail.com> wrote this file.  As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it, you can buy me a beer or device ( arduino-ua.com ) in return.   
 * Chingiz Sunlucid 
 * ----------------------------------------------------------------------------
 *  Date create: 2016.10.01   only example  
 *  Date change: 2016.10.xx 
 * ----------------------------------------------------------------------------
 source https://habrahabr.ru/post/131931/
 source http://playground.arduino.cc/ComponentLib/Servo

 external source
 JSON
 Copyright Benoit Blanchon 2014-2016
 MIT License
 Arduino JSON library
 JSON source example 
 https://github.com/bblanchon/ArduinoJson

 
 */
// example for boat
// 4 PWM 
 
// ARDUINO PIN  CONFIG
// for example
// Arduino leonardo

/*
Input and Output

Each of the 20 digital i/o pins on the Leonardo can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms. In addition, some pins have specialized functions:

Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data using the ATmega32U4 hardware serial capability. Note that on the Leonardo, the Serial class refers to USB (CDC) communication; for TTL serial on pins 0 and 1, use the Serial1 class.
TWI: 2 (SDA) and 3 (SCL). Support TWI communication using the Wire library.
External Interrupts: 3 (interrupt 0), 2 (interrupt 1), 0 (interrupt 2), 1 (interrupt 3) and 7 (interrupt 4). These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
PWM: 3, 5, 6, 9, 10, 11, and 13. Provide 8-bit PWM output with the analogWrite() function.
SPI: on the ICSP header. These pins support SPI communication using the SPI library. Note that the SPI pins are not connected to any of the digital I/O pins as they are on the Uno, They are only available on the ICSP connector. This means that if you have a shield that uses SPI, but does NOT have a 6-pin ICSP connector that connects to the Leonardo's 6-pin ICSP header, the shield will not work.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.
Analog Inputs: A0-A5, A6 - A11 (on digital pins 4, 6, 8, 9, 10, and 12). The Leonardo has 12 analog inputs, labeled A0 through A11, all of which can also be used as digital i/o. Pins A0-A5 appear in the same locations as on the Uno; inputs A6-A11 are on digital i/o pins 4, 6, 8, 9, 10, and 12 respectively. Each analog input provide 10 bits of resolution (i.e. 1024 different values). By default the analog inputs measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function.
There are a couple of other pins on the board:

AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.
*/


#define BIT(x)        (1 << (x))
#define CHECKBIT(x,b)   (x&(b))
#define SETBIT(x,b)     x|=(b)
#define CLEARBIT(x,b)   x&=~(b)
#define TOGGLEBIT(x,b)  x^=(b)
#define count_element_array(x)  sizeof(x)/sizeof(x[0])

#include "easy_boat_mtwin.h"

#define DEBUG
#define max_length 200

#include <ArduinoJson.h>

//--------------------------------------------------
typedef enum {
tp_no_decode  = 0,   
tp_joy1  = 1,   
tp_joy2  = 2,   
tp_PWM8  = 3,   
} TE_DECODE_DATA;
//--------------------------------------------------
typedef enum {
  st_wait_start_json  = 0,   
  st_load_data        = 1,   
  st_decode_data      = 2,   
} TE_STATUS;
//--------------------------------------------------
 char   json_data[max_length];
//--------------------------------------------------
 typedef struct {
  unsigned char   buff_position;
  TE_STATUS       STATUS;
 } td_json;
//--------------------------------------------------

typedef struct {
  unsigned short  pwm[8];
} td_motor;

typedef struct {
   int xy_begin[2];
   int xy_end[2];
} td_joy;


typedef struct {
  float  angle;
  float  len;
} td_vector;


typedef struct {
   int data[8];
} td_in_pwm;


typedef union {
 td_joy      joy;
 td_in_pwm   in_pwm;
} td_out_data;

//--------------------------------------------------
//  name     : global memory  
//  provide  :
td_json JSON;
td_vector vector;
td_out_data out_data;
 
TD_BOAT_Input       dev_Input;
// TD_BOAT_CORRECTION DEV_BOAT_CORRECTIONl
//--------------------------------------------------
//  name     : function  
float           vector_length_decode    (  td_joy *data );
void            print_debug_info        (  String data );
TE_DECODE_DATA  func_decode_JSON        (  td_out_data *out_data  );
void            unlock_JSON             (  void  );
//-------------------------------------------------- 
 easy_boat_mtwin boat( 5, 6,  10, 11 );
//--------------------------------------------------
//  name     : setup 
//  in       : none 
//  out      : none 
//  provide  : configure system
//-------------------------------------------------- 
void setup() 
{

 int foo;
 // init serial port
 Serial.begin(9600);

 boat.begin ();
}

//--------------------------------------------------
//  name     :  add_new_char_to_buff
//  in       : uint8_t   data from uart  
//  out      : none, load to global buffer 
//  provide  : add uart char for input buffer 
//-------------------------------------------------- 
void add_new_char_to_buff ( char data )
{
        json_data[JSON.buff_position] = data;
        JSON.buff_position++;
}

//--------------------------------------------------
//  name     : serialEvent
//  in       : none 
//  out      : none
//  provide  : arduino interrupt RX event
//-------------------------------------------------- 
void serialEvent() {
  char    inChar;
  while ( Serial.available() ) 
  {

    inChar = (char)Serial.read();

    // else wait decode incamminf message
    if ( JSON.STATUS != st_decode_data )
    switch ( inChar )
    {
      case '{':
      JSON.buff_position  = 0;
      JSON.STATUS         = st_load_data;
      print_debug_info("load data"); 
      add_new_char_to_buff ('{');
      break;

      default:
      #ifdef DEBUG
      Serial.print( inChar );
      #endif
 
      if ( JSON.buff_position >= max_length ) 
      { JSON.STATUS == st_wait_start_json; }
      
      if ( JSON.STATUS == st_load_data )
      {  add_new_char_to_buff (inChar); }
      break;
      
      case '}':
      add_new_char_to_buff ('}');
      print_debug_info("decode data"); 
      JSON.STATUS = st_decode_data;
      break;
    }
   }
}



  
//--------------------------------------------------
//  name     : loop
//  in       : none 
//  out      : none
//  provide  : system supercycle
//-------------------------------------------------- 
void loop() 
{
 int ret_decode = 0;
 int len_data = 0;
 int angle_data;

 
 if ( JSON.STATUS == st_decode_data )
  { 
    ret_decode = func_decode_JSON( &out_data );
    //-------------------------------------
    switch ( ret_decode )
    {
     case tp_joy1:
     dev_Input.power =  vector_length_decode ( &out_data.joy );
     Serial.print ( "len = " );
     Serial.println( dev_Input.power );

     dev_Input.degrees =  vector_angle_decode ( &out_data.joy );
     Serial.print ( "angle = " );
     Serial.println( dev_Input.degrees );

     break;
     default: break; 
    }
    unlock_JSON();
  }


 // no boat.update ();
 
}

float vector_length_decode (  td_joy *data )
{
 float dx,dy;
 float ret; 

 //  example source 
 //  joy.xy_begin [0]   = root["FX"];
 //  joy.xy_begin [1]   = root["FY"];
 //  joy.xy_end [0]     = root["x"];
 //  joy.xy_end [1]     = root["y"];
 //  |P — E| = |(3, 3) — (1, 2)| = |(2, 1)| = sqrt(2^2+1^2) = sqrt(5) = 2.23

 dx = data->xy_begin[0] - data->xy_end[0]; 
 dy = data->xy_begin[1] - data->xy_end[1];
 
 dx = fabs ( dx );
 dy = fabs ( dy );

 // float data / core 8bit /  need change  
 ret = sqrt ( dx*dx + dy*dy );
 return ( ret );
}  



void normalize_vector  (  float *px, float *py  )
{
 float ret; 
 float x; 
 float y; 
 
 x  = *px;
 y  = *py;
 
 // D' = D / |D| = (1, 1) / sqrt ( 1^2 + 1^2 ) = ( 1, 1 ) / sqrt(2) = (0.71, 0.71)
 
 ret = sqrt ( x*x + y*y );
 *px = x/ret;
 *py = y/ret;
}


float vector_angle_decode (  td_joy *data )
{
 float dx,dy;
 float ret; 
 float x1,x2,y1,y2;
 float ab;
int segmet_angle = 0;
 
 //  example source 
 //  joy.xy_begin [0]   = root["FX"];
 //  joy.xy_begin [1]   = root["FY"];
 //  joy.xy_end [0]     = root["x"];
 //  joy.xy_end [1]     = root["y"];

 // D' = D / |D| = (1, 1) / sqrt ( 1^2 + 1^2 ) = ( 1, 1 ) / sqrt(2) = (0.71, 0.71)
 // V' = V / |V| = (2, -1) / sqrt( 2^2 + (-1)^2) = (2,-1) / sqrt(5) = (0.89, -0.45)
 // Θ = acos(D'V') = acos(0.71*0.89 + 0.71*(-0.45)) = acos(0.31) = 72

 // D'(dev) = D / |D| = (1, 1) / sqrt ( 1^2 + 1^2 ) = ( 1, 1 ) / sqrt(2) = (0.71, 0 )
 // V' = V / |V| = (2, -1) / sqrt( 2^2 + (-1)^2) = (2,-1) / sqrt(5) = (0.89, -0.45)
// V' = V / |V| = (dx, dy) / sqrt( dx^2 + (dy)^2) = (dx,dy) / sqrt(dz) = (vx, vy)


// for static system

x1 = data->xy_begin[0];
y1 = data->xy_begin[1];

x2 = data->xy_end[0];
y2 = data->xy_end[1];

x2 = x2 - x1;
y2 = y2 - y1;

x1 = 0; 
y1 = y2; 


     if ((x2 >= 0)&&( y2 >= 0))  segmet_angle = 0;
else if ((x2 >= 0)&&( y2 < 0))   segmet_angle = 1;
else if ((x2  < 0)&&( y2 < 0))   segmet_angle = 2;
else if ((x2  < 0)&&( y2 >= 0))  segmet_angle = 3;


normalize_vector (&x1,&y1);
normalize_vector (&x2,&y2);

ret = fabs(x1*x2) + fabs(y1*y2);
ret = acos (ret);
Serial.print ( "acos = " );  Serial.println( ret );
ret = ret*180.0/3.1415;
Serial.print ( "rawangl = " );  Serial.println( ret );
ret += segmet_angle*90;
Serial.print ( "angl = " );  Serial.println( ret );
 
 return ( ret );
}  


//--------------------------------------------------
//  name     : print_debug_info
//  in       : String 
//  out      : none
//  provide  : print debug message
//-------------------------------------------------- 
void print_debug_info (  String data )
{
 #ifdef DEBUG 
 Serial.println(data);
 #endif
}


//-------------------------------------------------
//  name     : decode JSON
//  in       : none / use global memory 
//  out      : type decode
//  provide  : decode input stream 
//-------------------------------------------------- 
TE_DECODE_DATA  func_decode_JSON (  td_out_data *out_data  )
{
   TE_DECODE_DATA ret;
   int foo;
   float len_data;

   print_debug_info ("exe decode data");
   StaticJsonBuffer<200> jsonBuffer;
   JsonObject& root = jsonBuffer.parseObject(json_data);

 if (root.success()) 
 {
  #ifdef DEBUG
  print_debug_info ("exe success");
  for ( foo =0; foo < JSON.buff_position; foo++ )
  Serial.print(json_data[foo]);
  Serial.println (">>");
  #endif

 int  ret_data; 
 ret_data = root["tp"];
 // ret = root["tp"];
 ret =  ret_data;

 switch (ret_data)
 {
  case tp_joy1:   
  case tp_joy2:   
   out_data->joy.xy_begin  [0]      = root["FX"];
   out_data->joy.xy_begin  [1]      = root["FY"];
   out_data->joy.xy_end    [0]      = root["x"];
   out_data->joy.xy_end    [1]      = root["y"];

  #ifdef DEBUG
   Serial.println(out_data->joy.xy_begin [0] );
   Serial.println(out_data->joy.xy_begin [1] );
   Serial.println(out_data->joy.xy_end   [0] );
   Serial.println(out_data->joy.xy_end   [1] );
  #endif
  
  break;
 
  default:
  ret = tp_no_decode;
  break;
 }
 } else  print_debug_info ("exe fail");

  return ( ret );
}

//--------------------------------------------------
//  name     : unlock_JSON
//  in       : none
//  out      : none
//  provide  : print debug message
//-------------------------------------------------- 
void unlock_JSON ( void )
{
  JSON.STATUS = st_wait_start_json;
}
/*
 * file easy_boat_mtwin.cpp
 * Date create: 2016.10.05 
 * Date change: 2016.10.xx 
 * example arduino library 
 * ----------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 00):
 * <devgate.info эт gmail.com> wrote this file.  As long as you retain this notice you
 * can do whatever you want with this stuff. If we meet some day, and you think
 * this stuff is worth it, you can buy me a beer or device ( arduino-ua.com ) in return.   
 * Chingiz Sunlucid 
 *
 * ----------------------------------------------------------------------------
 source https://github.com/platisd/AndroidCar/blob/master/Car.cpp
 
 motor enabled allway  
 
 */

 #include "easy_boat_mtwin.h"

 // 8 bit PWM
#define MAX_RESOLUTION_PWM  0xFF
// 16 bit PWM
// #define MAX_RESOLUTION_PWM  0xFFFF
 
const unsigned short easy_boat_mtwin::DEFAULT_MOTOR1_PLUS_PIN = 5;
const unsigned short easy_boat_mtwin::DEFAULT_MOTOR1_MINUS_PIN = 6;

const unsigned short easy_boat_mtwin::DEFAULT_MOTOR2_PLUS_PIN = 9;
const unsigned short easy_boat_mtwin::DEFAULT_MOTOR2_MINUS_PIN = 10;

long easy_boat_mtwin::get_value_from_percent (  long percent,  long  max_value )
{
  long  ret;
  // max_value - 100 %
  //  x      percent
  ret = ( long)(( long)max_value*( long)percent)/( long)100;
  return  (ret);
}

easy_boat_mtwin::easy_boat_mtwin( 
				unsigned short Motor_Left_plus_Pin, 
				unsigned short Motor_Left_minus_Pin, 
				unsigned short Motor_Rigth_plus_Pin, 
				unsigned short Motor_Rigth_minus_Pin) 
{
	
_Motor_Left_plus_Pin   = _Motor_Left_plus_Pin;    
_Motor_Left_minus_Pin  = _Motor_Left_minus_Pin;
_Motor_Rigth_plus_Pin  = _Motor_Rigth_plus_Pin;
_Motor_Rigth_minus_Pin = _Motor_Rigth_minus_Pin;  

   pinMode  ( _Motor_Left_plus_Pin   , OUTPUT);  
   pinMode  ( _Motor_Left_minus_Pin  , OUTPUT);  
   pinMode  ( _Motor_Rigth_plus_Pin  , OUTPUT);  
   pinMode  ( _Motor_Rigth_minus_Pin , OUTPUT);  

}

//-------------------------------------------------
void easy_boat_mtwin::set_axis( TD_AXIS *AXIS )
{
 _AXIS.X = AXIS->X;
 _AXIS.Y = AXIS->Y;
 _AXIS.Z = AXIS->Z;
}
//-------------------------------------------------
void easy_boat_mtwin::set_new_vector  ( TD_BOAT_Input  *IN_DATA, TD_BOAT_CORRECTION *CORRECT  )
{
int   angle;
float power;
float max_power_horizont ;
float delta_cos;

// float _BOAT_OUTPUT.left_motor_power;
// float _BOAT_OUTPUT.rigth_motor_power;

	if ( CORRECT != NULL )
	{
		_BOAT_CORRECTION.left_motor_correction  = CORRECT->left_motor_correction;
		_BOAT_CORRECTION.rigth_motor_correction = CORRECT->rigth_motor_correction ;
    }

	angle = IN_DATA->degrees;
	power = IN_DATA->power;
	delta_cos =  cos ( angle*M_PI/180 );

	max_power_horizont = fabs ( sin ( angle*M_PI/180 ));
	max_power_horizont *= power*0.1;
	
	power *= fabs (cos( angle*M_PI/180 ));
	power += max_power_horizont;

	if ( angle <= 90 )
	{
		_BOAT_OUTPUT.left_motor_power  =  power;
		_BOAT_OUTPUT.rigth_motor_power =  power*delta_cos;
	}
	else if ( angle <= 180 )
	{
		_BOAT_OUTPUT.left_motor_power  =  -power;
		_BOAT_OUTPUT.rigth_motor_power =  power*delta_cos;
	}
	else if ( angle <= 270 )
	{
		_BOAT_OUTPUT.left_motor_power  =  power*delta_cos;
		_BOAT_OUTPUT.rigth_motor_power =  -power;
	}
	else
	{
		_BOAT_OUTPUT.left_motor_power  =  power*delta_cos;
		_BOAT_OUTPUT.rigth_motor_power =  power;
	}

		_BOAT_OUTPUT.left_motor_power  *= _BOAT_CORRECTION.left_motor_correction;
		_BOAT_OUTPUT.rigth_motor_power *= _BOAT_CORRECTION.rigth_motor_correction;

		// no timer update 
	if ( _BOAT_OUTPUT.left_motor_power < 0 )
	 {
	 	  analogWrite ( _Motor_Left_plus_Pin,  0  );
	 	  analogWrite ( _Motor_Left_minus_Pin,  _BOAT_OUTPUT.left_motor_power );
	 }
	 else 
	 {
	 	  analogWrite ( _Motor_Left_minus_Pin,  0  );
	 	  analogWrite ( _Motor_Left_plus_Pin,  _BOAT_OUTPUT.left_motor_power );
	 }
	 
	if ( _BOAT_OUTPUT.rigth_motor_power < 0 )
	 {
	 	  analogWrite ( _Motor_Rigth_plus_Pin,  0  );
	 	  analogWrite ( _Motor_Rigth_minus_Pin,  _BOAT_OUTPUT.rigth_motor_power );
	 }
	 else 
	 {
	 	  analogWrite ( _Motor_Rigth_minus_Pin,  0  );
	 	  analogWrite ( _Motor_Rigth_plus_Pin,  _BOAT_OUTPUT.rigth_motor_power );
	 }
}

//-------------------------------------------------
void easy_boat_mtwin::begin()
{
	_BOAT_CORRECTION.left_motor_correction  = 1;
    _BOAT_CORRECTION.rigth_motor_correction = 1;
	_BOAT_OUTPUT.left_motor_power  = 0;
    _BOAT_OUTPUT.rigth_motor_power = 0;

	_AXIS.X = 0;
	_AXIS.Y = 0;
	_AXIS.Z = 0;	

}
//-------------------------------------------------
// void easy_boat_mtwin::update()  {}
//-------------------------------------------------
// file name easy_boat_mtwin.h

#ifndef EASY_BOAT_MTWIN_H
#define EASY_BOAT_MTWIN_H
#if defined(ARDUINO) && ARDUINO >= 100
	#include <Arduino.h>
#else
	#include <WProgram.h>
	#include <pins_arduino.h>
#endif
#include <avr/io.h>
#include <avr/interrupt.h>
#include <Servo.h>
#include <Wire.h>

typedef struct 
{
  long  degrees;
  long  power  ;  
}  TD_BOAT_Input;

typedef struct 
{
  float  left_motor_power;
  float rigth_motor_power;
}  TD_BOAT_Output;

typedef struct 
{
  float  left_motor_correction;
  float  rigth_motor_correction;
}  TD_BOAT_CORRECTION;

typedef struct 
{
  long  X;
  long  Y;
  long  Z;
}  TD_AXIS;

class easy_boat_mtwin {
	public:
		easy_boat_mtwin( 
				unsigned short Motor_Left_plus_Pin    = DEFAULT_MOTOR1_PLUS_PIN,
				unsigned short Motor_Left_minus_Pin   = DEFAULT_MOTOR1_MINUS_PIN,
				unsigned short Motor_Rigth_plus_Pin   = DEFAULT_MOTOR2_PLUS_PIN,
				unsigned short Motor_Rigth_minus_Pin  = DEFAULT_MOTOR2_MINUS_PIN );
						 
		void begin		( void );
		// void update		( void );

		void set_axis( TD_AXIS *AXIS );
	    void set_new_vector     ( TD_BOAT_Input  *IN_DATA, TD_BOAT_CORRECTION *CORRECT  );
	    // void get_current_vector ( TD_BOAT_INPUT  *INPUT, TD_BOAT_OUTPUT *OUTPUT  );
	
		private:
		long _speed, _angle;
		TD_BOAT_Output      _BOAT_OUTPUT;
		TD_BOAT_CORRECTION  _BOAT_CORRECTION;
		TD_AXIS _AXIS;

		short _PWM_LeftMotor;
		short _PWM_RigthMotor;

		unsigned short _Motor_Left_plus_Pin   ;
		unsigned short _Motor_Left_minus_Pin  ;
		unsigned short _Motor_Rigth_plus_Pin  ;
		unsigned short _Motor_Rigth_minus_Pin ;	
		
		long get_value_from_percent (  long percent,  long  max_value );
		
static const unsigned short  DEFAULT_MOTOR1_PLUS_PIN  ;
static const unsigned short  DEFAULT_MOTOR1_MINUS_PIN ;
static const unsigned short  DEFAULT_MOTOR2_PLUS_PIN  ;
static const unsigned short  DEFAULT_MOTOR2_MINUS_PIN ; 		
};

#endif

всем спок ночи

#4 2016-10-07 09:58:53

NoName
Customer
Из Київ
Зарегистрирован: 2014-07-08
Сообщений: 1,404

Re: Homemade arduino boat

https://www.arduino.cc/en/uploads/Main/ … ematic.pdf
Ваша НАНА совсем не МЕГА, а так се, ни рыба, ни мясо, uart 1 шт,  ШИМ  -  раз два три и  и то 8ми битный
но популярность и доступность делают свое дело, продолжаем развлекаться  )

IMG_20161006_221845.jpg

такое безобразие в лодку не влезет, нужно все перепаковать

напоминаю насчет танка )

интересно, кто то читает этот "блог???" или я сам с собой говорю? )

#5 2016-10-07 11:14:51

vvr
Участник
Зарегистрирован: 2015-04-12
Сообщений: 507

Re: Homemade arduino boat

я читаю)))

#6 2016-10-07 11:38:55

gorenkov
Участник
Из Кіев
Зарегистрирован: 2015-11-05
Сообщений: 39

Re: Homemade arduino boat

Я тоже читаю. Всегда мечтал о радио управляемой лодке.

#7 2016-10-07 11:55:35

NoName
Customer
Из Київ
Зарегистрирован: 2014-07-08
Сообщений: 1,404

Re: Homemade arduino boat

vvr, эт, хорошо )
тогда вопрос  )
например, при включении ESP  не находит родную  wifi AP,  могу модуль через  5 секунд   перегрузить  в режим SOFT_AP

у него вроде есть возможность запустится в режиме клиента и AP, но что то не работает,
если кто знает как запусть ESP8266  режиме AP и  клиента предустановленной сети - сообщите AT комманды
я уж как то  переведу его в натив,
или есть  есть готовая  (типа см. ниже ) функция, не стесняйтесь , буду благодарен
             wifi_set_opmode(SOFTAP_MODE);
             wifi_station_set_config(&stationConf);
             ETS_UART_INTR_ENABLE();
             os_printf("Reset to AP mode. Restarting system...\n");
             system_restart();
пока где то так выглядит   
точка  называется  ESP_"MACADDR"

если есть идеи что должно быть на пульте, для танка, машинки, лодки,  etc , нарисуйте прототип, подумаю о включении кнопки / тумблера  / слайдера  / etc 
пока работаю над проектом , могу сделать, по завершению врядли буду к нему возвращаться
но с другой стороны проект открыт , сами и подправите )))

Screenshot_2016-10-07-11-32-00_com_android_browser.png

#8 2016-10-07 12:39:02

vvr
Участник
Зарегистрирован: 2015-04-12
Сообщений: 507

Re: Homemade arduino boat

а у меня всё дистанционное управление сводится к nrf24
вай фаи и интернет вообще не применяю (не интересно и соответственно нифига не знаю))))))
делал несколько проектов на блютузе чере апп инвертор и всё))))

#9 2016-10-07 12:45:13

Nefreemen
Участник
Из Киев
Зарегистрирован: 2015-12-19
Сообщений: 704

Re: Homemade arduino boat

NoName, покупай ОЗК (думаю знаешь что такое, типа защитного рез.костюма по пояс) потому что уплывет зараза точно smile . Учитывая что у меня есть опыт связки Arduino+ ESP могу сразу сказать реакция на команды еще та  smile . Для танка может подойдет но для катера сомневаюсь. Подумай и сделай все на ESP тем более что она программируется так же как ардуино, и места завались и вэб засунешь. Аппаратных возможностей мало но это ведь поправимо big_smile .

Редактировался Nefreemen (2016-10-07 12:46:19)

#10 2016-10-07 12:54:10

NoName
Customer
Из Київ
Зарегистрирован: 2014-07-08
Сообщений: 1,404

Re: Homemade arduino boat

12:32:02.520 Reset to AP mode. Restarting system...
12:31:45.517 Ready
12:31:45.552 mode : softAP(5e:cf:7f:0f:37:c3)
12:32:02.525 bcn 0
12:32:02.538 del if1
12:32:02.542 usl
12:32:02.949 bSJLB(Binit, conn=0x3ffefbe0
12:32:02.954 
12:32:02.958 Ready
12:32:02.993 mode : softAP(5e:cf:7f:0f:37:c3)
12:32:03.002 add if1
12:32:03.078 dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
12:32:03.084 bcn 100
12:32:13.118 add 1
12:32:13.123 aid 1
12:32:13.170 station: 5c:93:a2:cf:34:5c join, AID = 1
12:32:13.592 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:13.663 DNS: Q (type 0x1 class 0x1) for www.msftncsi.com
12:32:13.900 DNS: Q (type 0x1 class 0x1) for client.wns.windows.com
12:32:14.676 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:14.728 DNS: Q (type 0x1 class 0x1) for www.msftncsi.com
12:32:14.899 DNS: Q (type 0x1 class 0x1) for client.wns.windows.com
12:32:15.680 DNS: Q (type 0x1 class 0x1) for www.msftncsi.com
12:32:15.753 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:15.815 DNS: Q (type 0x1 class 0x1) for www.coocox.org
12:32:15.910 DNS: Q (type 0x1 class 0x1) for finance.services.appex.bing.com
12:32:15.959 DNS: Q (type 0x1 class 0x1) for client.wns.windows.com
12:32:16.472 DNS: Q (type 0x1 class 0x1) for www.google.com
12:32:16.903 DNS: Q (type 0x1 class 0x1) for finance.services.appex.bing.com
12:32:16.951 DNS: Q (type 0x1 class 0x1) for www.coocox.org
12:32:17.503 DNS: Q (type 0x1 class 0x1) for www.google.com
12:32:17.676 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:17.728 DNS: Q (type 0x1 class 0x1) for www.msftncsi.com
12:32:17.921 DNS: Q (type 0x1 class 0x1) for finance.services.appex.bing.com
12:32:17.972 DNS: Q (type 0x1 class 0x1) for www.coocox.org
12:32:18.029 DNS: Q (type 0x1 class 0x1) for client.wns.windows.com
12:32:18.500 DNS: Q (type 0x1 class 0x1) for www.google.com
12:32:19.973 DNS: Q (type 0x1 class 0x1) for www.coocox.org
12:32:20.040 DNS: Q (type 0x1 class 0x1) for finance.services.appex.bing.com
12:32:20.501 DNS: Q (type 0x1 class 0x1) for www.google.com
12:32:21.906 DNS: Q (type 0x1 class 0x1) for www.msftncsi.com
12:32:21.966 DNS: Q (type 0x1 class 0x1) for client.wns.windows.com
12:32:22.023 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:22.805 DNS: Q (type 0x1 class 0x1) for jira.meliorgames.com
12:32:23.804 DNS: Q (type 0x1 class 0x1) for jira.meliorgames.com
12:32:23.973 DNS: Q (type 0x1 class 0x1) for www.coocox.org
12:32:24.042 DNS: Q (type 0x1 class 0x1) for finance.services.appex.bing.com
12:32:24.806 DNS: Q (type 0x1 class 0x1) for jira.xxx.com
12:32:24.856 DNS: Q (type 0x1 class 0x1) for www.google.com
12:32:25.907 DNS: Q (type 0x1 class 0x1) for dns.msftncsi.com
12:32:25.959 DNS: Q (type 0x1 class 0x1) for dns.msftncsi.com
12:32:26.018 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:26.807 DNS: Q (type 0x1 class 0x1) for jira.xxx.com
12:32:26.906 DNS: Q (type 0x1 class 0x1) for dns.msftncsi.com
12:32:26.960 DNS: Q (type 0x1 class 0x1) for dns.msftncsi.com
12:32:27.019 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:27.977 DNS: Q (type 0x1 class 0x1) for dns.msftncsi.com
12:32:28.029 DNS: Q (type 0x1 class 0x1) for dns.msftncsi.com
12:32:28.088 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:28.157 DNS: Q (type 0x1 class 0x1) for finance.services.appex.bing.com
12:32:29.014 DNS: Q (type 0x1 class 0x1) for finance.services.appex.bing.com
12:32:29.064 DNS: Q (type 0x1 class 0x1) for www.google.com
12:32:29.995 DNS: Q (type 0x1 class 0x1) for www.google.com
12:32:30.046 DNS: Q (type 0x1 class 0x1) for dns.msftncsi.com
12:32:30.106 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:30.174 DNS: Q (type 0x1 class 0x1) for finance.services.appex.bing.com
12:32:30.226 DNS: Q (type 0x1 class 0x1) for dns.msftncsi.com
12:32:30.995 DNS: Q (type 0x1 class 0x1) for www.google.com
12:32:31.051 DNS: Q (type 0x1 class 0x1) for jira.xxx.com
12:32:32.013 DNS: Q (type 0x1 class 0x1) for finance.services.appex.bing.com
12:32:32.998 DNS: Q (type 0x1 class 0x1) for www.google.com
12:32:33.997 DNS: Q (type 0x1 class 0x1) for dns.msftncsi.com
12:32:34.051 DNS: Q (type 0x1 class 0x1) for dns.msftncsi.com
12:32:34.109 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:36.015 DNS: Q (type 0x1 class 0x1) for finance.services.appex.bing.com
12:32:36.996 DNS: Q (type 0x1 class 0x1) for www.google.com
12:32:37.888 DNS: Q (type 0x1 class 0x1) for www.atlassian.com
12:32:37.956 DNS: Q (type 0x1 class 0x1) for jira.xxx.com
12:32:38.008 DNS: Q (type 0x1 class 0x1) for dns.msftncsi.com
12:32:38.066 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:38.952 DNS: Q (type 0x1 class 0x1) for jira.xxx.com
12:32:39.007 DNS: Q (type 0x1 class 0x1) for www.atlassian.com
12:32:39.065 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:39.118 DNS: Q (type 0x1 class 0x1) for dns.msftncsi.com
12:32:40.002 DNS: Q (type 0x1 class 0x1) for www.atlassian.com
12:32:40.059 DNS: Q (type 0x1 class 0x1) for jira.xxx.com
12:32:40.111 DNS: Q (type 0x1 class 0x1) for dns.msftncsi.com
12:32:40.169 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:42.003 DNS: Q (type 0x1 class 0x1) for dns.msftncsi.com
12:32:42.059 DNS: Q (type 0x1 class 0x1) for jira.xxx.com
12:32:42.112 DNS: Q (type 0x1 class 0x1) for www.atlassian.com
12:32:42.171 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:43.863 Con req, conn=0x3fff30f0, pool slot 0
12:32:43.904 Con req, conn=0x3fff2960, pool slot 1
12:32:43.942 Con req, conn=0x3fff2c68, pool slot 2
12:32:43.985 Con req, conn=0x3fff2dc0, pool slot 3
12:32:44.023 Con req, conn=0x3fff31b8, pool slot 4
12:32:44.033 URL = /
12:32:44.050 Is url index 0
12:32:44.067 Is url index 1
12:32:44.103 Conn 0x3fff30f0 is done. Closing.
12:32:44.122 URL = /index.tpl
12:32:44.143 Is url index 0
12:32:44.156 Is url index 5
12:32:44.205 Heatshrink compressed file; decode parms = b4
12:32:44.241 Conn 0x3fff2960 is done. Closing.
12:32:45.902 URL = /get-position
12:32:45.955 Mallocced buffer for 35 + 1 bytes of post data.
12:32:45.967 Is url index 0
12:32:45.991 Huh? No hostname.
12:32:46.005 Is url index 7
12:32:46.062 {"FX":682,"FY":316,"x":682,"y":314}URL = /get-position
12:32:46.113 Mallocced buffer for 35 + 1 bytes of post data.
12:32:46.129 Is url index 0
12:32:46.151 Huh? No hostname.
12:32:46.167 Is url index 7
12:32:46.224 {"FX":682,"FY":316,"x":682,"y":312}URL = /get-position
12:32:46.276 Mallocced buffer for 35 + 1 bytes of post data.
12:32:46.292 Is url index 0
12:32:46.312 Huh? No hostname.
12:32:46.329 Is url index 7
12:32:46.425 {"FX":682,"FY":316,"x":682,"y":310}DNS: Q (type 0x1 class 0x1) for jira.xxx.com
12:32:46.463 Con req, conn=0x3fff3030, pool slot 0
12:32:46.486 URL = /get-position
12:32:46.535 Mallocced buffer for 35 + 1 bytes of post data.
12:32:46.553 Is url index 0
12:32:46.572 Huh? No hostname.
12:32:46.589 Is url index 7
12:32:46.664 {"FX":682,"FY":316,"x":684,"y":308}Con req, conn=0x3fff3130, pool slot 1
12:32:46.686 URL = /get-position
12:32:46.738 Mallocced buffer for 35 + 1 bytes of post data.
12:32:46.755 Is url index 0
12:32:46.773 Huh? No hostname.
12:32:46.790 Is url index 7
12:32:53.475 {"FX":682,"FY":316,"x":684,"y":306}DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:54.477 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:55.476 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:57.605 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:32:57.656 DNS: Q (type 0x1 class 0x1) for www.msftncsi.com
12:32:58.607 DNS: Q (type 0x1 class 0x1) for www.msftncsi.com
12:32:59.621 DNS: Q (type 0x1 class 0x1) for www.msftncsi.com
12:33:01.601 DNS: Q (type 0x1 class 0x1) for www.msftncsi.com
12:33:01.659 DNS: Q (type 0x1 class 0x1) for win8.ipv6.microsoft.com
12:33:05.600 DNS: Q (type 0x1 class 0x1) for www.msftncsi.com
12:33:06.013 Con req, conn=0x3fff2fe0, pool slot 2
12:33:06.053 Con req, conn=0x3fff2dc0, pool slot 3
12:33:06.094 Con req, conn=0x3fff31d8, pool slot 4
12:33:06.118 URL = /get-position
12:33:06.167 Mallocced buffer for 35 + 1 bytes of post data.
12:33:06.185 Is url index 0
12:33:06.203 Huh? No hostname.
12:33:06.221 Is url index 7
12:33:06.279 {"FX":682,"FY":316,"x":685,"y":304}URL = /get-position
12:33:06.329 Mallocced buffer for 35 + 1 bytes of post data.
12:33:06.346 Is url index 0
12:33:06.367 Huh? No hostname.
12:33:06.384 Is url index 7
12:33:06.441 {"FX":682,"FY":316,"x":686,"y":300}URL = /get-position
12:33:06.491 Mallocced buffer for 35 + 1 bytes of post data.
12:33:06.509 Is url index 0
12:33:06.528 Huh? No hostname.
12:33:06.545 Is url index 7
12:33:06.621 {"FX":682,"FY":316,"x":687,"y":297}Con req, conn=0x3fff2920, pool slot 0
12:33:06.644 URL = /get-position
12:33:06.695 Mallocced buffer for 35 + 1 bytes of post data.
12:33:06.711 Is url index 0
12:33:06.731 Huh? No hostname.
12:33:06.748 Is url index 7
12:33:06.825 {"FX":682,"FY":316,"x":687,"y":294}Con req, conn=0x3fff2ae8, pool slot 1
12:33:06.847 URL = /get-position
12:33:06.897 Mallocced buffer for 35 + 1 bytes of post data.
12:33:06.915 Is url index 0
12:33:06.934 Huh? No hostname.
12:33:06.951 Is url index 7
12:33:22.805 {"FX":682,"FY":316,"x":688,"y":290}DNS: Q (type 0x1 class 0x1) for jira.xxx.com
12:33:23.807 DNS: Q (type 0x1 class 0x1) for jira.xxx.com
12:33:24.819 DNS: Q (type 0x1 class 0x1) for jira.xxx.com
12:33:26.184 Con req, conn=0x3fff2ee0, pool slot 2
12:33:26.205 URL = /get-position
12:33:26.257 Mallocced buffer for 35 + 1 bytes of post data.
12:33:26.272 Is url index 0
12:33:26.292 Huh? No hostname.
12:33:26.310 Is url index 7
12:33:26.386 {"FX":682,"FY":316,"x":688,"y":286}Con req, conn=0x3fff2c48, pool slot 3
12:33:26.426 Con req, conn=0x3fff34d8, pool slot 4
12:33:26.449 URL = /get-position
12:33:26.499 Mallocced buffer for 35 + 1 bytes of post data.
12:33:26.516 Is url index 0
12:33:26.536 Huh? No hostname.
12:33:26.552 Is url index 7
12:33:26.611 {"FX":682,"FY":316,"x":688,"y":285}URL = /get-position
12:33:26.663 Mallocced buffer for 35 + 1 bytes of post data.
12:33:26.688 Is url index 0
12:33:26.697 Huh? No hostname.
12:33:26.716 Is url index 7
12:33:26.792 {"FX":682,"FY":316,"x":688,"y":284}Con req, conn=0x3fff2920, pool slot 0
12:33:26.814 URL = /get-position
12:33:26.866 Mallocced buffer for 35 + 1 bytes of post data.
12:33:26.884 Is url index 0
12:33:26.903 Huh? No hostname.
12:33:26.919 Is url index 7
12:33:27.012 {"FX":682,"FY":316,"x":688,"y":282}DNS: Q (type 0x1 class 0x1) for jira.xxx.com
12:33:27.053 Con req, conn=0x3fff2ae8, pool slot 1
12:33:27.075 URL = /get-position
12:33:27.126 Mallocced buffer for 35 + 1 bytes of post data.
12:33:27.143 Is url index 0
12:33:27.161 Huh? No hostname.
12:33:27.179 Is url index 7
12:33:30.840 {"FX":682,"FY":316,"x":682,"y":316}DNS: Q (type 0x1 class 0x1) for jira.xxx.com

у нас есть  нужный запрос
{"FX":682,"FY":316,"x":682,"y":310}
и куча интересной, но не нужной информации куда лезет комп )

краткое инфо для понимания процесса

web server ESP8266  HTML + JS отрисовывает  некий пульт  у клиента
сервер перекидывает JSON  >> arduino
сделать low cost и все отработать на esp нелогично, используя данную основу можно сформировать любой канал связи
включая  самодельные пульты 
ожидаю предложения о фичах,  если кто хочет повторить близкое по функционалу устройство,  но не увлекаемся,  ночи коротки  )

Nefreemen, та понятно,  на сухую нынче лодку проверю и буду искать танк )

за лодками плавал, за коптерами лазил )
интересно куда заведут меня сбежавшие танки? )

#11 2016-10-07 13:00:33

Nefreemen
Участник
Из Киев
Зарегистрирован: 2015-12-19
Сообщений: 704

Re: Homemade arduino boat

Лишь бы не на Марс lol .

Редактировался Nefreemen (2016-10-07 15:41:27)

#12 2016-10-07 13:11:37

Nefreemen
Участник
Из Киев
Зарегистрирован: 2015-12-19
Сообщений: 704

Re: Homemade arduino boat

"web server ESP8266  HTML + JS отрисовывает  некий пульт  у клиента
сервер перекидывает JSON  >> arduino "
Вот вот о том я и горю. Это плохо, я свой контроллер инкубатора буду переделывать, так это инкубатор lol, где +10-15 сек роли особой не играют. Да и вообще в моем случае если честно задержки в управлении настройками не играют роли, ну о глюках умолчу. Хорошо что если нет надобности обрат. канал ардуино-> ESP иначе вообще будет тоскливо, учитывая что в ЕСП нет эвента в сериал.
"сделать low cost и все отработать на esp нелогично, используя данную основу можно сформировать любой канал связи
включая  самодельные пульты" - это я не понял мысль.

#13 2016-10-07 13:35:00

NoName
Customer
Из Київ
Зарегистрирован: 2014-07-08
Сообщений: 1,404

Re: Homemade arduino boat

Nefreemen,  шутка не удалась cool , но каюсь,  спровоцировал )   

действительно, esp можно задавить, подумаем  как побороть

13:26:40.175 {"FX":698,"FY":311,"x":698,"y":314}
13:26:40.184 {"FX":698,"FY":311,"x":698,"y":317}
13:26:40.198 {"FX":698,"FY":311,"x":698,"y":320}
13:26:40.578 {"FX":698,"FY":311,"x":698,"y":324}
13:26:59.543 {"FX":698,"FY":311,"x":698,"y":331}
13:26:59.544 {"FX":698,"FY":311,"x":698,"y":333}
13:26:59.544 {"FX":698,"FY":311,"x":698,"y":336}
13:27:00.036 {"FX":698,"FY":311,"x":698,"y":338}
13:27:00.535 {"FX":698,"FY":311,"x":698,"y":339}
13:27:19.545 {"FX":698,"FY":311,"x":698,"y":341}
13:27:19.546 {"FX":698,"FY":311,"x":698,"y":311}
13:27:19.546 {"FX":700,"FY":327,"x":700,"y":324}
13:27:20.033 {"FX":700,"FY":327,"x":700,"y":320}
13:27:20.533 {"FX":700,"FY":327,"x":700,"y":316}
13:27:39.620 {"FX":700,"FY":327,"x":700,"y":307}
13:27:39.621 {"FX":700,"FY":327,"x":698,"y":302}
13:27:39.621 {"FX":700,"FY":327,"x":696,"y":295}
13:27:40.106 {"FX":700,"FY":327,"x":694,"y":287}
13:27:40.607 {"FX":700,"FY":327,"x":691,"y":281}

#14 2016-10-07 15:53:03

Nefreemen
Участник
Из Киев
Зарегистрирован: 2015-12-19
Сообщений: 704

Re: Homemade arduino boat

Извиняюсь, не уместно sad  , исправился.
NoName, не понял что и чем давить ?  roll . Посмотрел лог. Вижу старт дефолтной точки гет запросы JSON, если в нано все приходит тогда в чем вопрос roll .

#15 2016-10-07 16:07:44

Nefreemen
Участник
Из Киев
Зарегистрирован: 2015-12-19
Сообщений: 704

Re: Homemade arduino boat

Ага давится запросами  lol . Понял. "А нельзя быть красивой такой" . Вот поэтому нужно забыть о всяких HTML и JS  lol  lol . Это та проблема  которую я имел ввиду, только сформулировать не смог, кроме это есть еще другие подводные камни. Надо писать элементарный сервер и все. И то могут быть вопросы. Надо тогда приложение наверное.

Редактировался Nefreemen (2016-10-07 17:00:08)

#16 2016-10-07 16:57:50

Nefreemen
Участник
Из Киев
Зарегистрирован: 2015-12-19
Сообщений: 704

Re: Homemade arduino boat

Я конечно в HTML не силен. Но может перейти на "крутилки" и "ползунки"? В какой момент в таких случаях браузер шлет ответ roll . А нутро извините подсказывает, ну не зря я нигде не встречал радиоуправления по протоколам семейства 802.Х ( ip ). Наверное не все так просто с движущими объектами, это же не вэбкамера  big_smile .

#17 2016-10-07 17:08:33

NoName
Customer
Из Київ
Зарегистрирован: 2014-07-08
Сообщений: 1,404

Re: Homemade arduino boat

в сервере не все однозначно   

в коде  - демон http , в принципе  можно ограничить  количество одновременных соединений, увеличить буфер на прием, ограиничить  периодичность  отправки данных  на уровне js 
код ядра наверное уже есть посвежее
я не отступлюсь )
понятно что все можно положить,  но думаю что можно поднять приемлимый вариант     
   
а насчет веб камеры, я планировал  таки поднять подключение к  видепотоку, вот  акселерометр и гироскоп подключил )
аяксом на второй слой подсовывать,

да я тоже не разбираюсь  в веб технологиях, но что то придумаю ) 
 
а радиуправление есть, коптеры же летают  , но там наверняка что то типа  cc3200 
собсвенно он  у меня тоже  есть,  но у нас его можно купить только через попу , да и денег он стоит немало, секретные же технологии  шифрования на борту ))
но это крайний случай ((

/*
Esp8266 http server - core routines
*/

/*
 * ----------------------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 42):
 * Jeroen Domburg <jeroen@spritesmods.com> wrote this file. As long as you retain 
 * this notice you can do whatever you want with this stuff. If we meet some day, 
 * and you think this stuff is worth it, you can buy me a beer in return. 
 * ----------------------------------------------------------------------------
 */


#include <esp8266.h>
#include "httpd.h"


//Max length of request head
#define MAX_HEAD_LEN 1024
//Max amount of connections
#define MAX_CONN 8
//Max post buffer len
#define MAX_POST 1024
//Max send buffer len
#define MAX_SENDBUFF_LEN 2048

//This gets set at init time.
static HttpdBuiltInUrl *builtInUrls;

//Private data for http connection
struct HttpdPriv {
	char head[MAX_HEAD_LEN];
	int headPos;
	char *sendBuff;
	int sendBuffLen;
};

//Connection pool
static HttpdPriv connPrivData[MAX_CONN];
static HttpdConnData connData[MAX_CONN];
static HttpdPostData connPostData[MAX_CONN];

//Listening connection data
static struct espconn httpdConn;
static esp_tcp httpdTcp;

//Struct to keep extension->mime data in
typedef struct {
	const char *ext;
	const char *mimetype;
} MimeMap;

//The mappings from file extensions to mime types. If you need an extra mime type,
//add it here.
static const MimeMap mimeTypes[]={
	{"htm", "text/htm"},
	{"html", "text/html"},
	{"css", "text/css"},
	{"js", "text/javascript"},
	{"txt", "text/plain"},
	{"jpg", "image/jpeg"},
	{"jpeg", "image/jpeg"},
	{"png", "image/png"},
	{"svg", "image/svg+xml"},
	{NULL, "text/html"}, //default value
};

//Returns a static char* to a mime type for a given url to a file.
const char ICACHE_FLASH_ATTR *httpdGetMimetype(char *url) {
	int i=0;
	//Go find the extension
	char *ext=url+(strlen(url)-1);
	while (ext!=url && *ext!='.') ext--;
	if (*ext=='.') ext++;
	
	//ToDo: os_strcmp is case sensitive; we may want to do case-intensive matching here...
	while (mimeTypes[i].ext!=NULL && os_strcmp(ext, mimeTypes[i].ext)!=0) i++;
	return mimeTypes[i].mimetype;
}

//Looks up the connData info for a specific esp connection
static HttpdConnData ICACHE_FLASH_ATTR *httpdFindConnData(void *arg) {
	struct espconn *espconn = arg;
	for (int i=0; i<MAX_CONN; i++) {
		if (connData[i].remote_port == espconn->proto.tcp->remote_port &&
						os_memcmp(connData[i].remote_ip, espconn->proto.tcp->remote_ip, 4) == 0) {
			if (arg != connData[i].conn) connData[i].conn = arg; // yes, this happens!?
			return &connData[i];
		}
	}
	//Shouldn't happen.
	os_printf("*** Unknown connection 0x%p\n", arg);
	return NULL;
}


//Retires a connection for re-use
static void ICACHE_FLASH_ATTR httpdRetireConn(HttpdConnData *conn) {
	if (conn->post->buff!=NULL) os_free(conn->post->buff);
	conn->post->buff=NULL;
	conn->cgi=NULL;
	conn->conn=NULL;
	conn->remote_port=0;
	os_memset(conn->remote_ip, 0, 4);
}

//Stupid li'l helper function that returns the value of a hex char.
static int ICACHE_FLASH_ATTR  httpdHexVal(char c) {
	if (c>='0' && c<='9') return c-'0';
	if (c>='A' && c<='F') return c-'A'+10;
	if (c>='a' && c<='f') return c-'a'+10;
	return 0;
}

//Decode a percent-encoded value.
//Takes the valLen bytes stored in val, and converts it into at most retLen bytes that
//are stored in the ret buffer. Returns the actual amount of bytes used in ret. Also
//zero-terminates the ret buffer.
int ICACHE_FLASH_ATTR  httpdUrlDecode(char *val, int valLen, char *ret, int retLen) {
	int s=0, d=0;
	int esced=0, escVal=0;
	while (s<valLen && d<retLen) {
		if (esced==1)  {
			escVal=httpdHexVal(val[s])<<4;
			esced=2;
		} else if (esced==2) {
			escVal+=httpdHexVal(val[s]);
			ret[d++]=escVal;
			esced=0;
		} else if (val[s]=='%') {
			esced=1;
		} else if (val[s]=='+') {
			ret[d++]=' ';
		} else {
			ret[d++]=val[s];
		}
		s++;
	}
	if (d<retLen) ret[d]=0;
	return d;
}

//Find a specific arg in a string of get- or post-data.
//Line is the string of post/get-data, arg is the name of the value to find. The
//zero-terminated result is written in buff, with at most buffLen bytes used. The
//function returns the length of the result, or -1 if the value wasn't found. The 
//returned string will be urldecoded already.
int ICACHE_FLASH_ATTR httpdFindArg(char *line, char *arg, char *buff, int buffLen) {
	char *p, *e;
	if (line==NULL) return 0;
	p=line;
	while(p!=NULL && *p!='\n' && *p!='\r' && *p!=0) {
		os_printf("findArg: %s\n", p);
		if (os_strncmp(p, arg, os_strlen(arg))==0 && p[strlen(arg)]=='=') {
			p+=os_strlen(arg)+1; //move p to start of value
			e=(char*)os_strstr(p, "&");
			if (e==NULL) e=p+os_strlen(p);
			os_printf("findArg: val %s len %d\n", p, (e-p));
			return httpdUrlDecode(p, (e-p), buff, buffLen);
		}
		p=(char*)os_strstr(p, "&");
		if (p!=NULL) p+=1;
	}
	os_printf("Finding %s in %s: Not found :/\n", arg, line);
	return -1; //not found
}

//Get the value of a certain header in the HTTP client head
int ICACHE_FLASH_ATTR httpdGetHeader(HttpdConnData *conn, char *header, char *ret, int retLen) {
	char *p=conn->priv->head;
	p=p+strlen(p)+1; //skip GET/POST part
	p=p+strlen(p)+1; //skip HTTP part
	while (p<(conn->priv->head+conn->priv->headPos)) {
		while(*p<=32 && *p!=0) p++; //skip crap at start
		//See if this is the header
		if (os_strncmp(p, header, strlen(header))==0 && p[strlen(header)]==':') {
			//Skip 'key:' bit of header line
			p=p+strlen(header)+1;
			//Skip past spaces after the colon
			while(*p==' ') p++;
			//Copy from p to end
			while (*p!=0 && *p!='\r' && *p!='\n' && retLen>1) {
				*ret++=*p++;
				retLen--;
			}
			//Zero-terminate string
			*ret=0;
			//All done :)
			return 1;
		}
		p+=strlen(p)+1; //Skip past end of string and \0 terminator
	}
	return 0;
}

//Start the response headers.
void ICACHE_FLASH_ATTR httpdStartResponse(HttpdConnData *conn, int code) {
	char buff[128];
	int l;
	l=os_sprintf(buff, "HTTP/1.0 %d OK\r\nServer: esp8266-httpd/"HTTPDVER"\r\nConnection: close\r\n", code);
	httpdSend(conn, buff, l);
}

//Send a http header.
void ICACHE_FLASH_ATTR httpdHeader(HttpdConnData *conn, const char *field, const char *val) {
	char buff[256];
	int l;

	l=os_sprintf(buff, "%s: %s\r\n", field, val);
	httpdSend(conn, buff, l);
}

//Finish the headers.
void ICACHE_FLASH_ATTR httpdEndHeaders(HttpdConnData *conn) {
	httpdSend(conn, "\r\n", -1);
}

//ToDo: sprintf->snprintf everywhere... esp doesn't have snprintf tho' :/
//Redirect to the given URL.
void ICACHE_FLASH_ATTR httpdRedirect(HttpdConnData *conn, char *newUrl) {
	char buff[1024];
	int l;
	l=os_sprintf(buff, "HTTP/1.1 302 Found\r\nServer: esp8266-httpd/"HTTPDVER"\r\nConnection: close\r\nLocation: %s\r\n\r\nMoved to %s\r\n", newUrl, newUrl);
	httpdSend(conn, buff, l);
}

//Use this as a cgi function to redirect one url to another.
int ICACHE_FLASH_ATTR cgiRedirect(HttpdConnData *connData) {
	if (connData->conn==NULL) {
		//Connection aborted. Clean up.
		return HTTPD_CGI_DONE;
	}
	httpdRedirect(connData, (char*)connData->cgiArg);
	return HTTPD_CGI_DONE;
}

//This CGI function redirects to a fixed url of http://[hostname]/ if hostname field of request isn't
//already that hostname. Use this in combination with a DNS server that redirects everything to the
//ESP in order to load a HTML page as soon as a phone, tablet etc connects to the ESP. Watch out:
//this will also redirect connections when the ESP is in STA mode, potentially to a hostname that is not
//in the 'official' DNS and so will fail.
int ICACHE_FLASH_ATTR cgiRedirectToHostname(HttpdConnData *connData) {
	char buff[1024];
	int isIP=0;
	int x;
	if (connData->conn==NULL) {
		//Connection aborted. Clean up.
		return HTTPD_CGI_DONE;
	}
	if (connData->hostName==NULL) {
		os_printf("Huh? No hostname.\n");
		return HTTPD_CGI_NOTFOUND;
	}

	//Quick and dirty code to see if host is an IP
	if (os_strlen(connData->hostName)>8) {
		isIP=1;
		for (x=0; x<strlen(connData->hostName); x++) {
			if (connData->hostName[x]!='.' && (connData->hostName[x]<'0' || connData->hostName[x]>'9')) isIP=0;
		}
	}
	if (isIP) return HTTPD_CGI_NOTFOUND;
	//Check hostname; pass on if the same
	if (os_strcmp(connData->hostName, (char*)connData->cgiArg)==0) return HTTPD_CGI_NOTFOUND;
	//Not the same. Redirect to real hostname.
	os_sprintf(buff, "http://%s/", (char*)connData->cgiArg);
	os_printf("Redirecting to hostname url %s\n", buff);
	httpdRedirect(connData, buff);
	return HTTPD_CGI_DONE;
}


//Same as above, but will only redirect clients with an IP that is in the range of
//the SoftAP interface. This should preclude clients connected to the STA interface
//to be redirected to nowhere.
int ICACHE_FLASH_ATTR cgiRedirectApClientToHostname(HttpdConnData *connData) {
	uint32 *remadr;
	struct ip_info apip;
	int x=wifi_get_opmode();
	//Check if we have an softap interface; bail out if not
	if (x!=2 && x!=3) return HTTPD_CGI_NOTFOUND;
	remadr=(uint32 *)connData->conn->proto.tcp->remote_ip;
	wifi_get_ip_info(SOFTAP_IF, &apip);
	if ((*remadr & apip.netmask.addr) == (apip.ip.addr & apip.netmask.addr)) {
		return cgiRedirectToHostname(connData);
	} else {
		return HTTPD_CGI_NOTFOUND;
	}
}


//Add data to the send buffer. len is the length of the data. If len is -1
//the data is seen as a C-string.
//Returns 1 for success, 0 for out-of-memory.
int ICACHE_FLASH_ATTR httpdSend(HttpdConnData *conn, const char *data, int len) {
	if (len<0) len=strlen(data);
	if (conn->priv->sendBuffLen+len>MAX_SENDBUFF_LEN) return 0;
	os_memcpy(conn->priv->sendBuff+conn->priv->sendBuffLen, data, len);
	conn->priv->sendBuffLen+=len;
	return 1;
}

//Function to send any data in conn->priv->sendBuff. Do not use in CGIs unless you know what you
//are doing!
void ICACHE_FLASH_ATTR httpdFlushSendBuffer(HttpdConnData *conn) {
	if (conn->priv->sendBuffLen!=0) {
		espconn_sent(conn->conn, (uint8_t*)conn->priv->sendBuff, conn->priv->sendBuffLen);
		conn->priv->sendBuffLen=0;
	}
}

//Callback called when the data on a socket has been successfully
//sent.
static void ICACHE_FLASH_ATTR httpdSentCb(void *arg) {
	int r;
	HttpdConnData *conn=httpdFindConnData(arg);
	char sendBuff[MAX_SENDBUFF_LEN];

	if (conn==NULL) return;
	conn->priv->sendBuff=sendBuff;
	conn->priv->sendBuffLen=0;

	if (conn->cgi==NULL) { //Marked for destruction?
		os_printf("Conn %p is done. Closing.\n", conn->conn);
		espconn_disconnect(conn->conn);
		httpdRetireConn(conn);
		return; //No need to call httpdFlushSendBuffer.
	}

	r=conn->cgi(conn); //Execute cgi fn.
	if (r==HTTPD_CGI_DONE) {
		conn->cgi=NULL; //mark for destruction.
	}
	if (r==HTTPD_CGI_NOTFOUND || r==HTTPD_CGI_AUTHENTICATED) {
		os_printf("ERROR! CGI fn returns code %d after sending data! Bad CGI!\n", r);
		conn->cgi=NULL; //mark for destruction.
	}
	httpdFlushSendBuffer(conn);
}

static const char *httpNotFoundHeader="HTTP/1.0 404 Not Found\r\nServer: esp8266-httpd/"HTTPDVER"\r\nConnection: close\r\nContent-Type: text/plain\r\nContent-Length: 12\r\n\r\nNot Found.\r\n";

//This is called when the headers have been received and the connection is ready to send
//the result headers and data.
//We need to find the CGI function to call, call it, and dependent on what it returns either
//find the next cgi function, wait till the cgi data is sent or close up the connection.
static void ICACHE_FLASH_ATTR httpdProcessRequest(HttpdConnData *conn) {
	int r;
	int i=0;
	if (conn->url==NULL) {
		os_printf("WtF? url = NULL\n");
		return; //Shouldn't happen
	}
	//See if we can find a CGI that's happy to handle the request.
	while (1) {
		//Look up URL in the built-in URL table.
		while (builtInUrls[i].url!=NULL) {
			int match=0;
			//See if there's a literal match
			if (os_strcmp(builtInUrls[i].url, conn->url)==0) match=1;
			//See if there's a wildcard match
			if (builtInUrls[i].url[os_strlen(builtInUrls[i].url)-1]=='*' &&
					os_strncmp(builtInUrls[i].url, conn->url, os_strlen(builtInUrls[i].url)-1)==0) match=1;
			if (match) {
				os_printf("Is url index %d\n", i);
				conn->cgiData=NULL;
				conn->cgi=builtInUrls[i].cgiCb;
				conn->cgiArg=builtInUrls[i].cgiArg;
				break;
			}
			i++;
		}
		if (builtInUrls[i].url==NULL) {
			//Drat, we're at the end of the URL table. This usually shouldn't happen. Well, just
			//generate a built-in 404 to handle this.
			os_printf("%s not found. 404!\n", conn->url);
			httpdSend(conn, httpNotFoundHeader, -1);
			httpdFlushSendBuffer(conn);
			conn->cgi=NULL; //mark for destruction
			return;
		}
		
		//Okay, we have a CGI function that matches the URL. See if it wants to handle the
		//particular URL we're supposed to handle.
		r=conn->cgi(conn);
		if (r==HTTPD_CGI_MORE) {
			//Yep, it's happy to do so and has more data to send.
			httpdFlushSendBuffer(conn);
			return;
		} else if (r==HTTPD_CGI_DONE) {
			//Yep, it's happy to do so and already is done sending data.
			httpdFlushSendBuffer(conn);
			conn->cgi=NULL; //mark conn for destruction
			return;
		} else if (r==HTTPD_CGI_NOTFOUND || r==HTTPD_CGI_AUTHENTICATED) {
			//URL doesn't want to handle the request: either the data isn't found or there's no
			//need to generate a login screen.
			i++; //look at next url the next iteration of the loop.
		}
	}
}

//Parse a line of header data and modify the connection data accordingly.
static void ICACHE_FLASH_ATTR httpdParseHeader(char *h, HttpdConnData *conn) {
	int i;
	char firstLine=0;
	
	if (os_strncmp(h, "GET ", 4)==0) {
		conn->requestType = HTTPD_METHOD_GET;
		firstLine=1;
	} else if (os_strncmp(h, "Host:", 5)==0) {
		i=5;
		while (h[i]==' ') i++;
		conn->hostName=&h[i];
	} else if (os_strncmp(h, "POST ", 5)==0) {
		conn->requestType = HTTPD_METHOD_POST;
		firstLine=1;
	}

	if (firstLine) {
		char *e;
		
		//Skip past the space after POST/GET
		i=0;
		while (h[i]!=' ') i++;
		conn->url=h+i+1;

		//Figure out end of url.
		e=(char*)os_strstr(conn->url, " ");
		if (e==NULL) return; //wtf?
		*e=0; //terminate url part

		os_printf("URL = %s\n", conn->url);
		//Parse out the URL part before the GET parameters.
		conn->getArgs=(char*)os_strstr(conn->url, "?");
		if (conn->getArgs!=0) {
			*conn->getArgs=0;
			conn->getArgs++;
			os_printf("GET args = %s\n", conn->getArgs);
		} else {
			conn->getArgs=NULL;
		}

	} else if (os_strncmp(h, "Content-Length:", 15)==0) {
		i=15;
		//Skip trailing spaces
		while (h[i]==' ') i++;
		//Get POST data length
		conn->post->len=atoi(h+i);

		// Allocate the buffer
		if (conn->post->len > MAX_POST) {
			// we'll stream this in in chunks
			conn->post->buffSize = MAX_POST;
		} else {
			conn->post->buffSize = conn->post->len;
		}
		os_printf("Mallocced buffer for %d + 1 bytes of post data.\n", conn->post->buffSize);
		conn->post->buff=(char*)os_malloc(conn->post->buffSize + 1);
		conn->post->buffLen=0;
	} else if (os_strncmp(h, "Content-Type: ", 14)==0) {
		if (os_strstr(h, "multipart/form-data")) {
			// It's multipart form data so let's pull out the boundary for future use
			char *b;
			if ((b = os_strstr(h, "boundary=")) != NULL) {
				conn->post->multipartBoundary = b + 7; // move the pointer 2 chars before boundary then fill them with dashes
				conn->post->multipartBoundary[0] = '-';
				conn->post->multipartBoundary[1] = '-';
				os_printf("boundary = %s\n", conn->post->multipartBoundary);
			}
		}
	}
}


//Callback called when there's data available on a socket.
static void ICACHE_FLASH_ATTR httpdRecvCb(void *arg, char *data, unsigned short len) {
	int x;
	char *p, *e;
	char sendBuff[MAX_SENDBUFF_LEN];
	HttpdConnData *conn=httpdFindConnData(arg);
	if (conn==NULL) return;
	conn->priv->sendBuff=sendBuff;
	conn->priv->sendBuffLen=0;

	//This is slightly evil/dirty: we abuse conn->post->len as a state variable for where in the http communications we are:
	//<0 (-1): Post len unknown because we're still receiving headers
	//==0: No post data
	//>0: Need to receive post data
	//ToDo: See if we can use something more elegant for this.

	for (x=0; x<len; x++) {
		if (conn->post->len<0) {
			//This byte is a header byte.
			if (conn->priv->headPos!=MAX_HEAD_LEN) conn->priv->head[conn->priv->headPos++]=data[x];
			conn->priv->head[conn->priv->headPos]=0;
			//Scan for /r/n/r/n. Receiving this indicate the headers end.
			if (data[x]=='\n' && (char *)os_strstr(conn->priv->head, "\r\n\r\n")!=NULL) {
				//Indicate we're done with the headers.
				conn->post->len=0;
				//Reset url data
				conn->url=NULL;
				//Iterate over all received headers and parse them.
				p=conn->priv->head;
				while(p<(&conn->priv->head[conn->priv->headPos-4])) {
					e=(char *)os_strstr(p, "\r\n"); //Find end of header line
					if (e==NULL) break;			//Shouldn't happen.
					e[0]=0;						//Zero-terminate header
					httpdParseHeader(p, conn);	//and parse it.
					p=e+2;						//Skip /r/n (now /0/n)
				}
				//If we don't need to receive post data, we can send the response now.
				if (conn->post->len==0) {
					httpdProcessRequest(conn);
				}
			}
		} else if (conn->post->len!=0) {
			//This byte is a POST byte.
			conn->post->buff[conn->post->buffLen++]=data[x];
			conn->post->received++;
			conn->hostName=NULL;
			if (conn->post->buffLen >= conn->post->buffSize || conn->post->received == conn->post->len) {
				//Received a chunk of post data
				conn->post->buff[conn->post->buffLen]=0; //zero-terminate, in case the cgi handler knows it can use strings
				//Send the response.
				httpdProcessRequest(conn);
				conn->post->buffLen = 0;
			}
		} else {
			//Let cgi handle data if it registered a recvHdl callback. If not, ignore.
			if (conn->recvHdl) {
				conn->recvHdl(conn, data+x, len-x);
				break;
			}
		}
	}
}

static void ICACHE_FLASH_ATTR httpdReconCb(void *arg, sint8 err) {
	HttpdConnData *conn=httpdFindConnData(arg);
	os_printf("ReconCb\n");
	if (conn==NULL) return;
	//Yeah... No idea what to do here. ToDo: figure something out.
}

static void ICACHE_FLASH_ATTR httpdDisconCb(void *arg) {
	//The esp sdk passes through wrong arg here, namely the one of the *listening* socket.
	//That is why we can't use (HttpdConnData)arg->sock here.
	//Just look at all the sockets and kill the slot if needed.
	int i;
	for (i=0; i<MAX_CONN; i++) {
		if (connData[i].conn!=NULL) {
			//Why the >=ESPCONN_CLOSE and not ==? Well, seems the stack sometimes de-allocates
			//espconns under our noses, especially when connections are interrupted. The memory
			//is then used for something else, and we can use that to capture *most* of the
			//disconnect cases.
			if (connData[i].conn->state==ESPCONN_NONE || connData[i].conn->state>=ESPCONN_CLOSE) {
				connData[i].conn=NULL;
				if (connData[i].cgi!=NULL) connData[i].cgi(&connData[i]); //flush cgi data
				httpdRetireConn(&connData[i]);
			}
		}
	}
}


static void ICACHE_FLASH_ATTR httpdConnectCb(void *arg) {
	struct espconn *conn=arg;
	int i;
	//Find empty conndata in pool
	for (i=0; i<MAX_CONN; i++) if (connData[i].conn==NULL) break;
	os_printf("Con req, conn=%p, pool slot %d\n", conn, i);
	if (i==MAX_CONN) {
		os_printf("Aiee, conn pool overflow!\n");
		espconn_disconnect(conn);
		return;
	}
	connData[i].priv=&connPrivData[i];
	connData[i].conn=conn;
	connData[i].priv->headPos=0;
	connData[i].post=&connPostData[i];
	connData[i].post->buff=NULL;
	connData[i].post->buffLen=0;
	connData[i].post->received=0;
	connData[i].post->len=-1;
	connData[i].hostName=NULL;
	connData[i].remote_port=conn->proto.tcp->remote_port;
	os_memcpy(connData[i].remote_ip, conn->proto.tcp->remote_ip, 4);

	espconn_regist_recvcb(conn, httpdRecvCb);
	espconn_regist_reconcb(conn, httpdReconCb);
	espconn_regist_disconcb(conn, httpdDisconCb);
	espconn_regist_sentcb(conn, httpdSentCb);
}

//Httpd initialization routine. Call this to kick off webserver functionality.
void ICACHE_FLASH_ATTR httpdInit(HttpdBuiltInUrl *fixedUrls, int port) {
	int i;

	for (i=0; i<MAX_CONN; i++) {
		connData[i].conn=NULL;
	}
	httpdConn.type=ESPCONN_TCP;
	httpdConn.state=ESPCONN_NONE;
	httpdTcp.local_port=port;
	httpdConn.proto.tcp=&httpdTcp;
	builtInUrls=fixedUrls;

	os_printf("Httpd init, conn=%p\n", &httpdConn);
	espconn_regist_connectcb(&httpdConn, httpdConnectCb);
	espconn_accept(&httpdConn);
	espconn_tcp_set_max_con_allow(&httpdConn, MAX_CONN);
}

#18 2016-10-07 22:39:21

Nefreemen
Участник
Из Киев
Зарегистрирован: 2015-12-19
Сообщений: 704

Re: Homemade arduino boat

Как то попадались на глаза в продаже модули на СС3200 но цена сразу отбивала даже смотреть в их сторону не то что вникать что за чудо. Поэтому он ничего практически не знаю.

  Завидую упорству  smile . Как то жизнь научила больше ценить время а не средства. Стараюсь все решить в лоб и побыстрее. На академические исследования времени нет вообще sad . Так произошло и с контроллером инка, посмотрел что библиотека для дисплея 128х64 выдает ошибки при компиляции для ЕСП плюнул добавил ардуино мегу2560 потому что в другие код не влез. Теперь каюсь и чешу репу или переделать до февраля или оставить все как есть. Изучение СТМ идет очень туго.

По поводу вэб управления. Думаю что все таки надо делать "ползунки" и/или "крутилки". У меня сын занимается созданием сайтов (фрилансер  lol два года в азии сидел lol ), так я его спросил по поводу слайдера. Он сказал что это делается очень просто на JS, значение отсылается только по событию (нажал кнопку на мышке или отпустил клавишу например стрелочку). Таким образом можно не сыпать значениями а отсылать одно.

Редактировался Nefreemen (2016-10-07 22:42:06)

#19 2016-10-10 10:23:55

NoName
Customer
Из Київ
Зарегистрирован: 2014-07-08
Сообщений: 1,404

Re: Homemade arduino boat

Nefreemen, вы все правильно делаете, если что то для себя либо мелкий опт который под заказ, и главное скорость реализации проекта, то на цену особо нечего смотреть
но 156 грн на 1к девайсов то это уже   Tesla Model X  (попроще)
"ну ничего себе, 160к евро в Киеве, ну не офигела ли наша система и  держслужбовцI"
основную идею поняли, когда партия от 1к,уже копейка - деньги, а в условии конкуренции то ...    потому и приходится "рыть" и использовать  необходимый минимум,
подтянули мне либу на 200кБ на JS )  и чего ты  ругаешмся, говорят, хорошая либа, удобная и маленькая )
так что,  если для себя, то хоть лампочкой под расбери управляйте, лишь бы по критериям надежности удовлетворило )

ползунки и крутилки - тот же джойстик  - только вид "сбоку" ) 
и данные отправляются onEvent,  так что все едино.

поздравляю с осенью ), погодка шепчет )

#20 2016-10-11 20:24:31

Nefreemen
Участник
Из Киев
Зарегистрирован: 2015-12-19
Сообщений: 704

Re: Homemade arduino boat

NoName, спасибо за поздравление. Но вот прочел и понял что я ничего не понял. Зачем либа JS, это первое, второе не пойму причем здесь джойстик, я предложил использовать на вэб странице не кнопки а слайдеры и отправлять данные только после установки значения (уменьшив тем самим нагрузку на сервер). Теперь думаю что может предполагается еще пульт на ЕСП roll. Ладно не хотите рассматривать вариант только ESP без ардуино дело Ваше. Хотя две микросхемы расширитель gpio например PCF8574 и можно подобрать аналогично ШИМ (думаю он нужен в проекте), или сделать программный. Думаю вариантов отказаться от связки ардуино + ЕСП много. Я однозначно в своем контроллере инкубатора от этой связки буду уходить  smile плохо это да и дорого.

Редактировался Nefreemen (2016-10-11 20:26:21)

#21 2016-10-11 22:57:02

NoName
Customer
Из Київ
Зарегистрирован: 2014-07-08
Сообщений: 1,404

Re: Homemade arduino boat

согласен, ESP14 неплохой вариант, но  мне нужно посмотреть на arduino ) в этом проекте и посмотрю, он должен быть не только не дорогим, но и понятным )
а esp ядро странное, типа работает, но.. что , я еще сам незнаю )

#22 2016-10-12 20:03:57

Nefreemen
Участник
Из Киев
Зарегистрирован: 2015-12-19
Сообщений: 704

Re: Homemade arduino boat

NoName, упаси боже что бы я даже намекал на ЕСП-14. Как то даже не встречал ни одной вещи сделанной на 14й, да и документации кот наплакал, и если честно я не понимаю на кой там СТМ. Что там СТМ 8-битный может помочь или чего то добавить, портов что ли, нет не добавил, думаю проблем и нестабильности добавил точно. На связку ЕСП + ардуино смотрите  big_smile . А что странного в ядре?

#23 2016-10-13 09:29:39

NoName
Customer
Из Київ
Зарегистрирован: 2014-07-08
Сообщений: 1,404

Re: Homemade arduino boat

на самом деле stm8 это аналог меги по распространению, но чуток веселее  ) я ничего не делал для 8ки,   в данном случае 8 ка это расширитель портов (аппаратных приколов, тех же PWM / TIM Capture / etc ), что в целом очень очень удобно для небольших проектов, я ее таки куплю/запущу но позже, программатор для 8 ки уже взял  )

add
Nefreemen,  MAARS (Modular Advanced Armed Robotic System) )
1302551832_5.jpg

пример шикарной платформы )

Редактировался NoName (2016-10-13 09:46:18)

#24 2016-10-13 15:51:05

NoName
Customer
Из Київ
Зарегистрирован: 2014-07-08
Сообщений: 1,404

Re: Homemade arduino boat

цяця )  так и хочеться пощупать )

Intel-Falcon-8-3.jpg

#25 2016-10-13 22:49:37

Nefreemen
Участник
Из Киев
Зарегистрирован: 2015-12-19
Сообщений: 704

Re: Homemade arduino boat

Как по мне ESP-14 мертворожденный продукт (имхо). В esp-14 такое же количество пинов как и в esp-12 и тот же форм фактор. И СТМ там точно добавил "веселья и приколов" (имхо)  lol  lol .
   MAARS и "цяця" действительно tongue.

Редактировался Nefreemen (2016-10-13 22:50:20)

Быстрое сообщение

Введите сообщение и нажмите Отправить

Подвал раздела