{"action":"created","issue":{"url":"https://api.github.com/repos/arduino/ArduinoCore-samd/issues/28","labels_url":"https://api.github.com/repos/arduino/ArduinoCore-samd/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/arduino/ArduinoCore-samd/issues/28/comments","events_url":"https://api.github.com/repos/arduino/ArduinoCore-samd/issues/28/events","html_url":"https://github.com/arduino/ArduinoCore-samd/issues/28","id":102616432,"number":28,"title":"the pin mode is changed to INPUT mode","user":{"login":"Makeblock-official","id":5137367,"avatar_url":"https://avatars.githubusercontent.com/u/5137367?v=3","gravatar_id":"","url":"https://api.github.com/users/Makeblock-official","html_url":"https://github.com/Makeblock-official","followers_url":"https://api.github.com/users/Makeblock-official/followers","following_url":"https://api.github.com/users/Makeblock-official/following{/other_user}","gists_url":"https://api.github.com/users/Makeblock-official/gists{/gist_id}","starred_url":"https://api.github.com/users/Makeblock-official/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Makeblock-official/subscriptions","organizations_url":"https://api.github.com/users/Makeblock-official/orgs","repos_url":"https://api.github.com/users/Makeblock-official/repos","events_url":"https://api.github.com/users/Makeblock-official/events{/privacy}","received_events_url":"https://api.github.com/users/Makeblock-official/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-23T12:57:55Z","updated_at":"2015-09-04T14:43:00Z","closed_at":null,"body":"on file wiring.c line 87(Fun init()) Setup all pins (digital and analog) in INPUT mode (default is nothing) \r\nPin mode should not be set.This line should comment.\r\n\r\non file wiring_digital.c line 81 (Fun digitalWrite()) Enable pull-up resistor.\r\nThis line should comment.\r\n\r\n\r\nThe pin mode will be initialized when construct the object.\r\n\r\nFor example:\r\n\r\n```C++\r\nclass LED\r\n{\r\n  public:\r\n    LED(int pin);\r\n    void low();\r\n    void high();\r\n  private:\r\n    int led_pin;\r\n};\r\n\r\nLED::LED(int pin)\r\n{\r\n  led_pin = pin;\r\n  pinMode(led_pin, OUTPUT) ;\r\n}\r\n\r\nvoid LED::low()\r\n{\r\n  digitalWrite(led_pin, LOW);\r\n}\r\nvoid LED::high()\r\n{\r\n  digitalWrite(led_pin, HIGH);\r\n}\r\n\r\nLED led(13);\r\nvoid setup() {\r\n}\r\n\r\nvoid loop() {\r\n  led.high();\r\n  delay(1000);\r\n  led.low();\r\n  delay(1000);\r\n}\r\n```\r\n\r\nSince the pin mode is changed to INPUT,led.high() is set to input pull-up and led.low() is set to input pull-down.So the led will be very dark.\r\n"},"comment":{"url":"https://api.github.com/repos/arduino/ArduinoCore-samd/issues/comments/137754433","html_url":"https://github.com/arduino/ArduinoCore-samd/issues/28#issuecomment-137754433","issue_url":"https://api.github.com/repos/arduino/ArduinoCore-samd/issues/28","id":137754433,"user":{"login":"aethaniel","id":699018,"avatar_url":"https://avatars.githubusercontent.com/u/699018?v=3","gravatar_id":"","url":"https://api.github.com/users/aethaniel","html_url":"https://github.com/aethaniel","followers_url":"https://api.github.com/users/aethaniel/followers","following_url":"https://api.github.com/users/aethaniel/following{/other_user}","gists_url":"https://api.github.com/users/aethaniel/gists{/gist_id}","starred_url":"https://api.github.com/users/aethaniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aethaniel/subscriptions","organizations_url":"https://api.github.com/users/aethaniel/orgs","repos_url":"https://api.github.com/users/aethaniel/repos","events_url":"https://api.github.com/users/aethaniel/events{/privacy}","received_events_url":"https://api.github.com/users/aethaniel/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T14:43:00Z","updated_at":"2015-09-04T14:43:00Z","body":"Indeed, the pull-up should be set only on a digitalWrite(pin, HIGH) when pin is in INPUT mode."}}