Skip to content

Commit 7680b5a

Browse files
committed
changed to use .. code-block
1 parent 1e76950 commit 7680b5a

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

README.rst

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -34,39 +34,39 @@ This is easily achieved by downloading
3434
Usage Example
3535
=============
3636

37-
```
38-
import busio
39-
import digitalio
40-
from board import SCK, MOSI, MISO, D2, D2
41-
42-
from adafruit_rgb_display import color565
43-
import adafruit_rgb_display.ili9341 as ili9341
44-
45-
46-
# Configuration for CS and DC pins:
47-
CS_PIN = D2
48-
DC_PIN = D3
49-
50-
# Setup SPI bus using hardware SPI:
51-
spi = busio.SPI(clock=SCK, MOSI=MOSI, MISO=MISO)
52-
53-
# Create the ILI9341 display:
54-
display = ili9341.ILI9341(spi, cs=digitalio.DigitalInOut(CS_PIN),
55-
dc=digitalio.DigitalInOut(DC_PIN))
56-
57-
# Main loop:
58-
while True:
59-
# Clear the display
60-
display.fill(0)
61-
# Draw a red pixel in the center.
62-
display.pixel(120, 160, color565(255, 0, 0))
63-
# Pause 2 seconds.
64-
time.sleep(2)
65-
# Clear the screen blue.
66-
display.fill(color565(0, 0, 255))
67-
# Pause 2 seconds.
68-
time.sleep(2)
69-
```
37+
.. code-block:: python
38+
39+
import busio
40+
import digitalio
41+
from board import SCK, MOSI, MISO, D2, D2
42+
43+
from adafruit_rgb_display import color565
44+
import adafruit_rgb_display.ili9341 as ili9341
45+
46+
47+
# Configuration for CS and DC pins:
48+
CS_PIN = D2
49+
DC_PIN = D3
50+
51+
# Setup SPI bus using hardware SPI:
52+
spi = busio.SPI(clock=SCK, MOSI=MOSI, MISO=MISO)
53+
54+
# Create the ILI9341 display:
55+
display = ili9341.ILI9341(spi, cs=digitalio.DigitalInOut(CS_PIN),
56+
dc=digitalio.DigitalInOut(DC_PIN))
57+
58+
# Main loop:
59+
while True:
60+
# Clear the display
61+
display.fill(0)
62+
# Draw a red pixel in the center.
63+
display.pixel(120, 160, color565(255, 0, 0))
64+
# Pause 2 seconds.
65+
time.sleep(2)
66+
# Clear the screen blue.
67+
display.fill(color565(0, 0, 255))
68+
# Pause 2 seconds.
69+
time.sleep(2)
7070
7171
API Reference
7272
=============

0 commit comments

Comments
 (0)