<\/figure>\n\n\n\n\u56f3\u306f\u30c8\u30e9\u30f3\u30b8\u30b9\u30bf\u3092\u4e00\u3064\u306e\u30b9\u30a4\u30c3\u30c1\u3068\u898b\u7acb\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n
4\u3064\u306e\u30b9\u30a4\u30c3\u30c1ON\/OFF\u7d44\u307f\u5408\u308f\u305b\u3067\u3001\u30e2\u30fc\u30bf\u30fc\u3092\u6b63\u8ee2\u3001\u9006\u8ee2\u51fa\u6765\u307e\u3059\u3002\u30b9\u30a4\u30c3\u30c11\u30684\u3092ON\u306b\u3059\u308b\u3068\u30e2\u30fc\u30bf\u30fc\u304c\u6b63\u8ee2\u3057\u307e\u3059\u3002\u30b9\u30a4\u30c3\u30c12\u30683\u3092ON\u306b\u3059\u308b\u3068\u6b63\u8ee2\u6642\u3068\u306f\u9006\u65b9\u5411\u306b\u96fb\u6d41\u304c\u6d41\u308c\u3001\u30e2\u30fc\u30bf\u30fc\u304c\u9006\u8ee2\u3057\u307e\u3059\u3002\u3053\u306e\u4ed6\u306b\u30b9\u30a4\u30c3\u30c11\u30682\u3082\u3057\u304f\u306f3\u30684\u3092ON\u306b\u3059\u308b\u3068\u30d6\u30ec\u30fc\u30ad\u304c\u304b\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n
\u30e2\u30fc\u30bf\u30fc\u30c9\u30e9\u30a4\u30d0IC\u3092\u4f7f\u3063\u305f\u30e2\u30fc\u30bf\u30fc\u306e\u6b63\u8ee2\u3001\u9006\u8ee2\u65b9\u6cd5<\/h3>\n\n\n\n \u30e2\u30fc\u30bf\u30fc\u3092\u6b63\u8ee2\u3001\u9006\u8ee2\u3001\u30d6\u30ec\u30fc\u30ad\u3055\u305b\u308b\u306b\u306fRaspberry Pi\u304b\u3089\u3069\u306e\u3088\u3046\u306a\u6307\u4ee4\u3092\u30e2\u30fc\u30bf\u30fc\u30c9\u30e9\u30a4\u30d0IC\u306b\u9001\u308c\u3070\u3088\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n
\u3053\u3053\u3067\u306fTA7291P\u3068\u3044\u3046\u30e2\u30fc\u30bf\u30fc\u30c9\u30e9\u30a4\u30d0IC\u3092\u4f8b\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n <\/figure>\n\n\n\u9577\u3089\u304f\u96fb\u5b50\u5de5\u4f5c\u3067\u611b\u7528\u3055\u308c\u3066\u304d\u305fTA7291P\u304c\u751f\u7523\u505c\u6b62\u306b\u306a\u308a\u307e\u3057\u305f\u3002TA7291P\u306e\u4ee3\u66ff\u3068\u3057\u3066\u3001DRV8835\u306a\u3069\u304c\u3042\u308a\u307e\u3059\u3002\u30e2\u30fc\u30bf\u30fc\u30c9\u30e9\u30a4\u30d0IC\u304c\u5909\u308f\u308b\u3068\u7aef\u5b50\u914d\u5217\u3084\u6307\u4ee4\u65b9\u6cd5\u306f\u7570\u306a\u308a\u307e\u3059\u304c\u3001H\u30d6\u30ea\u30c3\u30b8\u56de\u8def\u306e\u4ed5\u7d44\u307f\u304c\u5206\u304b\u3063\u3066\u3044\u308c\u3070\u3001\u4f7f\u3044\u65b9\u306f\u57fa\u672c\u7684\u306b\u540c\u3058\u3067\u3059\u3002<\/div>\n\n\n
TA7291P\u306e\u52d5\u4f5c\u65b9\u6cd5\u306f\u30c7\u30fc\u30bf\u30b7\u30fc\u30c8<\/a>\u3092\u898b\u308b\u3053\u3068\u3067\u5206\u304b\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u8981\u70b9\u306e\u307f\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n\u524d\u7bc0\u3067\u8aac\u660e\u3057\u307e\u3057\u305f\u901a\u308a\u3001\u30e2\u30fc\u30bf\u30fc\u30c9\u30e9\u30a4\u30d0IC\u306b\u306f\u30d6\u30ea\u30c3\u30b8\u56de\u8def\u304c\u7d44\u307e\u308c\u3066\u3044\u3066\u30014\u3064\u306e\u30c8\u30e9\u30f3\u30b8\u30b9\u30bfON\/OFF\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u30e2\u30fc\u30bf\u30fc\u3092\u6b63\u8ee2\u3001\u9006\u8ee2\u51fa\u6765\u307e\u3059\u3002TA7291P\u306f\u3053\u306e4\u3064\u306e\u30c8\u30e9\u30f3\u30b8\u30b9\u30bf\u30922\u3064\u306e\u30c7\u30b8\u30bf\u30eb\u4fe1\u53f7\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u5236\u5fa1\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002IN1\/IN2\u7aef\u5b50\u3068GPIO\u7aef\u5b50\u3092\u7e4b\u304e\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306bIN1\/IN2\u7aef\u5b50\u306b\u4fe1\u53f7\u5165\u529b\u3059\u308b\u3068\u30e2\u30fc\u30bf\u30fc\u3092\u6b63\u8ee2\/\u9006\u8ee2\u51fa\u6765\u307e\u3059\u3002<\/p>\n\n\n
\n\n\n\u5165\u529b<\/td>\n \u51fa\u529b<\/td>\n \u30e2\u30fc\u30c9<\/td>\n<\/tr>\n \nIN1<\/td>\n IN2<\/td>\n OUT1<\/td>\n OUT2<\/td>\n<\/tr>\n \n0<\/td>\n 0<\/td>\n \u221e<\/td>\n \u221e<\/td>\n \u30b9\u30c8\u30c3\u30d7<\/td>\n<\/tr>\n \n1<\/td>\n 0<\/td>\n H<\/td>\n L<\/td>\n \u6b63\u8ee2<\/td>\n<\/tr>\n \n0<\/td>\n 1<\/td>\n L<\/td>\n H<\/td>\n \u9006\u8ee2<\/td>\n<\/tr>\n \n1<\/td>\n 1<\/td>\n L<\/td>\n L<\/td>\n \u30d6\u30ec\u30fc\u30ad<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n\u203b\u221e\u306f\u30cf\u30a4\u30a4\u30f3\u30d4\u30fc\u30c0\u30f3\u30b9<\/p>\n\n\n\n
\u56de\u8def\u56f3<\/h2>\n\n\n\nRaspberry Pi\u3068TA7291P\u3068\u96fb\u6c60\u306e\u7e4b\u304e\u65b9<\/h4>\n\n\n\n TA7291P\u306e\u30c7\u30fc\u30bf\u30b7\u30fc\u30c8\u3092\u898b\u3066\u3082\u3001Raspberry Pi\u3068\u3069\u3046\u63a5\u7d9a\u3057\u305f\u3089\u3044\u3044\u306e\u304b\u5206\u304b\u3089\u306a\u3044\u3068\u3044\u3046\u4eba\u3082\u591a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002TA7291P\u306e\u7aef\u5b50\u63a5\u7d9a\u3092\u4e0b\u8868\u306b\u7e8f\u3081\u307e\u3057\u305f\u306e\u3067\u53c2\u8003\u306b\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n\n\n
\n\n\n\u7aef\u5b50\u8a18\u53f7<\/td>\n \u7aef\u5b50\u8aac\u660e<\/td>\n \u63a5\u7d9a\u5148<\/td>\n<\/tr>\n \nVcc<\/td>\n \u30ed\u30b8\u30c3\u30af\u5074\u96fb\u6e90\u7aef\u5b50<\/td>\n Raspberry Pi +5V\u7aef\u5b50<\/td>\n<\/tr>\n \nVs<\/td>\n \u51fa\u529b\u5074\u96fb\u6e90\u7aef\u5b50<\/td>\n \u96fb\u6c60\uff0b\u6975<\/td>\n<\/tr>\n \nVref<\/td>\n \u5236\u5fa1\u96fb\u6e90\u7aef\u5b50<\/td>\n \u96fb\u6c60\uff0b\u6975 (3k\u03a9\u4ee5\u4e0a\u306e\u4fdd\u8b77\u62b5\u6297\u3092\u4ecb\u3059)<\/td>\n<\/tr>\n \nGND<\/td>\n GND<\/td>\n Raspberry Pi GND \uff06 \u96fb\u6c60\u30fc\u6975<\/td>\n<\/tr>\n \nIN1<\/td>\n \u5165\u529b\u7aef\u5b501<\/td>\n Raspberry Pi GPIO 27<\/td>\n<\/tr>\n \nIN2<\/td>\n \u5165\u529b\u7aef\u5b502<\/td>\n Raspberry Pi GPIO 22<\/td>\n<\/tr>\n \nOUT1<\/td>\n \u51fa\u529b\u7aef\u5b501<\/td>\n \u30e2\u30fc\u30bf\u30fc \uff0b\u6975<\/td>\n<\/tr>\n \nOUT2<\/td>\n \u51fa\u529b\u7aef\u5b502<\/td>\n \u30e2\u30fc\u30bf\u30fc \u30fc\u6975<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n\u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u56de\u8def<\/h4>\n\n\n\n <\/figure>\n\n\n\n\u30e2\u30fc\u30bf\u30fc\u6b63\u8ee2\u3001\u9006\u8ee2\u3092\u3055\u305b\u308b\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0<\/h2>\n\n\n\n \u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u6d41\u308c\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\u307e\u305a\u3001GPIO\u7aef\u5b50\u306e\u51fa\u529b\u8a2d\u5b9a\u3092\u3057\u3001\u521d\u671f\u51fa\u529b\u5024\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u6b21\u306b\u30ad\u30fc\u5165\u529b\u5f85\u3061\u306e\u7121\u9650\u30eb\u30fc\u30d7\u3068\u3057\u3001\u300ce\u300d\u30ad\u30fc\u304c\u62bc\u3055\u308c\u305f\u3089\u6b63\u8ee2\u3001\u300cd\u300d\u30ad\u30fc\u304c\u62bc\u3055\u308c\u305f\u3089\u9006\u8ee2\u3001\u300cq\u300d\u30ad\u30fc\u304c\u62bc\u3055\u308c\u305f\u3089\u505c\u6b62\u3055\u305b\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n
import RPi.GPIO as GPIO\nimport sys\n\nGPIO.setmode(GPIO.BCM)\nGPIO.setup(27, GPIO.OUT)\nGPIO.setup(22, GPIO.OUT)\n\nGPIO.output(27, GPIO.LOW)\nGPIO.output(22, GPIO.LOW)\n\ntry:\n while True:\n #\u300ce\u300d\u30ad\u30fc\u304c\u62bc\u3055\u308c\u305f\u3089\u524d\u9032\n c = sys.stdin.read(1)\n if c == 'e':\n GPIO.output(27, GPIO.HIGH)\n GPIO.output(22, GPIO.LOW)\n \n #\u300cd\u300d\u30ad\u30fc\u304c\u62bc\u3055\u308c\u305f\u3089\u5f8c\u9000\n if c == 'd':\n GPIO.output(27, GPIO.LOW)\n GPIO.output(22, GPIO.HIGH)\n\n #\u300cq\u300d\u30ad\u30fc\u304c\u62bc\u3055\u308c\u305f\u3089\u6b62\u307e\u308b\n if c == 'q':\n GPIO.output(27, GPIO.LOW)\n GPIO.output(22, GPIO.LOW)\n\nexcept KeyboardInterrupt:\n pass\n\nGPIO.cleanup()<\/code><\/pre><\/div>\n\n\n\n\u52d5\u4f5c\u78ba\u8a8d<\/h2>\n\n\n\n \u5358\u306b\u30e2\u30fc\u30bf\u30fc\u3092\u6b63\u8ee2\u3001\u9006\u8ee2\u3059\u308b\u3060\u3051\u3067\u306f\u5206\u304b\u308a\u306b\u304f\u3044\u306e\u3067\u3001\u30bf\u30df\u30e4 \u30c0\u30d6\u30eb\u30ae\u30e4\u30dc\u30c3\u30af\u30b9\u306e\u7247\u5074\u30e2\u30fc\u30bf\u30fc\u306e\u307f\u99c6\u52d5\u3055\u305b\u305f\u3068\u304d\u306e\u52d5\u304d\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<\/video><\/figure>\n\n\n\n\u30ad\u30fc\u3092\u62bc\u3059\u3054\u3068\u306b\u30e2\u30fc\u30bf\u30fc\u304c\u6b63\u8ee2\u2192\u505c\u6b62\u2192\u9006\u8ee2\u2192\u505c\u6b62\u3057\u307e\u3059\u3002<\/p>\n\n\n\n
\u307e\u3068\u3081<\/h2>\n\n\n\n Raspberry Pi\u3092\u7528\u3044\u3066\u30e2\u30fc\u30bf\u30fc\u3092\u6b63\u8ee2\u3001\u9006\u8ee2\u3055\u305b\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n
\u30dd\u30a4\u30f3\u30c8\u306f<\/p>\n\n\n\n
\n\u30e2\u30fc\u30bf\u30fc\u6b63\u8ee2\u3001\u9006\u8ee2\u3059\u308b\u306b\u306fH\u30d6\u30ea\u30c3\u30b8\u56de\u8def\u304c\u5fc5\u8981<\/li>\n\n\n\n H\u30d6\u30ea\u30c3\u30b8\u56de\u8def\u30921\u30c1\u30c3\u30d7\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u5316\u3057\u305f\u306e\u304c\u30e2\u30fc\u30bf\u30fc\u30c9\u30e9\u30a4\u30d0IC<\/li>\n\n\n\n Raspberry Pi\u306eGPIO\u304b\u3089\u30e2\u30fc\u30bf\u30fc\u30c9\u30e9\u30a4\u30d0IC\u3078\u30012\u3064\u306e\u4fe1\u53f7\u3092\u9001\u4fe1\u3059\u308b\u3053\u3068\u3067\u30e2\u30fc\u30bf\u30fc\u6b63\u8ee2\u3001\u9006\u8ee2\u3092\u53ef\u80fd\u306b\u3059\u308b<\/li>\n<\/ul>\n\n\n\n\u3067\u3059\u3002<\/p>\n\n\n\n
\u30e2\u30fc\u30bf\u30fc\u5236\u5fa1\u306f\u96fb\u5b50\u5de5\u4f5c\u306e\u7b2c\u4e00\u6b69\u3067\u3059\u3002\u3053\u308c\u304b\u3089\u3001\u3082\u306e\u3065\u304f\u308a\u306e\u5e45\u304c\u5e83\u304c\u308a\u307e\u3059\u306d\uff01<\/p>\n\n\n