Skip to content

Commit b13f1d9

Browse files
committed
OK fine i did more
1 parent 781f4fc commit b13f1d9

File tree

4 files changed

+42
-37
lines changed

4 files changed

+42
-37
lines changed

docs/TiLDA_MK3/API/index.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,12 @@
33
- [documentation](http://docs.micropython.org/en/latest/pyboard/) -
44
General Micropython library
55
- [uGFX](ugfx.md) - The TiLDA LCD colour screen
6-
- <a href="TiLDA_MK3/documentation/cc3100" class="wikilink"
7-
title="CC3100">CC3100</a> - The wifi chip
8-
- <a href="TiLDA_MK3/rtc" class="wikilink" title="RTC">RTC</a> (real
9-
time clock)
10-
- <a href="TiLDA_MK3/adc" class="wikilink" title="ADC">ADC</a> (analogue
11-
reading)
12-
- <a href="TiLDA_MK3/timer" class="wikilink" title="Timer">Timer</a>
6+
- [RTC](rtc.md) - Real time clock
7+
- [ADC](adc.md) - Analogue reading
8+
- [Timer](timer.md)
139
- Microcontroller peripherals
1410
[1](https://docs.micropython.org/en/latest/pyboard/library/pyb.html)
15-
(Timers, PWM, serial,
16-
<a href="TiLDA_MK3/spi" class="wikilink" title="SPI">SPI</a> etc)
11+
(Timers, PWM, serial, [SPI](spi.md) etc)
1712

1813
## TiLDA Libraries
1914

docs/TiLDA_MK3/API/spi.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ SPI1 is used for the board's onboard wifi.
77
SPI2 is exposed on the 'X' header, under the white silkscreen section
88
for your name.
99

10-
from pyb import SPI
10+
```python
11+
from pyb import SPI
1112

12-
spi = SPI(2) #create SPI on port 2
13-
spi.init(SPI.MASTER) #set the mode. Other things like baudrate=80000, polarity=1, phase=0, crc=None can be set here
13+
spi = SPI(2) #create SPI on port 2
14+
spi.init(SPI.MASTER) #set the mode. Other things like baudrate=80000, polarity=1, phase=0, crc=None can be set here
1415

15-
spi.send(170) #send int byte
16-
spi.send(b'\xAA') #send hex byte
16+
spi.send(170) #send int byte
17+
spi.send(b'\xAA') #send hex byte
18+
```

docs/TiLDA_MK3/API/timer.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,38 @@ True: pass".
1111

1212
## Function callbacks
1313

14-
flag = 0
14+
```python
15+
flag = 0
1516

16-
#note, this callback needs to take one parameter, which is what timer is calling it
17-
def tim_callback(t):
18-
global flag
19-
flag = 1
17+
#note, this callback needs to take one parameter, which is what timer is calling it
18+
def tim_callback(t):
19+
global flag
20+
flag = 1
2021

21-
timer = pyb.Timer(3)
22-
timer.init(freq=1)
23-
timer.callback(tim_callback)
22+
timer = pyb.Timer(3)
23+
timer.init(freq=1)
24+
timer.callback(tim_callback)
2425

25-
....
26+
....
2627

27-
timer.deinit()
28+
timer.deinit()
29+
```
2830

2931
or, using lambdas
3032

31-
flag = 0
33+
```python
34+
flag = 0
3235

33-
#the use of lambda avoids needing the function to take an argument
34-
def tim_callback():
35-
global flag
36-
flag = 1
36+
#the use of lambda avoids needing the function to take an argument
37+
def tim_callback():
38+
global flag
39+
flag = 1
3740

38-
timer = pyb.Timer(3)
39-
timer.init(freq=1)
40-
timer.callback(lambda t: tim_callback())
41+
timer = pyb.Timer(3)
42+
timer.init(freq=1)
43+
timer.callback(lambda t: tim_callback())
4144

42-
....
45+
....
4346

44-
timer.deinit()
47+
timer.deinit()
48+
```

docs/TiLDA_MK3/API/wifi.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22

33
A simple json document in the root directory of the badge:
44

5-
{"ssid":"your-wifi-name","pw":"your-wifi-password"}
5+
```json
6+
{"ssid":"your-wifi-name","pw":"your-wifi-password"}
7+
```
68

79
If you're connecting to an open wifi you can leave out the "pw" :
810

9-
{"ssid":"your-unsecured-wifi-name"}
11+
```json
12+
{"ssid":"your-unsecured-wifi-name"}
13+
```
1014

1115
Most badge apps that use the wifi chip will expect a wifi.json file to
1216
exist. Please make sure it's valid json and that both name and password
1317
are in the correct case.
1418

1519
Please make sure to "eject" the usb storage properly before restarting
16-
the badge.
20+
the badge.

0 commit comments

Comments
 (0)