{"action":"created","issue":{"url":"https://api.github.com/repos/frp-arduino/frp-arduino/issues/12","labels_url":"https://api.github.com/repos/frp-arduino/frp-arduino/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/frp-arduino/frp-arduino/issues/12/comments","events_url":"https://api.github.com/repos/frp-arduino/frp-arduino/issues/12/events","html_url":"https://github.com/frp-arduino/frp-arduino/issues/12","id":54626882,"number":12,"title":"Problem: Can not use LCD display from DSL","user":{"login":"rickardlindberg","id":341963,"avatar_url":"https://avatars.githubusercontent.com/u/341963?v=3","gravatar_id":"","url":"https://api.github.com/users/rickardlindberg","html_url":"https://github.com/rickardlindberg","followers_url":"https://api.github.com/users/rickardlindberg/followers","following_url":"https://api.github.com/users/rickardlindberg/following{/other_user}","gists_url":"https://api.github.com/users/rickardlindberg/gists{/gist_id}","starred_url":"https://api.github.com/users/rickardlindberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickardlindberg/subscriptions","organizations_url":"https://api.github.com/users/rickardlindberg/orgs","repos_url":"https://api.github.com/users/rickardlindberg/repos","events_url":"https://api.github.com/users/rickardlindberg/events{/privacy}","received_events_url":"https://api.github.com/users/rickardlindberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-01-16T21:25:51Z","updated_at":"2015-01-22T07:28:37Z","closed_at":null,"body":"I don't have a particular project I want to build using this DSL. I have a Arduino starter kit with a book full of examples. I've been trying to implement some examples in the DSL to have something to work on. As the examples get more complex, the language has to be extended or improved.\r\n\r\nThe next thing I'm interested in using is a LCD display.\r\n\r\nI first solution would be just to print a single character on the first cell of the LCD.\r\n\r\nThen extend to being able to print strings at arbitrary positions."},"comment":{"url":"https://api.github.com/repos/frp-arduino/frp-arduino/issues/comments/70981426","html_url":"https://github.com/frp-arduino/frp-arduino/issues/12#issuecomment-70981426","issue_url":"https://api.github.com/repos/frp-arduino/frp-arduino/issues/12","id":70981426,"user":{"login":"rickardlindberg","id":341963,"avatar_url":"https://avatars.githubusercontent.com/u/341963?v=3","gravatar_id":"","url":"https://api.github.com/users/rickardlindberg","html_url":"https://github.com/rickardlindberg","followers_url":"https://api.github.com/users/rickardlindberg/followers","following_url":"https://api.github.com/users/rickardlindberg/following{/other_user}","gists_url":"https://api.github.com/users/rickardlindberg/gists{/gist_id}","starred_url":"https://api.github.com/users/rickardlindberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rickardlindberg/subscriptions","organizations_url":"https://api.github.com/users/rickardlindberg/orgs","repos_url":"https://api.github.com/users/rickardlindberg/repos","events_url":"https://api.github.com/users/rickardlindberg/events{/privacy}","received_events_url":"https://api.github.com/users/rickardlindberg/received_events","type":"User","site_admin":false},"created_at":"2015-01-22T07:28:37Z","updated_at":"2015-01-22T07:28:37Z","body":"My last attempt at a solution to this problem looked like this:\r\n\r\n```haskell\r\nlcd :: Output Bit\r\n    -> Output Bit\r\n    -> Output Bit\r\n    -> Output Bit\r\n    -> Output Bit\r\n    -> Output Bit\r\n    -> Stream Word\r\n    -> Action ()\r\nlcd enable rs d4 d5 d6 d7 stream = do\r\n    x <- def stream\r\n    rs     =: x ~> mapS (getBit 4)\r\n    d4     =: x ~> mapS (getBit 3)\r\n    d5     =: x ~> mapS (getBit 2)\r\n    d6     =: x ~> mapS (getBit 1)\r\n    d7     =: x ~> mapS (getBit 0)\r\n    enable =: x ~> mapS (\\_ -> listConstant [ delayMicroseconds 10 bitHigh\r\n                                            , delayMicroseconds 10 bitLow\r\n                                            ])\r\n                ~> flattenS\r\n```\r\n\r\nBut I was unable to figure out how to implement the delays. Not sure how to proceed with this. Maybe I will just solve some other problems and the solution to this will become apparent later :-)"}}