Skip to content

Instantly share code, notes, and snippets.

@mokele
Created April 15, 2013 22:41
Show Gist options
  • Save mokele/5391900 to your computer and use it in GitHub Desktop.
Save mokele/5391900 to your computer and use it in GitHub Desktop.
1> Pins = [23, 24, 25].
[23,24,25]
2> [pie:gpio_init(Pin, input) || Pin <- Pins].
[ok,ok,ok]
3> io:format("~p~n", [{[[pie:gpio_read(Pin) || Pin <- Pins] || _ <- lists:seq(1, 100)]}]).
{[[0,0,0],
[0,0,0],
...
ok
4> io:format("~p~n", [{[[pie:gpio_read(Pin) || Pin <- Pins] || _ <- lists:seq(1, 100)]}]).
{[[0,0,0],
[0,0,0],
...
ok
5> io:format("~p~n", [{[[pie:gpio_read(Pin) || Pin <- Pins] || _ <- lists:seq(1, 100)]}]).
{[[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
[0,0,0],
...
[0,0,value],
[value,value,value],
[value,value,value],
...
[value,value,24],
[24,24,24],
[24,24,24],
[24,24,24],
[24,24,24],
...
[24,24,24],
[pie,pie,pie],
[pie,pie,pie],
[pie,pie,pie],
[pie,pie,pie],
[pie,pie,pie]}
ok
7>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment