Rewrote in simple language. Updated example (needs work).

This commit is contained in:
Ron Hale-Evans 2016-06-23 14:29:32 -07:00
parent 7cd8ee1e23
commit 0ecf3dc2b4

View File

@ -9,19 +9,20 @@ pins.analogReadPin(AnalogPin.P0)
### Parameters
* a [string](/reference/types/string) that stores the pin you say (`P0` through `P4`, or `P10`)
* a [string](/reference/types/string) that stores the name of the pin
you say (`P0` through `P4`, or `P10`)
### Returns
* a [number](/reference/types/number) from `0` through `1024`
* a [number](/reference/types/number) from `0` through `1023`
This program reads pin `P1` and shows the number as a
[bar graph](/reference/led/plot-bar-graph).
This program reads pin `P1` and shows the number
on the LED screen.
```blocks
basic.forever(() => {
let value = pins.analogReadPin(AnalogPin.P1)
led.plotBarGraph(value, 1023)
basic.showNumber(value)
});
```
@ -32,4 +33,3 @@ basic.forever(() => {
[analog write pin](/reference/pins/analog-write-pin),
[digital read pin](/reference/pins/digital-read-pin),
[digital write pin](/reference/pins/digital-write-pin)