-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9807634
commit 558a5a3
Showing
286 changed files
with
21,422 additions
and
884 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"restructuredtext.confPath": "", | ||
"liveServer.settings.port": 5501 | ||
} |
Binary file not shown.
Binary file modified
BIN
-660 Bytes
(88%)
build/doctrees/get-started-with-ezblock2.0/get-started-with-ezblock2.0.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.55 KB
build/doctrees/reference-for-python/ezblock/serial_servo_Using_documents.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+6.56 KB
build/doctrees/reference-for-python/moezblock/serial_servo_Using_documents.doctree
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
build/html/_sources/reference-for-python/moezblock/ADC.md.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# class `ADC` - analog to digital converter | ||
|
||
Usage: | ||
```python | ||
from ezblock import ADC | ||
|
||
adc = ADC("A0") # create an analog object from a pin | ||
val = adc.read() # read an analog value | ||
``` | ||
## Constructors | ||
```class ezblock.ADC(pin)``` | ||
Create an ADC object associated with the given pin. This allows you to then read analog values on that pin. | ||
|
||
## Methods | ||
- read - Read the value on the analog pin and return it. The returned value will be between 0 and 4095. | ||
```python | ||
ADC.read() | ||
``` |
24 changes: 24 additions & 0 deletions
24
build/html/_sources/reference-for-python/moezblock/ADXL345.md.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# class `ADXL345` - accelemeter | ||
Usage: | ||
```python | ||
from ezblock import ADXL345 | ||
|
||
accel = ADXL345() # create an ADXL345 object | ||
x_val = accel.read(accel.X) # read an X(0) value | ||
y_val = accel.read(1) # read an Y(1) value | ||
z_val = accel.read(2) # read an Z(2) value | ||
``` | ||
## Constructors | ||
```class ezblock.ADXL345(address=0x53)``` | ||
Create an ADXL345 object. This allows you to then read adxl345 accelerator values. | ||
|
||
## Methods | ||
- `read` - Read the value with the axis and return it. Value unit is gravity acceleration(about 9.8m/s2). | ||
```python | ||
ADXL345.read(axis) | ||
``` | ||
|
||
## Constants | ||
- `X` - x axis | ||
- `Y` - y axis | ||
- `Z` - z axis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# class `BLE` - bluetooth driver |
35 changes: 35 additions & 0 deletions
35
build/html/_sources/reference-for-python/moezblock/Buzzer.md.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# class `Buzzer` - passive buzzer | ||
Usage: | ||
```python | ||
from ezblock import PWM, Buzzer, Music | ||
|
||
pwm = PWM("A0") # create pwm object | ||
buzzer = Buzzer(pwm) # create an Buzzer object with PWM object | ||
music = Music() # create music object | ||
|
||
buzzer.play(music.note("Low C"), music.beat(1)) # play low C for 1 beat | ||
buzzer.play(music.note("Middle C#")) # play middle C sharp | ||
buzzer.off() # turn buzzer off | ||
``` | ||
## Constructors | ||
```class ezblock.Buzzer(pwm)``` | ||
Create an Buzzer object associated with the given pwm object. This allows you to then control buzzer. | ||
|
||
## Methods | ||
- `on` - Turn the buzzer on with a square wave | ||
```python | ||
Buzzer.on() | ||
``` | ||
- `off` - Turn the buzzer off | ||
```python | ||
Buzzer.off() | ||
``` | ||
- `freq` - Set the square wave frequency | ||
```python | ||
Buzzer.freq(frequency) | ||
``` | ||
- `play` - Play freq, set off if a ms delay arguement is provided. | ||
```python | ||
Buzzer.play(freq, ms) | ||
Buzzer.play(freq) | ||
``` |
35 changes: 35 additions & 0 deletions
35
build/html/_sources/reference-for-python/moezblock/Camera.md.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# class `Camera` - camera module | ||
|
||
Usage: | ||
|
||
```python | ||
from ezblock import Camera | ||
|
||
cam = Camera() # create an camera object | ||
cam.start() # start camera streaming | ||
cam.stop() # stop camera streaming | ||
``` | ||
|
||
## Constructors | ||
|
||
```class ezblock.Camera(res=1, fps=12, port=9000, rotation=0)``` | ||
Create an Camera object. This allows you to then control the camera! | ||
|
||
- `res` resolution. 0: 320x240, 1: 640x480, 2: 1024x576, 3: 1280x800, default to 1 | ||
- `fps` frame per second. default to 12 | ||
- `port` Streaming port, default to 9000 for ezblock remote panel | ||
- `rotation` rotation of the video. | ||
|
||
## Methods | ||
|
||
- `start` - start video streaming value. | ||
|
||
```python | ||
Camera().start() | ||
``` | ||
|
||
- `stop` - stop video streaming` | ||
|
||
```python | ||
Camera().stop() | ||
``` |
43 changes: 43 additions & 0 deletions
43
build/html/_sources/reference-for-python/moezblock/Color.md.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# class `Color` - rgb color | ||
|
||
Usage: | ||
```python | ||
from ezblock import Color | ||
|
||
c = Color() # create an color object | ||
white = c.color("#ffffff") # hex color | ||
white_led = c.led_color("#ffffff") # hex color for led | ||
color_red = c.get_from("red", "#ffffff") # get red from a rgb color | ||
random_color = c.random() # get random color | ||
color = c.rgb(200, 20, 40) # get color from RGB value | ||
blended = c.blend("#ff0000", "#00ff00", 0.5) # blend 2 color with specific ratio | ||
``` | ||
## Constructors | ||
```class ezblock.Color()``` | ||
Create an Color object. This allows you to then get or control colors! | ||
|
||
## Methods | ||
- `color` - get color from a hex string. this function only test the value if is color format, then returns the input value. | ||
```python | ||
Color().color("#88ff44") | ||
``` | ||
- `led_color` - get color from a hex string. this function only test the value if is color format, then returns the input value. same as `color()` | ||
```python | ||
Color().led_color("#88ff44") | ||
``` | ||
- `get_from` - get Red/Green/Blue value from a color. | ||
```python | ||
Color().get_from("red", "#88ff44") | ||
``` | ||
- `random` - get random color. | ||
```python | ||
Color().random() | ||
``` | ||
- `rgb` - get color from RGB value. ranlue ranges 0~255. | ||
```python | ||
Color().rgb(200,100,20) | ||
``` | ||
- `blend` - blend two color with specific ratio. Ratio ranges 0~1, float | ||
```python | ||
Color().blend("#ff0000", "#00ff00", 0.5) | ||
``` |
36 changes: 36 additions & 0 deletions
36
build/html/_sources/reference-for-python/moezblock/DS18X20.md.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# class `DS18X20` - ds18x20 series temperature sensor | ||
|
||
Usage: | ||
```python | ||
from ezblock import Pin, DS18X20 | ||
|
||
pin = Pin("D0") # create pin object | ||
ds = DS18X20(pin) # create an DS18X20 object with PWM object | ||
|
||
ds.read(ds.C) # read temperature in celsius(1) | ||
ds.read(0) # read temperature in Fahrenheit(0) | ||
``` | ||
>Raspberry Pi only have one one-wire pin "D7". While Leaf works with almost every digital pins. | ||
|
||
## Constructors | ||
```class ezblock.DS18X20(pin)``` | ||
Create an DS18X20 object associated with the given pin object. This allows you to then read temperature from DS18X20. | ||
|
||
## Methods | ||
- `DS18X20.read` - read temperature with the giving unit. it returns a `float` if only one ds18x20 is connected to the pin, or it will return a list of all sensor values. | ||
```python | ||
DS18X20.read(unit) | ||
``` | ||
- `DS18X20.scan` - Scan the ds18x20(s) connected to the pin, returns a list of roms address | ||
```python | ||
DS18X20.scan() | ||
``` | ||
- `DS18X20.read_temp` - Read temperature(s) with the givving rom(s) | ||
```python | ||
DS18X20.read_temp(rom) | ||
``` | ||
|
||
## Constants | ||
|
||
- `DS18X20.C` - Celsius | ||
- `DS18X20.F` - Fahrenheit |
50 changes: 50 additions & 0 deletions
50
build/html/_sources/reference-for-python/moezblock/I2C.md.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# class `I2C` - IIC bus | ||
|
||
Usage: | ||
```python | ||
from ezblock import I2C | ||
|
||
i2c = I2C(1) # create on bus 1 | ||
i2c = I2C(1, I2C.MASTER) # create and init as a master | ||
|
||
i2c.send('abc') # send 3 bytes | ||
i2c.send(0x42) # send a single byte, given by the number | ||
data = i2c.recv(3) # receive 3 bytes | ||
|
||
i2c.is_ready(0x42) # check if slave 0x42 is ready | ||
i2c.scan() # scan for slaves on the bus, returning | ||
# a list of valid addresses | ||
i2c.mem_read(3, 0x42, 2) # read 3 bytes from memory of slave 0x42, | ||
# starting at address 2 in the slave | ||
i2c.mem_write('abc', 0x42, 2, timeout=1000) # write 'abc' (3 bytes) to memory of slave 0x42 | ||
# starting at address 2 in the slave, timeout after 1 second | ||
``` | ||
## Constructors | ||
```class ezblock.I2C(num)``` | ||
Create an I2C object associated with the given num. This allows you to use i2c on that device. | ||
|
||
## Methods | ||
- is_ready - check if slave 0x42 is ready | ||
```python | ||
I2C.is_ready(addr) | ||
``` | ||
- scan - scan for slaves on the bus, returning | ||
```python | ||
I2C.scan() | ||
``` | ||
- send - send several bytes to slave with address | ||
```python | ||
I2C.send(send,addr,timeout) | ||
``` | ||
- recv - # receive one or several bytes | ||
```python | ||
data = i2c.recv(recv,addr,timeout) # receive 3 bytes | ||
``` | ||
- mem_write - Write to the memory of an I2C device | ||
```python | ||
I2C.mem_write(data, addr, memaddr, timeout) | ||
``` | ||
- mem_read - Read from the memory of an I2C device | ||
```python | ||
I2C.mem_read(data, addr, memaddr, timeout) | ||
``` |
21 changes: 21 additions & 0 deletions
21
build/html/_sources/reference-for-python/moezblock/IOT.md.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# class `IOT` - internet of things | ||
|
||
Usage: | ||
```python | ||
from ezblock import IOT | ||
|
||
iot = IOT() | ||
``` | ||
## Constructors | ||
```class ezblock.IOT(iot_token, device)``` | ||
Create an ADC object associated with the given pin. This allows you to then read analog values on that pin. | ||
|
||
## Methods | ||
- post - 1 | ||
```python | ||
IOT.post(sensorname, value) | ||
``` | ||
- get - 1 | ||
```python | ||
IOT.get(sensorname) | ||
``` |
Oops, something went wrong.