Skip to content

Commit

Permalink
Update soil moisture code and connect (#5775)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinwork authored Aug 5, 2024
1 parent fbfae29 commit 8e3dcb2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions docs/projects/soil-moisture/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ This saves electricity and also avoids corrosion of the probes.
led.setBrightness(64)
let reading = 0
basic.forever(() => {
pins.analogWritePin(AnalogPin.P1, 1023)
pins.digitalWritePin(DigitalPin.P1, 1)
basic.pause(1)
reading = pins.analogReadPin(AnalogPin.P0)
pins.analogWritePin(AnalogPin.P1, 0)
pins.digitalWritePin(DigitalPin.P1, 0)
led.plotBarGraph(
reading,
1023
Expand Down
7 changes: 4 additions & 3 deletions docs/projects/soil-moisture/connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ radio.setGroup(4)
led.setBrightness(64)
let reading = 0
basic.forever(() => {
pins.analogWritePin(AnalogPin.P1, 1023)
pins.digitalWritePin(DigitalPin.P1, 1)
basic.pause(1)
reading = pins.analogReadPin(AnalogPin.P0)
radio.sendNumber(reading / 4);
pins.analogWritePin(AnalogPin.P1, 0)
pins.digitalWritePin(DigitalPin.P1, 0)
radio.sendNumber(reading / 4)
led.plotBarGraph(
reading,
1023
Expand Down

0 comments on commit 8e3dcb2

Please sign in to comment.