Skip to content

Commit d6db9b9

Browse files
authored
Merge pull request #6 from scls19fr/patch-1
Syntax highlight
2 parents a30a6cd + 9ab315c commit d6db9b9

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

README.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ SenseHat.jl is a Julia library for interacting with the Raspberry Pi [Sense HAT]
44

55
SenseHat.jl requires the Raspbian `sense-hat` package:
66

7-
sudo apt-get update
8-
sudo apt-get install sense-hat
9-
sudo reboot
7+
```bash
8+
sudo apt-get update
9+
sudo apt-get install sense-hat
10+
sudo reboot
11+
```
1012

1113
## LED matrix
1214

@@ -15,34 +17,39 @@ values (from [ColorTypes.jl](https://github.com/JuliaGraphics/ColorTypes.jl)) wh
1517
memory-mapped to the frame buffer of the LED matrix. `led_clear()` is a convenience
1618
function for resetting the LED matrix to black.
1719

18-
using SenseHat
19-
using ColorTypes
20+
```julia
21+
using SenseHat
22+
using ColorTypes
2023

21-
const LED = led_matrix()
24+
const LED = led_matrix()
2225

23-
LED[:] = SenseHat.JULIA_LOGO
24-
sleep(3)
25-
led_clear()
26+
LED[:] = SenseHat.JULIA_LOGO
27+
sleep(3)
28+
led_clear()
29+
```
2630

2731
## Joystick
2832

2933
In the `Stick` module there is `readstick()` which will block until the joystick is
3034
manipulated, returning a `StickEvent`:
3135

32-
using SenseHat
36+
```julia
37+
using SenseHat
3338

34-
e = readstick()
39+
e = readstick()
40+
```
3541

3642
For querying within a loop, use a `Channel` to create a buffer of `StickEvent`.
3743

38-
using SenseHat
44+
```julia
45+
using SenseHat
3946

40-
c = Channel{StickEvent}(32)
41-
42-
@async while true
43-
put!(c, readstick())
44-
end
47+
c = Channel{StickEvent}(32)
4548

49+
@async while true
50+
put!(c, readstick())
51+
end
52+
```
4653

4754
## Sensors
4855

0 commit comments

Comments
 (0)