{"action":"created","issue":{"url":"https://api.github.com/repos/ev3dev/ev3dev-lang-python/issues/450","repository_url":"https://api.github.com/repos/ev3dev/ev3dev-lang-python","labels_url":"https://api.github.com/repos/ev3dev/ev3dev-lang-python/issues/450/labels{/name}","comments_url":"https://api.github.com/repos/ev3dev/ev3dev-lang-python/issues/450/comments","events_url":"https://api.github.com/repos/ev3dev/ev3dev-lang-python/issues/450/events","html_url":"https://github.com/ev3dev/ev3dev-lang-python/issues/450","id":306258513,"number":450,"title":"Pixy  EV3DEV Problem Python3","user":{"login":"kazerko","id":37512353,"avatar_url":"https://avatars3.githubusercontent.com/u/37512353?v=4","gravatar_id":"","url":"https://api.github.com/users/kazerko","html_url":"https://github.com/kazerko","followers_url":"https://api.github.com/users/kazerko/followers","following_url":"https://api.github.com/users/kazerko/following{/other_user}","gists_url":"https://api.github.com/users/kazerko/gists{/gist_id}","starred_url":"https://api.github.com/users/kazerko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazerko/subscriptions","organizations_url":"https://api.github.com/users/kazerko/orgs","repos_url":"https://api.github.com/users/kazerko/repos","events_url":"https://api.github.com/users/kazerko/events{/privacy}","received_events_url":"https://api.github.com/users/kazerko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-03-18T17:07:37Z","updated_at":"2018-03-18T23:00:17Z","closed_at":null,"author_association":"NONE","body":"hi, i need help with my code, after 5 hours trying i cant fix it :/\r\n\r\n- **ev3dev version:** 4.4.87-22-ev3dev-ev3\r\n- **ev3dev-lang-python version:** 3\r\n\r\n**my code**:\r\n```python\r\n#!/usr/bin/env python3\r\nfrom ev3dev.ev3 import *\r\nimport ev3dev.fonts as fonts\r\nfrom PIL import Image, ImageDraw, ImageFont  # this line is optional\r\n\r\nlcd = Screen()\r\n\r\n# Connect Pixy camera\r\npixy = Sensor(address=INPUT_1)\r\n#pixy = Sensor(address='in1:i2c1', driver_name='pixy-lego')\r\nassert pixy.connected, \"Error while connecting Pixy camera to port\"\r\n\r\n#Pixy nacitany\r\nprint(\"-Pixy nacitany\")\r\n\r\n# Connect LargeMotors\r\nrmotor = LargeMotor(OUTPUT_A)\r\nassert rmotor.connected, \"Error while connecting right motor\"\r\nlmotor = LargeMotor(OUTPUT_B)\r\nassert lmotor.connected, \"Error while connecting left motor\"\r\n\r\n#motory nacitane\r\nprint(\"-motory nacitane\")\r\n\r\n# Connect TouchSensor\r\nts = TouchSensor(address=INPUT_4)\r\nassert ts.connected, \"Connecting TouchSensor\"\r\n\r\n#TouchSensor nacitany\r\nprint(\"-TouchSensor nacitany\")\r\n\r\n# Set mode\r\npixy.mode = 'TRACK'\r\n\r\n\r\nwhile not ts.value():\r\n  lcd.clear()\r\n  if pixy.value(0) != 0:  # Object with SIG1 detected\r\n    x = pixy.value(1) \r\n    y = pixy.value(2)\r\n    w = pixy.value(3)\r\n    h = pixy.value(4)\r\n    dx = int(w/2)       # Half of the width of the rectangle\r\n    dy = int(h/2)       # Half of the height of the rectangle\r\n    xa = x - int(w/2)   # X-coordinate of bottom-right corner\r\n    ya = y + int(h/2)   # Y-coordinate of the bottom-right corner\r\n    xb = x + int(w/2)   # X-coordinate of bottom-right corner\r\n    yb = y - int(h/2)   # Y-coordinate of the bottom-right corner\r\n    lcd.draw.text((0,0), \"Zaciatok Y:\" + str(x), fill='black')\r\n    lcd.draw.text((0,20), \"Zaciatok X:\" + str(y), fill='black')\r\n    lcd.draw.text((0,40), \"Koniec Y:\" + str(w), fill='black')\r\n    lcd.draw.text((0,60), \"Koniec X:\" + str(h), fill='black')\r\n    lcd.draw.text((40,80), \"Stred Y:\" + str(x-w), fill='black')\r\n    lcd.draw.text((40,100), \"Stred X:\" + str(y-h), fill='black')\r\n    lcd.update()\r\n    rmotor.run_to_rel_pos(position_sp=xa, speed_sp=-10, stop_action=\"coast\")\r\n    lmotor.run_to_rel_pos(position_sp=ya, speed_sp=10, stop_action=\"coast\")\r\n    \r\n#koniec kodu\r\nprint(\"-koniec kodu\")\r\n```\r\n\r\n**and this is output:**\r\n```\r\nTraceback (most recent call last):\r\n \r\n File \"test.py\", line 38, in <module>\r\n    if pixy.value(0) != 0:  # Object with SIG1 detected\r\n \r\n File \"/usr/lib/python3/dist-packages/ev3dev/core.py\", line 1758, in value\r\n    self._value[n], value = self.get_attr_int(self._value[n], 'value'+str(n))\r\n \r\n File \"/usr/lib/python3/dist-packages/ev3dev/core.py\", line 214, in get_attr_int\r\n    attribute, value = self._get_attribute(attribute, name)\r\n  \r\nFile \"/usr/lib/python3/dist-packages/ev3dev/core.py\", line 196, in _get_attribute\r\n    return attribute, attribute.read().strip().decode()\r\nKeyboardInterrupt\r\n```\r\n\r\nthanks for help "},"comment":{"url":"https://api.github.com/repos/ev3dev/ev3dev-lang-python/issues/comments/374062689","html_url":"https://github.com/ev3dev/ev3dev-lang-python/issues/450#issuecomment-374062689","issue_url":"https://api.github.com/repos/ev3dev/ev3dev-lang-python/issues/450","id":374062689,"user":{"login":"kazerko","id":37512353,"avatar_url":"https://avatars3.githubusercontent.com/u/37512353?v=4","gravatar_id":"","url":"https://api.github.com/users/kazerko","html_url":"https://github.com/kazerko","followers_url":"https://api.github.com/users/kazerko/followers","following_url":"https://api.github.com/users/kazerko/following{/other_user}","gists_url":"https://api.github.com/users/kazerko/gists{/gist_id}","starred_url":"https://api.github.com/users/kazerko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazerko/subscriptions","organizations_url":"https://api.github.com/users/kazerko/orgs","repos_url":"https://api.github.com/users/kazerko/repos","events_url":"https://api.github.com/users/kazerko/events{/privacy}","received_events_url":"https://api.github.com/users/kazerko/received_events","type":"User","site_admin":false},"created_at":"2018-03-18T23:00:17Z","updated_at":"2018-03-18T23:00:17Z","author_association":"NONE","body":"@dlech hm, thanks, i see that i can use only single object with this, but i will need to use two objects in final project\r\n\r\nit means that i need to use  I2C Sensors???\r\n\r\ncan i ask for help in next days please?...if i will need"}}
{"actor":{"display_login":"kazerko"}}