Skip to content

Commit 9051bb4

Browse files
committed
add code example
1 parent 723a6f0 commit 9051bb4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
![MMinter wallet Arduino ESP8266, ESP32](static/minter-wallet-arduino-ESP8266-ESP32.jpg "Minter wallet Arduino ESP8266, ESP32")
44

5-
65
### Требуемые библиотеки
76
Часть доступна через менеджер библиотек. Так же необходимо [установить поддержку ESP8266](https://github.com/esp8266/Arduino "установить поддержку ESP8266")
87
* [WiFiManager](https://github.com/tzapu/WiFiManager)
@@ -15,7 +14,18 @@
1514
* подключиться к WiFi точке `OnDemandAP`
1615
* Зайти на `http://192.168.4.1` и интуитивно добавить точку доступа
1716

17+
### Немного кода
1818

19+
```arduino
20+
Wallet wallet;
21+
if (minterApi.getAddress("Mx1234....4242", 0, wallet) == MINTERAPI_OK){
22+
Serial << prefix << "Wallet: " << wallet.address << ", count_txs: " << wallet.count_txs << ", length: " << wallet.balance.length() << endl;
23+
for (uint16_t i = 0; i < balance.length(); i++)
24+
{
25+
Serial << "coin: " << balance.at(i).coin << ", amount: " << balance.at(i).amount << ", amountStr: " << balance.at(i).amountStr << endl;
26+
}
27+
}
28+
```
1929

2030
### TODO list
2131
* Добавление API и адреса API в конфигуратор

0 commit comments

Comments
 (0)