Modify readme.md
This commit is contained in:
parent
41996adf11
commit
bbe56ee9cf
21
README.md
21
README.md
@ -10,10 +10,10 @@ Create gesture events.
|
|||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
grove.onGesture(GroveGesture.Up, () => {
|
grove.onGesture(GroveGesture.Up, () => {
|
||||||
basic.showString("Up")
|
basic.showString("Up");
|
||||||
})
|
})
|
||||||
grove.onGesture(GroveGesture.Down, () => {
|
grove.onGesture(GroveGesture.Down, () => {
|
||||||
basic.showString("Down")
|
basic.showString("Down");
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -22,15 +22,13 @@ grove.onGesture(GroveGesture.Down, () => {
|
|||||||
Measure distance in centimeters, specify the signal pin.
|
Measure distance in centimeters, specify the signal pin.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
let distance = 0
|
let distance = grove.measureInCentimeters(DigitalPin.P0);
|
||||||
distance = grove.measureInCentimeters(DigitalPin.P0)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Measure distance in inches, specify the signal pin.
|
Measure distance in inches, specify the signal pin.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
let distance = 0
|
let distance = grove.measureInInches(DigitalPin.P0);
|
||||||
distance = grove.measureInInches(DigitalPin.P0)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Grove - 4 digital display
|
### Grove - 4 digital display
|
||||||
@ -38,16 +36,11 @@ distance = grove.measureInInches(DigitalPin.P0)
|
|||||||
Create a 4 Digital Display driver, specify the clk and data pin, and set the brightness level, then start display value.
|
Create a 4 Digital Display driver, specify the clk and data pin, and set the brightness level, then start display value.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
let display: grove.TM1637 = null
|
let display = grove.createDisplay(DigitalPin.P0, DigitalPin.P1);
|
||||||
display = grove.createDisplay(DigitalPin.P0, DigitalPin.P1)
|
display.set(7);
|
||||||
display.set(7)
|
display.show(1234);
|
||||||
display.show(1234)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## More operation
|
|
||||||
|
|
||||||
### Grove - 4 digital display
|
|
||||||
|
|
||||||
Use ``||bit||`` to display one bit number.
|
Use ``||bit||`` to display one bit number.
|
||||||
|
|
||||||
Use ``||point||`` to open or close point dispay.
|
Use ``||point||`` to open or close point dispay.
|
||||||
|
Loading…
Reference in New Issue
Block a user