{"id":2306,"date":"2019-10-23T18:00:06","date_gmt":"2019-10-23T09:00:06","guid":{"rendered":"http:\/\/androiphone.uvs.jp\/?p=2306"},"modified":"2023-11-24T10:40:59","modified_gmt":"2023-11-24T01:40:59","slug":"%e3%83%a9%e3%82%ba%e3%83%91%e3%82%a4-%e9%9b%bb%e5%9c%a7%e3%83%bb%e9%9b%bb%e6%b5%81%e3%82%92%e3%83%a9%e3%82%ba%e3%83%91%e3%82%a4%e3%81%a7%e8%a8%88%e6%b8%ac%e3%81%99%e3%82%8bina226%e3%83%bbina260-2","status":"publish","type":"post","link":"https:\/\/androiphone.uvs.jp\/?p=2306","title":{"rendered":"[\u30e9\u30ba\u30d1\u30a4] \u96fb\u5727\u30fb\u96fb\u6d41\u3092\u30e9\u30ba\u30d1\u30a4\u3067\u8a08\u6e2c\u3059\u308b(INA226\u30fbINA260)[\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u7de8]"},"content":{"rendered":"<p><span style=\"font-size: 14pt;\">\u524d\u56de\u306f\u3001\u30bb\u30f3\u30b5\u30fc\u3068\u30e9\u30ba\u30d1\u30a4\u306e\u63a5\u7d9a\u307e\u3067\u7d39\u4ecb\u3057\u305f\u3002<\/span><\/p>\n<div class=\"linkcard\"><div class=\"lkc-internal-wrap\"><a class=\"lkc-link no_icon\" href=\"https:\/\/androiphone.uvs.jp\/?p=2237\" data-lkc-id=\"559\"><div class=\"lkc-card\"><div class=\"lkc-info\"><div class=\"lkc-favicon\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.google.com\/s2\/favicons?domain=androiphone.uvs.jp\" alt=\"\" width=\"16\" height=\"16\" \/><\/div><div class=\"lkc-domain\">ANDROIPHONE<\/div><\/div><div class=\"lkc-content\"><figure class=\"lkc-thumbnail\"><img decoding=\"async\" class=\"lkc-thumbnail-img\" src=\"\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/img_0587-150x150.jpg\" width=\"100px\" height=\"108px\" alt=\"\" \/><\/figure><div class=\"lkc-title\">[\u30e9\u30ba\u30d1\u30a4] \u96fb\u5727\u30fb\u96fb\u6d41\u3092\u30e9\u30ba\u30d1\u30a4\u3067\u8a08\u6e2c\u3059\u308b(INA226\u30fbINA260)[\u63a5\u7d9a\u7de8]<\/div><div class=\"lkc-date\">&#x1f552;&#xfe0f;2019\u5e7410\u670823\u65e5<\/div><div class=\"lkc-excerpt\">\u96fb\u6d41\u30fb\u96fb\u5727\u8a08\u306e\u30e2\u30cb\u30bf\u30fc\u3092\u3059\u308b\u304d\u3063\u304b\u3051\u3068\u306a\u3063\u305f\u4e0b\u306e\u8a18\u4e8b\u306e\u7d9a\u304d\u306b\u306a\u308b\u3002\u3084\u3063\u3068\u3001\u6574\u3063\u3066\u304d\u305f\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u306e\u76ee\u6a19\u3067\u3042\u308b\u96fb\u6d41\u30fb\u96fb\u5727\u3092\u30e9\u30ba\u30d1\u30a4\u3067\u78ba\u8a8d\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002\u53c2\u8003\u306e\u30b5\u30a4\u30c8\u306f\u4ee5\u4e0b\u306e2\u30b5\u30a4\u30c8\u3053\u306e\u5546\u54c1\u3067\u3001\u96fb\u5727\u30fb\u96fb\u6d41\u3092\u5e38\u6642\u76e3\u8996\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u308b\u3002\u8a18\u9332\u3082\u3059\u308b\u3068\u306a\u308b\u3068\u3001\u96fb\u6d41\u30fb\u96fb\u5727\u30bb\u30f3\u30b5\u30fc\u3068\u30e9\u30ba\u30d1\u30a4\u3067\u8a18\u9332\u308c\u3070\u3044\u3044\u304b\u306a\u3068\u3044\u3046\u767a\u60f3\u3002\u30bb\u30f3\u30b5\u30fc\u306f\u3092\u4f7f\u3063\u3066\u307f\u305f\u3002INA226\u306e\u5546\u54c1\u3082\u8cb7\u3063\u305f\u3093\u3060\u3051\u3069\u3001\u8272\u3005\u3042\u3063\u3066\u3001INA260\u3092\u4f7f\u3063\u3066\u307f\u305f(\u58ca\u3057\u305f\u308f\u3051\u3058\u3083\u306a\u3044\u3088)\u3002\u4e00\u5fdc\u3001\u9ad8\u7cbe\u5ea6\u307f\u305f\u3044\u3060\u3057\u30fb\u30fb\u30fbw\u96fb\u6e90(\u30bd\u30fc\u30e9\u30fc\u30d1\u30cd\u30eb)\u3068\u8ca0\u8377(\u30e2\u30d0\u30a4\u30eb\u30d0\u30c3\u30c6\u30ea\u30fc)\u306e...<\/div><\/div><div class=\"clear\"><\/div><\/div><\/a><\/div><\/div>\n<p><span style=\"font-size: 14pt;\">\u3053\u3053\u304b\u3089\u306f\u3084\u3063\u3068\u3001\u30b3\u30fc\u30c9\u3092\u4f7f\u3063\u3066\u96fb\u5727\u30fb\u96fb\u6d41\u3092\u8aad\u307f\u53d6\u3063\u3066\u3044\u3053\u3046\u3068\u304a\u3082\u3046\u3002<\/span><\/p>\n<div class=\"linkcard\"><div class=\"lkc-external-wrap\"><a class=\"lkc-link no_icon\" href=\"https:\/\/risaiku.net\/archives\/5428\/\" data-lkc-id=\"544\" target=\"_blank\" rel=\"external noopener\"><div class=\"lkc-card\"><div class=\"lkc-info\"><div class=\"lkc-favicon\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.google.com\/s2\/favicons?domain=risaiku.net\" alt=\"\" width=\"16\" height=\"16\" \/><\/div><div class=\"lkc-domain\">Risaiku \u30ea\u30b5\u30a4\u30af<\/div><div class=\"lkc-share\"> <div class=\"lkc-sns-hb\">1 User<\/div> <div class=\"lkc-sns-po\">4 Pockets<\/div><\/div><\/div><div class=\"lkc-content\"><figure class=\"lkc-thumbnail\"><img decoding=\"async\" class=\"lkc-thumbnail-img\" src=\"\/\/androiphone.uvs.jp\/wp-content\/uploads\/pz-linkcard\/cache\/770a731681694e2be502f8158d95245e7dfed1d3359fd5f3a9fc0e28c4d8fe1b.jpeg\" width=\"100px\" height=\"108px\" alt=\"\" \/><\/figure><div class=\"lkc-title\">Raspberry Pi\u306eI2C\u3092\u4f7f\u3063\u3066\u96fb\u5727\u3092\u6e2c\u5b9a\u3059\u308b(2019\u5e743\u6708\u7248)<\/div><div class=\"lkc-url\" title=\"https:\/\/risaiku.net\/archives\/5428\/\">https:\/\/risaiku.net\/archives\/5428\/<\/div><div class=\"lkc-excerpt\">\u7686\u3055\u3093\u3001\u4f55\u53f0\u306eRaspberry Pi\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u304b\uff1f\u5f0a\u793e\u306b\u306f\u3044\u3064\u306e\u9593\u306b\u304b6\u53f0\u306e\u30e9\u30ba\u30d1\u30a4\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u4eca\u56de\u3001Raspberry Pi\u3067\u96fb\u5727\u3092\u77e5\u308b\u5fc5\u8981\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u3084\u3063\u3066\u307f\u307e\u3057\u305f\u3002...<\/div><\/div><div class=\"clear\"><\/div><\/div><\/a><\/div><\/div>\n<div class=\"linkcard\"><div class=\"lkc-external-wrap\"><a class=\"lkc-link no_icon\" href=\"http:\/\/usepocket.com\/c\/UP552.html\" data-lkc-id=\"543\" target=\"_blank\" rel=\"external noopener\"><div class=\"lkc-card\"><div class=\"lkc-info\"><div class=\"lkc-favicon\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.google.com\/s2\/favicons?domain=usepocket.com\" alt=\"\" width=\"16\" height=\"16\" \/><\/div><div class=\"lkc-domain\">usepocket.com<\/div><div class=\"lkc-share\"> <div class=\"lkc-sns-po\">6 Pockets<\/div><\/div><\/div><div class=\"lkc-content\"><figure class=\"lkc-thumbnail\"><img decoding=\"async\" class=\"lkc-thumbnail-img\" src=\"\/\/androiphone.uvs.jp\/wp-content\/uploads\/pz-linkcard\/cache\/fe70eadf2291b023818b96da3d239c15e043e2a34cd907d4b1d0238f6844e25e.jpeg\" width=\"100px\" height=\"108px\" alt=\"\" \/><\/figure><div class=\"lkc-title\">2016\u5e74\u306e\u7269\u6b32\u305d\u306e11\u300cINA226 I2C\u30c7\u30b8\u30bf\u30eb\u96fb\u6d41\u30fb\u96fb\u5727\u30fb\u96fb\u529b\u8a08\u30e2\u30b8\u30e5\u30fc\u30eb\u300d\u3092\u4f7f\u3063\u3066R...<\/div><div class=\"lkc-url\" title=\"http:\/\/usepocket.com\/c\/UP552.html\">http:\/\/usepocket.com\/c\/UP552.html<\/div><\/div><div class=\"clear\"><\/div><\/div><\/a><\/div><\/div>\n<p><span style=\"font-size: 14pt;\">\u3053\u306e\u8fba\u304c\u53c2\u8003\u306b\u306a\u308b\u304b\u306a\u3041\u3068\u601d\u3063\u3066\u3001\u307e\u305a\u306f\u4e0a\u306e\u30b5\u30a4\u30c8\u306e\u901a\u308a\u306b\u63a5\u7d9a\u3057\u3066\u96fb\u5727\u8868\u793a\u307e\u3067\u3057\u3066\u307f\u305f\u3002Mu\u3092\u8d77\u52d5\u3057\u3066\u3001Python3\u3067<\/span><\/p>\n<pre class=\"lang:python decode:true\">import smbus\r\n \r\ni2c = smbus.SMBus(1)\r\nword = i2c.read_word_data(0x41, 0x02) &amp; 0xFFFF\r\nresult = ( (word &lt;&lt; 8) &amp; 0xFF00 ) + (word &gt;&gt; 8)\r\nvolt = result * 1.25 \/ 1000\r\nprint volt<\/pre>\n<p><span style=\"font-size: 14pt;\">\u305f\u3076\u3093\u3001Python2\u3067\u66f8\u304b\u308c\u305f\u30b3\u30fc\u30c9\u306a\u306e\u3067print\u3092\u30ab\u30c3\u30b3\u3067\u304f\u304f\u3063\u3066\u5909\u66f4\u3057\u305f\u3060\u3051\u3067\u52d5\u4f5c\u3057\u305f\u3002\u6b63\u3057\u3044\u96fb\u5727\u3092\u304b\u3048\u3057\u3066\u3044\u308b\u69d8\u5b50\u3002\u3057\u304b\u3057\u3001\u96fb\u6d41\u5024\u304c\u308f\u304b\u3089\u306a\u3044\u3002\u8a08\u7b97\u304c\u5fc5\u8981\u304b\u3041\u3002\u3082\u3046\u3001<strong><span style=\"font-size: 18pt; color: #ff6600;\">\u30d3\u30c3\u30c8\u6f14\u7b97\u3068\u304b\u899a\u3048\u3066\u306a\u3044\u3057\u3001\u4f55\u3092\u3057\u3066\u3044\u308b\u306e\u304b\u3088\u304f\u308f\u304b\u3089\u306a\u3044<\/span><\/strong>\u3002\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3092\u8aad\u3093\u3067\u307f\u308b\u3068<\/span><\/p>\n<p><a href=\"http:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-25_18-9-3_No-00.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2310\" src=\"http:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-25_18-9-3_No-00-300x220.png\" alt=\"\" width=\"329\" height=\"241\" srcset=\"https:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-25_18-9-3_No-00-300x220.png 300w, https:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-25_18-9-3_No-00-768x562.png 768w, https:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-25_18-9-3_No-00.png 919w\" sizes=\"auto, (max-width: 329px) 100vw, 329px\" \/><\/a><\/p>\n<div class=\"linkcard\"><div class=\"lkc-external-wrap\"><a class=\"lkc-link no_icon\" href=\"http:\/\/strawberry-linux.com\/pub\/ina226.pdf\" data-lkc-id=\"560\" target=\"_blank\" rel=\"external noopener\"><div class=\"lkc-card\"><div class=\"lkc-info\"><div class=\"lkc-favicon\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.google.com\/s2\/favicons?domain=strawberry-linux.com\" alt=\"\" width=\"16\" height=\"16\" \/><\/div><div class=\"lkc-domain\">strawberry-linux.com<\/div><\/div><div class=\"lkc-content\"><figure class=\"lkc-thumbnail\"><img decoding=\"async\" class=\"lkc-thumbnail-img\" src=\"https:\/\/s.wordpress.com\/mshots\/v1\/http%3A%2F%2Fstrawberry-linux.com%2Fpub%2Fina226.pdf?w=100\" width=\"100px\" height=\"108px\" alt=\"\" \/><\/figure><div class=\"lkc-title\">http:\/\/strawberry-linux.com\/pub\/ina226.pdf<\/div><div class=\"lkc-url\" title=\"http:\/\/strawberry-linux.com\/pub\/ina226.pdf\">http:\/\/strawberry-linux.com\/pub\/ina226.pdf<\/div><\/div><div class=\"clear\"><\/div><\/div><\/a><\/div><\/div>\n<p><span style=\"font-size: 14pt;\">\u3053\u306e\u3042\u305f\u308a\u304c\u30d2\u30f3\u30c8\u306b\u306a\u308a\u305d\u3046\u3060\u3051\u3069\u3001\u3053\u306e\u5f8c\u306e\u8aac\u660e\u304c\u3088\u304f\u308f\u304b\u3093\u306a\u3044\u3002\u3068\u3044\u3046\u304b\u3001\u307e\u3058\u3081\u306b\u8aad\u3093\u3067\u305f\u3093\u3060\u3051\u3069\u3001\u3060\u3093\u3060\u3093<strong><span style=\"font-size: 18pt; color: #ff6600;\">\u300c<\/span><span style=\"font-size: 18pt; color: #ff6600;\">\u3053\u308c\u8aad\u3080\u306a\u3089\u30e9\u30a4\u30d6\u30e9\u30ea\u63a2\u3057\u305f\u307b\u3046\u304c\u306f\u3084\u304f\u306d\uff1f\u300d<\/span><\/strong>\u3068\u624b\u629c\u304d\u60aa\u9b54\u306e\u3055\u3055\u3084\u304d\u304c\u30fb\u30fb\u30fbw<\/span><\/p>\n<div class=\"linkcard\"><div class=\"lkc-external-wrap\"><a class=\"lkc-link no_icon\" href=\"https:\/\/circuitpython.readthedocs.io\/projects\/ina260\/en\/latest\/\" data-lkc-id=\"561\" target=\"_blank\" rel=\"external noopener\"><div class=\"lkc-card\"><div class=\"lkc-info\"><div class=\"lkc-favicon\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.google.com\/s2\/favicons?domain=circuitpython.readthedocs.io\" alt=\"\" width=\"16\" height=\"16\" \/><\/div><div class=\"lkc-domain\">circuitpython.readthedocs.io<\/div><\/div><div class=\"lkc-content\"><figure class=\"lkc-thumbnail\"><img decoding=\"async\" class=\"lkc-thumbnail-img\" src=\"https:\/\/s.wordpress.com\/mshots\/v1\/https%3A%2F%2Fcircuitpython.readthedocs.io%2Fprojects%2Fina260%2Fen%2Flatest%2F?w=100\" width=\"100px\" height=\"108px\" alt=\"\" \/><\/figure><div class=\"lkc-title\">Introduction \u2014 Adafruit INA260 Library 1.0 documentation<\/div><div class=\"lkc-url\" title=\"https:\/\/circuitpython.readthedocs.io\/projects\/ina260\/en\/latest\/\">https:\/\/circuitpython.readthedocs.io\/projects\/ina260\/en\/latest\/<\/div><\/div><div class=\"clear\"><\/div><\/div><\/a><\/div><\/div>\n<div class=\"linkcard\"><div class=\"lkc-external-wrap\"><a class=\"lkc-link no_icon\" href=\"https:\/\/learn.adafruit.com\/adafruit-ina260-current-voltage-power-sensor-breakout\/python-circuitpython\" data-lkc-id=\"562\" target=\"_blank\" rel=\"external noopener\"><div class=\"lkc-card\"><div class=\"lkc-info\"><div class=\"lkc-favicon\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.google.com\/s2\/favicons?domain=learn.adafruit.com\" alt=\"\" width=\"16\" height=\"16\" \/><\/div><div class=\"lkc-domain\">Adafruit Learning System<\/div><div class=\"lkc-share\"> <div class=\"lkc-sns-po\">1 Pocket<\/div><\/div><\/div><div class=\"lkc-content\"><figure class=\"lkc-thumbnail\"><img decoding=\"async\" class=\"lkc-thumbnail-img\" src=\"\/\/androiphone.uvs.jp\/wp-content\/uploads\/pz-linkcard\/cache\/08b76e79f8342d89094644e91d7503b2aceff2b00c22fa0abc0d9cf167c30034.jpeg\" width=\"100px\" height=\"108px\" alt=\"\" \/><\/figure><div class=\"lkc-title\">Adafruit INA260 Current + Voltage + Power Sensor Breakout<\/div><div class=\"lkc-url\" title=\"https:\/\/learn.adafruit.com\/adafruit-ina260-current-voltage-power-sensor-breakout\/python-circuitpython\">https:\/\/learn.adafruit.com\/adafruit-ina260-current-voltage-power-sensor-breakout\/python-circuitpython<\/div><div class=\"lkc-excerpt\">This breakout board may well be the last current sensing solution you every need to buy. Not only can it do the work of two multimeters, but it can do it with amazing precision and flexibility. With it you can measure the DC current and high or low side voltage, in addition to having it automatically calculate the power and do so over impressive voltage, current, and temperature ranges with better than 1% accuracy, all while delivering the data in an easy to use format over I2C.<\/div><\/div><div class=\"clear\"><\/div><\/div><\/a><\/div><\/div>\n<p><span style=\"font-size: 14pt;\">\u3084\u3063\u3071\u308a\u3068\u3044\u3046\u304b\u30fb\u30fb\u30fb\u6b21\u306e\u77ac\u9593\u3001\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3092\u8aad\u3080\u306e\u3092\u3084\u3081\u3066\u3001\u4e0a\u306e2\u30b5\u30a4\u30c8\u3092\u8aad\u3093\u3067\u307e\u3057\u305f\u3002\u4e0a\u306e\u65b9\u306e\u30b5\u30a4\u30c8\u3092\u8aad\u3080\u3068\u3001adafruit-circuitpython-ina260\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092Python3\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u4ee5\u4e0b\u306e\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u52d5\u304b\u3059\u3068\u66f8\u3044\u3066\u3042\u308b\u3002\u304a\u305d\u3089\u304fPython3\u306e\u307f\u306e\u5bfe\u5fdc\u3068\u306a\u3063\u3066\u3044\u308b\u307f\u305f\u3044\u3060\u304c\u3001\u305d\u3063\u3061\u306e\u307b\u3046\u304c\u597d\u90fd\u5408\uff5e\u3002<\/span><\/p>\n<p><span style=\"font-size: 14pt;\">\u8a00\u308f\u308c\u305f\u901a\u308a\u3001PyPI\u306b\u3088\u308b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u6307\u793a\u901a\u308a\u306b\u9032\u3081\u308b(\u7406\u89e3\u3057\u3066\u306a\u3044w)<\/span><\/p>\n<pre class=\"lang:default decode:true\">sudo pip3 install adafruit-circuitpython-ina260<\/pre>\n<p><span style=\"font-size: 14pt;\">\u2191\u30b3\u30de\u30f3\u30c9\u3092\u53e9\u3044\u3066(\u53e9\u3044\u3066\u3059\u3089\u306a\u3044\u30b3\u30d4\u30daw)\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u305f\u3002\u3068\u304f\u306b\u30a8\u30e9\u30fc\u3082\u306a\u304f\u9032\u307f\u4e0b\u306e\u30b3\u30fc\u30c9\u3092Python\u30a8\u30c7\u30a3\u30c3\u30bf\u306b\u5165\u308c\u3066\u5b9f\u884c\u3057\u3066\u307f\u308b<\/span><\/p>\n<pre class=\"lang:python decode:true\">import time\r\nimport board\r\nimport adafruit_ina260\r\n\r\ni2c = board.I2C()\r\nina260 = adafruit_ina260.INA260(i2c) while True:\r\n    print(\"Current: %.2f Voltage: %.2f Power:%.2f\"\r\n        %(ina260.current, ina260.voltage, ina260.power))\r\n    time.sleep(1)<\/pre>\n<p><a href=\"http:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-29_9-29-54_No-00.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2331\" src=\"http:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-29_9-29-54_No-00-300x192.png\" alt=\"\" width=\"300\" height=\"192\" srcset=\"https:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-29_9-29-54_No-00-300x192.png 300w, https:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-29_9-29-54_No-00-768x492.png 768w, https:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-29_9-29-54_No-00-1024x656.png 1024w, https:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-29_9-29-54_No-00.png 1050w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14pt;\">\u96fb\u6d41\u3001\u96fb\u5727\u3001\u96fb\u529b\u304c\u8868\u793a\u3055\u308c\u305f\u3002<strong><span style=\"font-size: 18pt; color: #0000ff;\">\u624b\u629c\u304d\u3067\u7533\u3057\u8a33\u306a\u3044\u3051\u3069\u30e9\u30a4\u30d6\u30e9\u30ea\u3063\u3066\u307b\u3093\u3068\u4fbf\u5229<\/span><\/strong>(\u611f\u8b1d)\u3002\u3053\u308c\u306b\u624b\u3092\u52a0\u3048\u3066\u3001csv\u306b\u8a18\u9332\u3067\u304d\u308b\u3088\u3046\u306b\u66f8\u3044\u305f\u30b3\u30fc\u30c9\u304c\u3053\u308c\u3002CSV\u306e\u51e6\u7406\u3068\u304b\u6587\u5b57\u5217\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u51e6\u7406\u306f\u8abf\u3079\u305f\u3002\u4ed6\u8a00\u8a9e\u3067\u3082\u4f3c\u305f\u3088\u3046\u306a\u51e6\u7406\u306a\u306e\u3067\u3055\u3055\u3063\u3068\u66f8\u3044\u305f\u3002<\/span><\/p>\n<pre class=\"lang:python decode:true\"># -*- coding: utf-8 -*-\r\nimport csv\r\nfrom datetime import datetime\r\nimport signal\r\nimport time\r\nimport board\r\nimport adafruit_ina260\r\n\r\nREC_START_HOUR = 8\r\nREC_END_HOUR = 18\r\n\r\n\r\ndef task(arg1, arg2):\r\n\r\n    # \u96fb\u6d41\u30fb\u96fb\u5727\u30fb\u96fb\u529b\u306e\u53d6\u5f97\r\n    cur = ina260.current\r\n    vol = ina260.voltage\r\n    po  = ina260.power\r\n    \r\n    # \u65e5\u6642\u306e\u53d6\u5f97\r\n    _now = datetime.now()\r\n    today = _now.strftime(\"%Y-%m-%d\")\r\n    nowtime = _now.strftime(\"%H:%M:%S\")\r\n    file_end = _now.strftime(\"%Y%m%d\")\r\n    \r\n    print ('\u65e5\u4ed8 %s \u6642\u523b %s \u96fb\u6d41 %.2f mA \u96fb\u5727 %.2f V \u96fb\u529b %.2f mW' % (today,nowtime,cur,vol,po))\r\n    \r\n    if REC_START_HOUR&amp;amp;lt;= _now.hour &amp;amp;lt; REC_END_HOUR:\r\n        with open('\/home\/pi\/Desktop\/power\/power_%s.csv' % (file_end),'a') as f:\r\n            writer = csv.writer(f)\r\n            writer.writerow([today,nowtime,cur,vol,po])\r\n    else:\r\n        print('\u8a18\u9332\u6642\u9593\u5916')\r\n\r\ni2c = board.I2C()\r\nina260 = adafruit_ina260.INA260(i2c)\r\n\r\nsignal.signal(signal.SIGALRM, task)\r\nsignal.setitimer(signal.ITIMER_REAL, 0.1, 1) # \u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067Ctrl+C\u3067\u6b62\u3081\u3089\u308c\u308b\u3088\u3046\u306b\r\n\r\nwhile True:\r\n    time.sleep(1)<\/pre>\n<p><span style=\"font-size: 14pt;\">\u96d1\u306a\u30b3\u30fc\u30c9\u3067\u7533\u3057\u8a33\u306a\u3044\u3002\u65e5\u6bce\u306bCSV\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308a\u30018\u6642\uff5e18\u6642\u307e\u3067\u306e\u8a08\u6e2c\u5024\u3092\u4e00\u79d2\u3054\u3068\u306b\u8a18\u9332\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3002\u304a\u5f01\u5f53\u7bb1\u306b\u5165\u308c\u3066\u3001\u305a\u3063\u3068Zero\u3067\u52d5\u304b\u3057\u3066\u3044\u308b\u3051\u3069\u7279\u306b\u554f\u984c\u306a\u304f\u52d5\u3044\u3066\u308b\u69d8\u5b50\u3002<\/span><\/p>\n<p><a href=\"http:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/img_0587.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2258\" src=\"http:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/img_0587-300x225.jpg\" alt=\"\" width=\"385\" height=\"289\" srcset=\"https:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/img_0587-300x225.jpg 300w, https:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/img_0587-768x576.jpg 768w, https:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/img_0587-1024x768.jpg 1024w\" sizes=\"auto, (max-width: 385px) 100vw, 385px\" \/><\/a><a href=\"http:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-29_9-42-33_No-00.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2333\" src=\"http:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-29_9-42-33_No-00-300x176.png\" alt=\"\" width=\"496\" height=\"291\" srcset=\"https:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-29_9-42-33_No-00-300x176.png 300w, https:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-29_9-42-33_No-00-768x452.png 768w, https:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-29_9-42-33_No-00-1024x602.png 1024w, https:\/\/androiphone.uvs.jp\/wp-content\/uploads\/2019\/10\/SnapCrab_NoName_2019-10-29_9-42-33_No-00.png 1238w\" sizes=\"auto, (max-width: 496px) 100vw, 496px\" \/><\/a><\/p>\n<p><span style=\"font-size: 14pt;\">\u3067\u3001\u53d6\u5f97\u3057\u305f\u30c7\u30fc\u30bf\u3092\u30a8\u30af\u30bb\u30eb\u3067\u51e6\u7406\u3057\u305f\u7d50\u679c\u304c\u3053\u308c<\/span><span style=\"font-size: 14pt;\">\u3002\u4e00\u65e5\u4e2d\u6674\u5929\u6642\u306e\u8a08\u6e2c\u7d50\u679c\u3067\u826f\u597d\u306b\u53d6\u308c\u3066\u3044\u308b\u69d8\u5b50\u3002\u30e2\u30d0\u30a4\u30eb\u30d0\u30c3\u30c6\u30ea\u30fc\u5074\u3067\u5145\u96fb\u3092\u5236\u5fa1\u3057\u3066\u3044\u308b\u3057\u3001\u6d41\u308c\u305f\u96fb\u6d41\u304c\u3059\u3079\u3066\u5145\u96fb\u3067\u84c4\u3048\u3089\u308c\u3066\u3044\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u3051\u3069\u3001\u76ee\u306b\u898b\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u306e\u306f\u3001\u3068\u3066\u3082\u5206\u304b\u308a\u3084\u3059\u3044\u3002\u30c7\u30fc\u30bf\u3092\u305f\u3081\u3066\u8272\u3005\u898b\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3046\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306f\u3001\u30bb\u30f3\u30b5\u30fc\u3068\u30e9\u30ba\u30d1\u30a4\u306e\u63a5\u7d9a\u307e\u3067\u7d39\u4ecb\u3057\u305f\u3002 \u3053\u3053\u304b\u3089\u306f\u3084\u3063\u3068\u3001\u30b3\u30fc\u30c9\u3092\u4f7f\u3063\u3066\u96fb\u5727\u30fb\u96fb\u6d41\u3092\u8aad\u307f\u53d6\u3063\u3066\u3044\u3053\u3046\u3068\u304a\u3082\u3046\u3002 \u3053\u306e\u8fba\u304c\u53c2\u8003\u306b\u306a\u308b\u304b\u306a\u3041\u3068\u601d\u3063\u3066\u3001\u307e\u305a\u306f\u4e0a\u306e\u30b5\u30a4\u30c8\u306e\u901a\u308a\u306b\u63a5\u7d9a\u3057\u3066\u96fb\u5727\u8868\u793a\u307e\u3067\u3057\u3066\u307f\u305f\u3002Mu\u3092\u8d77\u52d5\u3057 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2258,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"http:\/\/androiphone.uvs.jp\/?p=2306","footnotes":""},"categories":[58,56,59],"tags":[],"class_list":["post-2306","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-raspberry-pi","category-59","ja"],"_links":{"self":[{"href":"https:\/\/androiphone.uvs.jp\/index.php?rest_route=\/wp\/v2\/posts\/2306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/androiphone.uvs.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/androiphone.uvs.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/androiphone.uvs.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/androiphone.uvs.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2306"}],"version-history":[{"count":16,"href":"https:\/\/androiphone.uvs.jp\/index.php?rest_route=\/wp\/v2\/posts\/2306\/revisions"}],"predecessor-version":[{"id":4133,"href":"https:\/\/androiphone.uvs.jp\/index.php?rest_route=\/wp\/v2\/posts\/2306\/revisions\/4133"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/androiphone.uvs.jp\/index.php?rest_route=\/wp\/v2\/media\/2258"}],"wp:attachment":[{"href":"https:\/\/androiphone.uvs.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/androiphone.uvs.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/androiphone.uvs.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}