{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/pxt-microbit/issues/83","repository_url":"https://api.github.com/repos/Microsoft/pxt-microbit","labels_url":"https://api.github.com/repos/Microsoft/pxt-microbit/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/pxt-microbit/issues/83/comments","events_url":"https://api.github.com/repos/Microsoft/pxt-microbit/issues/83/events","html_url":"https://github.com/Microsoft/pxt-microbit/issues/83","id":157364717,"number":83,"title":"radio.sendValue() usage/issues","user":{"login":"gbaman","id":833193,"avatar_url":"https://avatars.githubusercontent.com/u/833193?v=3","gravatar_id":"","url":"https://api.github.com/users/gbaman","html_url":"https://github.com/gbaman","followers_url":"https://api.github.com/users/gbaman/followers","following_url":"https://api.github.com/users/gbaman/following{/other_user}","gists_url":"https://api.github.com/users/gbaman/gists{/gist_id}","starred_url":"https://api.github.com/users/gbaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbaman/subscriptions","organizations_url":"https://api.github.com/users/gbaman/orgs","repos_url":"https://api.github.com/users/gbaman/repos","events_url":"https://api.github.com/users/gbaman/events{/privacy}","received_events_url":"https://api.github.com/users/gbaman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-29T01:42:24Z","updated_at":"2016-06-04T17:24:48Z","closed_at":null,"body":"So I am not 100% sure how to use ```radio.sendValue()```, or more precisely how to receive it on the other end? Sending a name/value pair is something that could be pretty useful, but right now I can't seem to find a way to get both parts from another micro:bit?\r\nI would have thought, to get it you simply use ```radio.receiveNumber()``` and ```radio.receiveString()``` one after each other in the ```radio.onDataReceived``` handler, but that always just gets the part I am requesting first.\r\nFor example, the below program will display ```42``` on the display, but nothing else when A button is pressed. The \"Hello\" seems to get lost in the ether.   \r\n```Typescript\r\ninput.onButtonPressed(Button.A, () => {\r\n    radio.sendValue(\"Hello\", 42);\r\n});\r\nradio.onDataReceived(() => {\r\n    basic.showNumber(radio.receiveNumber());\r\n    basic.showString(radio.receiveString());\r\n});\r\n```\r\nAt the same time, if you switch around the 2 show lines, then Hello will be displayed on the display but no 42 then.\r\nIs there a more correct way to be using it?\r\n\r\nThe only way I can seem to get both is by using ```radio.writeValueToSerial()```, but of course then that means I can't use it on that micro:bit itself."},"comment":{"url":"https://api.github.com/repos/Microsoft/pxt-microbit/issues/comments/223767583","html_url":"https://github.com/Microsoft/pxt-microbit/issues/83#issuecomment-223767583","issue_url":"https://api.github.com/repos/Microsoft/pxt-microbit/issues/83","id":223767583,"user":{"login":"gbaman","id":833193,"avatar_url":"https://avatars.githubusercontent.com/u/833193?v=3","gravatar_id":"","url":"https://api.github.com/users/gbaman","html_url":"https://github.com/gbaman","followers_url":"https://api.github.com/users/gbaman/followers","following_url":"https://api.github.com/users/gbaman/following{/other_user}","gists_url":"https://api.github.com/users/gbaman/gists{/gist_id}","starred_url":"https://api.github.com/users/gbaman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbaman/subscriptions","organizations_url":"https://api.github.com/users/gbaman/orgs","repos_url":"https://api.github.com/users/gbaman/repos","events_url":"https://api.github.com/users/gbaman/events{/privacy}","received_events_url":"https://api.github.com/users/gbaman/received_events","type":"User","site_admin":false},"created_at":"2016-06-04T17:24:48Z","updated_at":"2016-06-04T17:24:48Z","body":"@damianburrin that shouldn't be an issue given it is the same hex file being copied onto both micro:bits. Means the same group is used for both even if you don't define it."}}
{"actor":{"display_login":"gbaman"}}