Skip to content

climate-action-kits/pxt-climate-action-kit-land

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Climate Action Kit: Land

This library provides functions to interface with the components of the InkSmith Climate Action Kit.

More information at https://www.inksmith.ca/pages/climate-action-kits.

Link to online teacher facing curriculum: https://inksmith.teachable.com/p/land (for free sign up, use coupon code "LANDKIT" at course registration)

Example Usage

To drive forward, then backward

basic.forever(() => {
    motor.turnLeft(50)
    basic.pause(1000)
    motor.turnLeft(-50)
    basic.pause(1000)
})

Using the touch sensor to display the current moisture level of the soil.

basic.forever(function () {
        if (touch.getTouch(touch.TouchPin.P1)) {
            soil.displayMoisture(soil.SoilPin.P0)
      } else {
         basic.showLeds(`
             . . . . .
             . . . . .
             . . . . .
             . . . . .
             . . . . .
             `)
        }
    })

To oscillate servo at p0 up and down

basic.forever(function () {
    servos.setServoPosition(servos.ServoPin.P0, Position.UP)
    basic.pause(1000)
    servos.setServoPosition(servos.ServoPin.P0, Position.DOWN)
    basic.pause(1000)
})

Supported Targets

  • for PXT/microbit

License

MIT

About

Library to interact with the Climate Action Kit: Land

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%