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 ### 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 ### 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 This program reads pin `P1` and shows the number
[bar graph](/reference/led/plot-bar-graph). on the LED screen.
```blocks ```blocks
basic.forever(() => { basic.forever(() => {
let value = pins.analogReadPin(AnalogPin.P1) 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), [analog write pin](/reference/pins/analog-write-pin),
[digital read pin](/reference/pins/digital-read-pin), [digital read pin](/reference/pins/digital-read-pin),
[digital write pin](/reference/pins/digital-write-pin) [digital write pin](/reference/pins/digital-write-pin)