Strelaãã©ãããã©ãŒã ã®äž»ãªã¢ã€ãã¢ã¯ãããããArduinoãããžã§ã¯ããæ§ç¯ããã¢ãžã¥ãŒã«æ¹åŒã®ååãæåŠããããšã§ãã äžé£ã®ã·ãŒã«ãã®ä»£ããã«ãAmperkaã¯å€ãã®ã·ãŒã«ãã®æ©èœãå®è£ ãã1ã€ã®ãŠãããŒãµã«ããŒãã䜿çšããããšããå§ãããŸãã
ãã®èšäºã§ã¯ããã®çµæã«ã€ããŠæèŠãè¿°ã¹ãAndroidã¹ããŒããã©ã³ã®bluetoothã§å¶åŸ¡ããããããããã©ã®ããã«æ§ç¯ãããã説æããŸãã ç§ã¯å¯èœãªéãå ¬å¹³ã«ãªãããšããŸãããããã¡ããããçšåºŠã®äž»èŠ³æ§ããããŸãã
èæ¯
ã©ãžãªãšã³ãžãã¢ãªã³ã°å€§åŠã§ç¹å¥ãªåéãæããèªç±ãªæéã«åŠçãšãããžã§ã¯ã掻åãè¡ããŸãã ããã¯éåžžã®èšèã®æå³ã§ã¯åãšã¯èšããŸããã ç§ã«ã¯ãå人ãŸãã¯éåžžã«å°ããªã°ã«ãŒãã§å¥œããªããšã«åãçµãè¥è ã®ã°ã«ãŒãããããŸãã 誰ãã3Dããªã³ããããªã³ãã¿ãŒãããã°ã©ãã³ã°ãªã©ã«åŸäºããŠããŸãã ã€ãŸããç§ã¯å®éã«äººã ã«ãšã¬ã¯ãããã¯ã¹ãæããããšã«ã€ããŠã®èããæã£ãŠããŸãã
ä»äºã®äž»ãªå Žæã§ãç§ã¯å°éçã«é»åæ©åšã®éçºã«åŸäºããŠãããå®éã®éã®ãããžã§ã¯ãã«åãçµãã è±å¯ãªçµéšãæã£ãŠããŸãã æåž«ãšããŠã ãã§ãªãããšã³ãžãã¢ãšããŠãèªåã®å°è±¡ãè¡šçŸã§ããŸãã
ç§ãä»äºã§Strelaã䜿çšããŠèªåã®çµéšãå ±æããããšãããšããã¡ããããã«åæããŸããã Amperkaãç§ãã¡ã«ããããã®ã¯ãã¹ãŠãç§ã¯çåŸã®äžäººã«å®å šã«åŒãæž¡ããŸãããçåŸã¯ã¿ã¹ã¯ã«èå³ãæã€ããã«ãªããŸããã
ããã§ã¯ãã³ã³ããŒãã³ãã®èª¬æã«ç§»ããŸãããã
ã¹ãã¬ã©
Strelaãã©ãããã©ãŒã ã¯ããããããæ§ç¯ããããã«å®å šã«æºåãããArduinoäºæã®ããŒãã§ãã Amperkaã«ãã£ãŠéçºããããããããè¿ éã«æ§ç¯ããããã«å¿ èŠãªã»ãŒãã¹ãŠãçµã¿åãããŠããŸãã Atmega32u4ã³ã³ãããŒã©ãŒã«åºã¥ããŠæ§ç¯ãããŠãããArduino Leonardoãšåæ§ã«äœæ¥ããå¿ èŠããããŸãã 圌女ã¯ãã®ãããªç®±ã§ç§ãã¡ã®ãšããã«æ¥ãŸããïŒ
äžè¬çã«ãAmperkaã¯ããã±ãŒãžã³ã°ã«æ³šæãæã£ãŠããŸãã ãããã®è£œåã¯ãã¹ãŠãç¹å¥ã«èšèšãããç®±ã«ãã¡ããšããã±ãŒãžãããŠããŸãã 圌ãã¯äž»ã«ããªãè¥ãèŠèŽè ã«çŠç¹ãåœãŠãŠããã圌ãã¯ããã«ã©ããã«å ãŸããŠããã®ã§ã¯ãªãããã®åœ¢åŒã§è³Œå ¥ããããšãåãã§ãããšæããŸãã
ããã¯ã¹ã§ã¯ãããŒãèªäœïŒ
äžèŠãããšãããç®±ã®äžã«ããŒããããªãã£ãããšã«é©ããŸããã ãã®åŸãããŒãã§ã®äœæ¥ãéå§ããŠããã®ã¢ã€ãã¢ã«äœåºŠãæ»ããŸããããä»ã«äœãã§ããã®ãæãã€ããŸããã§ããã æ¬åœã«ããããã®ãã®ããã§ã«ããŒãã«ã€ã³ã¹ããŒã«ãããŠããŸãããããŒãã¹ãšããŠå®äŸ¡ãªãã³ãå ¥æããããšã¯åžžã«ãšãŠãããããšã§ãã
åé¢ã«ããããŒãèªäœã¯......
...ãããŠåŸãããïŒ
ããŒãã®äž»ãªæ©èœã¯æ¬¡ã®ãšããã§ãã
æ é€
- å ¥åé»å§ïŒ7-24Vã ã¢ãŒã¿ãŒãã©ã€ããŒã¯åãé»å§ãã絊é»ãããŸãã
- 5Vã3Açšã®å èµã¹ã€ããã³ã°å®å®åšã ããŒãèªäœã¯ã»ãšãã©æ¶è²»ããŸãããã€ãŸãããã®ãã¹ãŠã䜿çšããŠãæ¥ç¶ãããèŠçŽ ïŒã»ã³ãµãŒããµãŒããªã©ïŒã«é»åãäŸçµŠã§ããŸãã
- éä¿¡ã¢ãžã¥ãŒã«ã«é»åãäŸçµŠããããã®3.3Vãªãã¢ã¹ã¿ãã©ã€ã¶ãŒã
- USBé»æºã ç¢å°ã«ã¯ã³ã³ãã¬ãŒã¿ãã€ã³ã¹ããŒã«ãããŠãããäž»é»æºããªãã«ãªããšãUSBããŒãããã®é»æºã«èªåçã«åãæ¿ãããŸãã 5ãã«ããã£ã³ãã«ã®è² è·å®¹éã¯500 mAã«äœäžããã¢ãŒã¿ãŒãžã®é»ååºåã¯åäœãåæ¢ããŸãã
åºæ¿æèŒåšèŸºæ©åš
- ãšã³ãžã³ãã©ã€ããŒL298P;
- ãžã§ãã¬ãŒã¿ãŒãå èµããŠããªãããšãŸãšããã¿ãŒã ä»»æã®ã¡ããã£ãŒãæŒå¥ããããã«äœ¿çšã§ããŸãã
- ãªã»ããã¹ã€ããã ããããŸãã«ã¹ã€ããã§ãã ããã¯æ¬è³ªçã«ãµãŒããããã¬ãŒã«ãšããŠæ©èœããŸãã å€éšã®ãã°ã«ã¹ã€ãããé»æºã«å ¥ãããšãããŒãããªãã«ããããšãã§ããŸãããŸãã¯ãRESETã¹ã€ããã§ãã€ã¯ãã³ã³ãããŒã©ãããªããã«ããããšãã§ããŸãã
- åºå®ãªãã®4ã€ã®ã«ã¹ã¿ã ãã¿ã³ã
- 4ã€ã®ãŠãŒã¶ãŒLEDã
- ãšã³ãžã³ã¹ããŒã¿ã¹ãé»åãäŒéã©ã€ã³çšã®10åã®ã€ã³ãžã±ãŒã¿LEDã
å€éšèŠçŽ ãæ¥ç¶ããããã®ã³ãã¯ã¿
- 2ã€ã®DCã¢ãŒã¿ãŒ2AããŸãã¯1ã€ã®åŒ·åãª4AããŸãã¯1ã€ã®ã¹ãããã³ã°ã¢ãŒã¿ãŒãæ¥ç¶ããããã®2ã€ã®ç«¯åå°ã
- 12åã®æšæº3ãã³PLSã³ãã¯ã¿ïŒGNDã5VãSIGïŒã ããŸããŸãªã»ã³ãµãŒããµãŒããªã©ãæ¥ç¶ã§ããŸãã ãããã®8ã€ã¯ã¢ããã°å ¥åãšããŠæ©èœãã4ã€ã¯PWMåºåãšããŠæ©èœããŸãã
- éä¿¡ã¢ãžã¥ãŒã«ãã€ã³ã¹ããŒã«ããããã®ã³ãã¯ã¿ã å¿ èŠãªãã¹ãŠã®ãã€ã³ãã£ã³ã°ã¯ãã§ã«ããŒãäžã«ãããŸã-XBee圢åŒã®å¿ èŠãªã¢ãžã¥ãŒã«ãã€ã³ã¹ããŒã«ããããã ãã«æ®ããŸãã
- å ãã£ãã«ãä»ããŠãªã¢ãŒãã³ã³ãããŒã«çšã®IRã¬ã·ãŒããŒãæ¥ç¶ããããã®ãœã±ããã
- LCDãã£ã¹ãã¬ã€çšã³ãã¯ã¿ã
- ã€ã³ã¿ãŒãã§ã€ã¹TWI / I2CãSPIãUARTã
èªè ãç¡æã®æ¹äœãèš±ããŠãããããšãé¡ã£ãŠããŸãã ãã¹ãŠã®æ©èœã¯wikiã«ãããŸã ã
ä»æ¥ãããããå·¥åŠã¯ã»ãšãã©ã®å Žåãã¢ãžã¥ãŒã«åŒã®åçã䜿çšããŠããŸãã ã€ãŸãããããã®æ©èœã®ã»ãšãã©ãã¹ãŠãåå¥ã«è³Œå ¥ããããããçµåããå¿ èŠããããŸãã
ã·ãŒã«ãã§äœãããããããã¯æ¬¡ã®ããã«ãªããŸãã
Strelaã«ã¯ãArduinoãã¢ãŒã¿ãŒãã©ã€ããŒä»ãã·ãŒã«ããé»å§ã³ã³ããŒã¿ãŒããããã¿ã€ãã³ã°çšã®ãã¬ããããŒããªã©ãéåžžã¯åå¥ã«è³Œå ¥ãããããã€ãã®ããã€ã¹ãå«ãŸããŠããŸãã ãããããŒãã®äž»ãªã¢ã€ãã¢ã§ããã2ã€ã®åŽé¢ããããŸãã
äžæ¹ã§ã¯ãããããã¹ãŠã®æ©èœãåå¥ã®ã·ãŒã«ãã®åœ¢ã§è³Œå ¥ããããšãããšãã¯ããã«é«äŸ¡ã§ãµã€ãºã倧ãããªããŸãã ã€ãŸããããšãã°ãããããã¯ã©ã¹ã®æ©åšãè³Œå ¥ããå ŽåãStrelaã¯çµæžçãªèŠ³ç¹ãããåçæ§ãé«ããªããŸãã
äžæ¹ãArduinoã§èæ¡ãããç¹å®ã®ãããžã§ã¯ãããããã·ã¹ãã ã®ãã¹ãŠã®ã³ã³ããŒãã³ããäºåã«ç¥ãããŠããå Žåã1ã€ãŸãã¯2ã€ã®ã·ãŒã«ãã§ããŸãããå¯èœæ§ãé«ããã³ã¹ããšãµã€ãºã®äž¡æ¹ã§åã€ããšãã§ããŸãã
ãã©ãããã©ãŒã ã®äœ¿çšã¯ãããããå·¥åŠã®æ çµã¿ã®äžã§æ£åœåããããšæãããŸãã ããŸããŸãªããããã§çµ¶ããåé 眮ããããæ©èœããã°ããè¿œå ãããããããšãå¯èœã§ãã Amperkaã®ãããªã¬ãã¥ãŒã§ã圌ãã¯éåžžãã»ãŒãã¹ãŠã®æ©èœãåæã«å®çŸãããããããæ§ç¯ããŸããã ãŸããStrelaã¯ãããã°ã©ãã³ã°ã«ç²ŸéããŠããŠããããžã§ã¯ãã§æ¯èŒçåçŽãªããŒããŠã§ã¢ãå¿ èŠãšããŠãã人ã ã«ãšã£ãŠãèå³æ·±ããã®ã§ãã Strelaã¯ããã¬ãã¬ãŒã³ã¹ããããããŒã ã®ããã©ãŒããŒãšããŠå®ç§ã«ãã£ããããããå£ããRCã¢ãã«ã«æ°ããåœãå¹ã蟌ãã®ã«åœ¹ç«ã¡ãŸãã
ãã®éšåãèŠçŽããããã«ãããŒãã®é·æãšçæããªã¹ãããããšæããŸãã ã ãããããã«ç§ãã¡ãªãããšèãããã®ããããŸãïŒ
- å€éšçã«ã¯ã1æã®ããŒãã¯äžé£ã®ã·ãŒã«ããããèŠæ ããããŸãã å°ãªããšããä»ã®ããããããéç«ã£ãŠããŸãã
- è¡šé¢å®è£ ã«ãããæ¥ç¶ãå°ãªãããå¿ èŠããããŸãã ããç°¡åãªçµã¿ç«ãŠãããé«ãä¿¡é Œæ§ã
- ããŒãã®åãä»ãç©Žã¯Arduino Unoã®ç©Žã®äœçœ®ãç¹°ãè¿ããããã«4ã€ã®ç©ŽããããŸãã
- èšå€§ãªæ°ã®äŸãå«ã詳现ãªããã¥ã¡ã³ãïŒèšäºã®æåŸã«ã¡ã€ã³ãªã³ã¯ãè¿œå ããŸãïŒã
- ããŒããæäœããããã®ã©ã€ãã©ãªã åŸã§åå¥ã«èª¬æããŸãã
- ããã¯ã¹ã
ãããŠãç§ãå人çã«å¥œãã§ã¯ãªãã£ããã®ã¯æ¬¡ã®ãšããã§ãã
- éåžžã«å€ãã®å Žåãåè·¯ã¯å®å šããŒãžã³ãªãã§äœæãããŸãã ãããã極端ãªä¿¡é Œæ§ã®ããã«å®¶åºã®ä¿¡é Œæ§ã¯å¿ èŠã§ããïŒ
- ç§ã¯çœããã¹ã¯ã奜ãã§ã¯ãããŸããã ããŒãã¯ãã£ãšé¢çœããã«èŠããŸããããã®äžã«ã¯äœãèŠããŸããã
- ããŒãã®5ãã«ãéšåã«ã¯ã1ã€ã®é»æºããé»åãäŸçµŠãããŸãã ããžã¿ã«éšåãšé»æºéšåã«å¥ã ã®ã¹ã¿ãã©ã€ã¶ãŒãäœæããŸãã
- ããã§ããããŒãã¯ç§ã®æšæºã§ã¯å€§ãã-100x80mmã§ãã 倧ãããŠãã¹ãŠã
- Strelaã¯Arduinoã®ã·ãŒã«ããšäºææ§ããããŸããã ãã®ããã®æšæºçãªãããããªã³ãã¯ãããŸããã
- ç§ã¯ãã§ã«å®å šãªã»ããã«ã€ããŠè©±ããŸããã
ããããã®ããŒãã®ã³ã¹ãã§ãã ããããèšã£ãããå°ãèšã£ããããã®ã¯é£ããã ããããããŒãããæ§ç¯ããå Žåãã·ãŒã«ãã§çµã¿ç«ãŠããããå®äŸ¡ã§ããããšãå€æããå¯èœæ§ããããŸãã ç§ã®çµéšã§ã¯ãäŸ¡æ Œã¯å ¬å¹³ã§ãã ãã·ã¢ã§ãããéçºããå ¬åŒã«è²©å£²ãã倧èŠæš¡ãªæè¡ãµããŒããçµç¹ããå Žåãããã¯ã©ããããã®é»åæ©åšã®è²»çšã§ãã
ããããã®ã·ã£ãŒã·
ãŸãã䟿å©ãªäºèŒªã¿ãŒãã«ãã©ãããã©ãŒã ã玹ä»ãããŸããã
ããã¯éåžžã«å€§ããããšã³ãžã³åºåãšå èµããããªãŒãã«ããŒã®ããããªãŒæ°ã®ç¹ã§ããŒã ã«é©åããŸãã ãã§ã«äººæ°ã®ããã»ã³ãµãŒãšã»ã³ãµãŒçšã®ããŠã³ãããããŸãã
Bluetoothã¢ãžã¥ãŒã«ãã»ã³ãµãŒãã€ã³ãžã±ãŒã¿ãŒ
ã³ã³ãããŒã©ãŒãšãã€ãŒã«ãã©ãããã©ãŒã ã«å ããŠãããã«å€ãã®æçšãªãã®ãæ瀺ãããŸããã
- ãã©ãããã©ãŒã äºæã®Bluetooth Beeã¢ãžã¥ãŒã«ã¯éåžžã«äœ¿ããããã§ãã UARTãä»ããŠã³ã³ãããŒã©ãŒã«æ¥ç¶ãããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã¯ãããCOMããŒããšããŠèªèããŸãã ãããããäœããPC /ã¹ããŒããã©ã³ã«ã¯ã€ã€ã¬ã¹ã§æ¥ç¶ããæãç°¡åãªæ¹æ³ã§ãã
- 8x2ããã¹ãç»é¢ ã ç¹ã«ãã®ãã£ã¹ãã¬ã€ã¯ãã·ã¢èªã®ã¢ã«ãã¡ãããããµããŒãããŠããããããããããã¹ããŒã¿ã¹ã¡ãã»ãŒãžã衚瀺ã§ããå Žåã¯éåžžã«äŸ¿å©ã§ãã
- ã©ã€ã³ãã¬ãŒãµãŒãæ§ç¯ããããã®2ã€ã®ã¢ããã°ã©ã€ã³ã»ã³ãµãŒ ã æ¥ç¶ã«ã¯éåžžã®3ç·ã±ãŒãã«ãå«ãŸããŸãã
- ããŠã³ãä»ãèµ€å€ç·è·é¢èš10-80cm åºåã«ã¯é»å§ãããããã®å€§ããã¯æž¬å®è·é¢ã«äŸåããŸãã
- 2ã€ã®èµ€å€ç·é害ç©ã»ã³ãµãŒ ã åºåã§ã¯ãèšå®ããããããå€ãšæž¬å®ãããè·é¢ã«å¿ããŠã0ãŸãã¯1ã«ãªããŸãã
Bluetoothãããã¢ã»ã³ããª
ã·ã¹ãã ã®æ©èœããã°ãããã¹ãããããã«ãBluetoothã§å¶åŸ¡ããããããããæ§ç¯ããããšã«ããŸããã åºç€ãšããŠã ç¢å°arrow wikiããäŸãåãäžããŸããã
ãããè¡ãã«ã¯ãã³ã³ãããŒã©ãŒãéä¿¡ã¢ãžã¥ãŒã«ãè»èŒªä»ããã©ãããã©ãŒã ãããã³ããããªãŒãšããŠãStrelaãã©ãããã©ãŒã èªäœã§ååã§ãã ããããªãŒã³ã³ããŒãã¡ã³ãã䜿çšããªãããšã«ããŸããã 代ããã«ã11.1Vã3A / hã®LiPoããããªãŒãæ¥ç¶ããŸããã ããã«ãã€ã³ãžã±ãŒã¿ãŒãæ¥ç¶ããŸããã
çµæã¯æ¬¡ã®ãšããã§ãã
ã芧ã®ããã«ãã¢ã»ã³ããªå šäœãã·ã£ãŒã·ã®çµã¿ç«ãŠ ãããŒãã®ããžæ¢ããšæ¥ç¶ããããŠæ°åæ¬ã®ã¯ã€ã€ã®æ¥ç¶ã«ãªããŸãã
ããã§ã¢ã»ã³ããªãå®äºããããã°ã©ãã³ã°ãéå§ãããŸãã
ç¢å°ããã°ã©ãã³ã°
ç±å¿ãªèªè ã¯ãStrelaãå¶åŸ¡ãããèãã®æ°ãArduino Leonardoã®ãããããããªãå€ãããšã«æ°ä»ãããããããŸããã 1ã€ã®LCDã®å Žåã®ã¿ã8ã€å¿ èŠã§ãã ãããã¯ãã¹ãŠå®è£ ãããI2Cã§å¶åŸ¡ãããããŒããšã¯ã¹ãã³ããŒã䜿çšããŠåæã«æ©èœããŸãã æ¢è£œã®Strelaã©ã€ãã©ãªçšã§ã¯ãªãå Žåãåå¿è ããããã®ãšãã¹ãã³ããŒã®æ©èœã䜿çšããã®ã¯ããªãå°é£ã§ãã
ãšã¬ã¯ãããã¯ã¹éçºè ã¯ãããã±ãŒãžã³ã°ãããã¥ã¡ã³ããããã³ãœãããŠã§ã¢ãã»ãšãã©ç¡èŠããŸãã ããããããã¯Amperkaã«ã¯é©çšãããŸããã StrelaããŒãçšã®æ¢è£œã®ãµã³ãã«ãçŽ æŽãããã©ã€ãã©ãªããããããããŸãã ããžã¿ã«åºåãæäœããããã®æ©èœã¯ããããããããŸãããããããããªããã°ããã¹ãŠã®å¯èœãªåšèŸºæ©åšãåæã«åäœãããããšã¯éåžžã«å°é£ã§ãã æšæºã®Arduinoæ©èœãšåããããç°¡åã§ãã ãããã䜿çšãããšãI2Cãã¹ã䜿çšããè€éããåé¿ã§ããŸããããããªããšãI2Cãã¹ã®äœ¿çšãéå§ããã®ã«æéãããããŸãã Arrowã§ã¯ãçµè«ã®æå®ãArduinoã«é¢é£ããŠå€æŽãããŠããŸãããããã«ã¯æ··ä¹±ã¯ãããŸããã
LCDãã£ã¹ãã¬ã€ã䜿çšããå Žåã¯ãç¢å°ã®ç¢å°ããä¿èšŒãããåäœã©ã€ãã©ãªãããŠã³ããŒãããããšããå§ãããŸãã ãããŠã圌女ãšäžç·ã«åãäŸããããŸãã
äŸã®ããã«é»è©±ããå¶åŸ¡ããããã«ãPlay Marketã®å®æããBluetooth RCã«ãŒã¢ããªã±ãŒã·ã§ã³ã䜿çšããŸããã
ç§ã®åŠçã¯ãCãã€ã¯ãã³ã³ãããŒã©ãŒã®ããã°ã©ãã³ã°ãšãªãã¬ãŒãã£ã³ã°ã·ã¹ãã çšã®ããã°ã©ã ã®äœæã®çµéšãã»ãšãã©ãããŸããã§ããã Strelaã®éçºã§ã圌ã«ã¯åé¡ã¯ãããŸããã§ããã ææšãè¿œå ããããšã圌ã®ã€ãã·ã¢ããã§ãããããããç§ã¯åœŒãæ¬åœã«ãããæ°ã«å ¥ã£ãŠãããšçµè«ä»ããŸããã 圌ã¯ãã¢ããªã±ãŒã·ã§ã³ã§èšå®ãããé床ïŒãŸãã¯ããããPWMä¿¡å·ã®çžå¯Ÿçãªãã¥ãŒãã£ãµã€ã¯ã«ïŒãã€ã³ãžã±ãŒã¿ãŒã«ãããããŸããã
ã³ãŒããå ã®åœ¢åŒã§æçš¿ãããŠããããšã瀺ããŸããããã¯ãã³ãŒããçµéšã®æµ ã人ã«ãã£ãŠäœæãããããšã瀺ãããã§ãã ãã¿ãã¬ãèŠãããšã¯ã§ããŸãããå®ç§ãªã³ãŒããæ°ãããã®ã¯èŠã€ãããŸããã
Bluetoothãããããã°ã©ã
#include <Wire.h> // I2C #include <Strela.h> // #include <LiquidCrystal_I2C.h> int velocity = 0; // int defaultSpeed = 100; // int start = 1; LiquidCrystal_I2C lcd(LC_ADDR, LCEN, LCRW, LCRS, LC4, LC5, LC6, LC7); void setup() { Serial1.begin(9600); //Bluetooth Bee //motorConnection(1, 0); // //, // . // 1 . uDigitalWrite(L2, HIGH); uDigitalWrite(L3, HIGH); drive(0, 0); lcd.begin(8, 2); lcd.home(); lcd.print("Hello"); delay(2000); lcd.setCursor(0, 1); lcd.print("Load"); delay(1000); lcd.print("."); delay(1000); lcd.print("."); delay(1000); lcd.print("."); delay(1000); lcd.clear(); lcd.home(); lcd.print("Connect"); lcd.home(); } void loop() { if (Serial1.available() > 0) // { if (start==1) { lcd.print("Conected"); delay(1000); lcd.clear(); lcd.setCursor(0, 0); lcd.print("Speed"); lcd.setCursor(0, 1); start = 0; } // control(); } // } void control() // { char dataIn = Serial1.read(); // if (dataIn == 'F') // "F" drive(velocity, velocity); // else if (dataIn == 'B') // "B" drive(-velocity, -velocity); // else if (dataIn == 'R') // "L" drive(-velocity, velocity); // else if (dataIn == 'L') // "R" drive(velocity, -velocity); // else if (dataIn == 'G') // "I", drive(defaultSpeed+velocity, defaultSpeed-velocity); else if (dataIn == 'H') // "J", drive(-defaultSpeed-velocity, -defaultSpeed+velocity); else if (dataIn == 'I') // "I", drive(defaultSpeed-velocity, defaultSpeed+velocity); else if (dataIn == 'J') // "H", drive(-defaultSpeed+velocity, -defaultSpeed-velocity); else if (dataIn == 'S') // "S", drive(0, 0); else if (dataIn == 'U') // "U", " " { uDigitalWrite(L2, HIGH); uDigitalWrite(L3, HIGH); } else if (dataIn == 'u') // "u", " " { uDigitalWrite(L2, LOW); uDigitalWrite(L3, LOW); } else if (dataIn == 'W') // "W", " " { uDigitalWrite(L1, HIGH); uDigitalWrite(L4, HIGH); } else if (dataIn == 'w') //// "w", " " { uDigitalWrite(L1, LOW); uDigitalWrite(L4, LOW); } // 0 9 else if (((dataIn - '0') >= 0) && ((dataIn - '0') <= 9)) { velocity = (dataIn - '0') * 25; // lcd.setCursor(0, 1); lcd.print(" "); lcd.setCursor(0, 1); lcd.print(velocity); lcd.setCursor(0, 1); } else if (dataIn == 'q') // "q" - ! { velocity = 255; lcd.print(velocity); lcd.setCursor(0, 1); } }
ã³ãŒãã¯ãã»ãŒå®å šã«æ¢è£œã®äŸããåçšãããŠããŸãã
ãŸãšã
Strelaã¯ãããŸããŸãªãããããããžã§ã¯ãã§äœ¿çšããã®ã«éåžžã«äŸ¿å©ãªãã©ãããã©ãŒã ã§ãã ãã¬ãŒãã³ã°ãé±æ«ã®ãããžã§ã¯ãã§ã¯ãLUTããŒããããŒãªã³ã°ãããå£ã«åãä»ãããããã«ãŒãã³äœæ¥ãæå°éã«æããå¿ èŠãããããã«æããŸãã ããã§ãªããã°ãç±æã倱ãããšã¯éåžžã«ç°¡åã§ãã
Arrowsã䜿çšããããã®å€ãã®ã¢ã€ãã¢ããããŸããã è¿ãå°æ¥ãæ°ãããã¬ãŒã ãå°å·ããã©ã€ã³ã»ã³ãµãŒãåãä»ãããããããã©ã€ã³ã«æ²¿ã£ãŠç§»åãããBluetoothãä»ããŠæåã§å¶åŸ¡ã§ããããã«ããŸãã 競æäŒã§ç§ãã¡ã®ããŒã ã¯äŸ¡å€ããããšç¢ºä¿¡ããŠããŸãã 圌ãã¯ãã§ã«ããããã®äœæ¥ãéå§ããŠããŸãïŒ
ææã®ãœãŒã¹
Amperka補åããŒãž
Wiki
ã¹ããŒã
å³æžé€š
Amperkaã®å ¬åŒã¬ãã¥ãŒ
PS
ç§èªèº«ã¯ãã€ã¯ãã³ã³ãããŒã©ãŒãCã§ããã°ã©ãã³ã°ããã®ã奜ãã§ãArduinoäºæããŒããŠã§ã¢ãã¡ãŒã ãŠã§ã¢ãåªãããœãããŠã§ã¢ã§ã¢ããã°ã¬ãŒãããããã«æåãå°œãããŠããŸãããã®ãããäžçŽãŠãŒã¶ãŒåãã«ãããŒãããŒããŒã䜿çšããŠä»»æã®16é²ãã¡ã€ã«ã®ãã¡ãŒã ãŠã§ã¢ã®èª¬æãAtmega32u4ã¡ã¢ãªã«è¿œå ããŸãã ãšã³ãžãã¢Amperkaã«ãããšïŒ
ãªãã·ã§ã³1ïŒ
- ã¿ãŒããã«ãéããŠãããã«æžããŸãïŒCïŒ\ Program FilesïŒx86ïŒ\ Arduino / hardware / tools / avr / bin / avrdude -CCïŒ\ Program FilesïŒx86ïŒ\ Arduino / hardware / tools / avr / etc / avrdude.conf- v -v -v -v -patmega32u4 -cavr109 -PCOM19 -b57600 -D -UflashïŒwïŒCïŒ\ Your_C_FIRMWA.hexïŒiãããã§ãCïŒ\ Your_C_FIRMWA.hexã¯ã19ã®ä»£ããã«COM19-COMçªå·ããŒãããŒããŒã¢ãŒãã®ç¢å°ããŒãïŒéåžžãšã¯ç°ãªãïŒã
- MKãåèµ·åããŸãã
- 8ç§ä»¥å ã«ãã³ã³ãã¥ãŒã¿ãŒã®ãã€ã³ã1ããã³ãã³ããå®è¡ããæéããããŸãïŒã€ãŸããEnterããŒãæŒããŸãïŒã
- ããŒããããã®ãåŸ ã£ãŠããŸãã
ãªãã·ã§ã³2- inoã䜿çšããŸãã