Skip to content

Commit 8d519ca

Browse files
committed
docs: add full example
1 parent 84c8f93 commit 8d519ca

File tree

11 files changed

+1309
-3
lines changed

11 files changed

+1309
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Here are some general tutorials that provide brief introductions to embedded pro
3030
To include the `dht11` feature:
3131

3232
```rust
33-
cargo add embedded-dht-rs
33+
cargo add embedded-dht-rs --features "dht11"
3434
```
3535

3636
To include all features (`dht11`, `dht20`, and `dht22`):
@@ -41,6 +41,7 @@ cargo add embedded-dht-rs --features "dht11,dht20,dht22"
4141

4242
### Example - ESP32
4343

44+
You can find the full example in the [examples](./examples) folder.
4445

4546
```rust
4647
#![no_std]
@@ -71,8 +72,7 @@ fn main() -> ! {
7172
io.pins.gpio21,
7273
io.pins.gpio22,
7374
HertzU32::kHz(400),
74-
&clocks,
75-
None,
75+
&clocks
7676
);
7777

7878
let mut dht11 = Dht11::new(od_for_dht11, delay);

examples/.cargo/config.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[target.xtensa-esp32-none-elf]
2+
runner = "espflash flash --monitor"
3+
4+
5+
[env]
6+
ESP_LOGLEVEL="INFO"
7+
8+
[build]
9+
rustflags = [
10+
"-C", "link-arg=-nostartfiles",
11+
]
12+
13+
target = "xtensa-esp32-none-elf"
14+
15+
[unstable]
16+
build-std = ["core"]

examples/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
debug/
4+
target/
5+
6+
# These are backup files generated by rustfmt
7+
**/*.rs.bk
8+
9+
# MSVC Windows builds of rustc generate these, which store debugging information
10+
*.pdb

examples/.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"rust-analyzer.check.allTargets": false,
3+
}

0 commit comments

Comments
 (0)