some beautification

This commit is contained in:
gijsio
2020-07-20 13:59:31 +02:00
parent d2a3131e23
commit b4940fd8fa
9 changed files with 23 additions and 22 deletions

View File

@@ -9,7 +9,6 @@ aliases:
This example is a simple ADC sample. For more information please see [`ADC`](/firmwareapi/pycom/machine/adc).
```python
from machine import ADC
adc = ADC(0)
adc_c = adc.channel(pin='P13')
@@ -22,7 +21,6 @@ adc_c.value()
Currently the ESP32's ADC is not calibrated from the factory. This means it must be calibrated each time you wish to use it. To do this you must firstly measure the internal voltage reference. The following code will connect the 1.1v reference to `P22`
```python
from machine import ADC
adc = ADC()
@@ -33,7 +31,6 @@ adc.vref_to_pin('P22')
Now that the voltage reference is externally accessible you should measure it with the most accurate voltmeter you have access to. Note down the reading in millivolts, e.g. `1120`. To disconnect the 1.1v reference from `P22` please reset your module. You can now calibrate the ADC by telling it the true value of the internal reference. You should then check your calibration by connecting the ADC to a known voltage source.
```python
# Set calibration - see note above
adc.vref(1100)

View File

@@ -9,7 +9,6 @@ aliases:
The following example receives data from a light sensor using I2C. Sensor used is the BH1750FVI Digital Light Sensor.
```python
import time
from machine import I2C
import bh1750fvi
@@ -28,7 +27,6 @@ while(True):
Place this sample code into a file named `bh1750fvi.py`. This can then be imported as a library.
```python
# Simple driver for the BH1750FVI digital light sensor
class BH1750FVI:
@@ -56,7 +54,6 @@ class BH1750FVI:
This is the same code, with added LoRa connectivity, sending the lux value from the light sensor to another LoRa enabled device.
```python
import socket
import time
import pycom

View File

@@ -10,8 +10,7 @@ This tutorial explains how to connect and read data from a DS18x20 temperature s
## Basic usage
```python
```
import time
from machine import Pin
from onewire import DS18X20
@@ -31,7 +30,6 @@ while True:
## Library
```python
#!/usr/bin/env python3
"""