GithubHelp home page GithubHelp logo

microsoft / pxt-adafruit Goto Github PK

View Code? Open in Web Editor NEW
81.0 23.0 77.0 513.83 MB

Microsoft MakeCode editor for Adafruit Circuit Playground Express

Home Page: https://makecode.adafruit.com

License: Other

TypeScript 93.48% HTML 0.71% CSS 0.43% JavaScript 0.88% C 0.16% C++ 0.66% Less 3.69%
makecode pxt adafruit circuitplayground

pxt-adafruit's Introduction

MakeCode for Adafruit Circuit Playground Express Build Status

This repo contains the editor hosted at https://makecode.adafruit.com .

Local server setup

This setup gives you a local version of the editor and the ability to load packages from your machine. This is the setup to develop new packages.

Setup

npm install

Don't forget to periodically git pull and npm install to get the latest changes.

Launching the server

This command launches a local web server. Note that this web server is meant for development purposes only. It was not designed or secured to be run on a web server.

npm run serve

Creating and editing a package

  • go to /projects under the pxt-adafruit folder
  • clone your package repo, say pxt-helloworld
  • launch the server with npm run serve from the pxt-adafruit folder using npm serve
  • create a new project
  • go to project settings and click on Edit settings as text
  • add an entry in the dependency section that points to your project
    "dependencies": {
        "circuit-playground": "*",
        "helloworld": "file:../pxt-helloworld"
    },
  • click on the Blocks icon to reload the blocks.

Once this project is setup, simply reload the editor after making changes on disk.

Local Dev setup

This setup is needed if you plan to make changes in PXT itself. In most cases, it's a bit of an overkill if you are building a package for the Adafruit editor.

npm install -g pxt

In a common folder,

npm install
npm run build
  • go to pxt-common-packages and run
npm install
npm link ../pxt
  • go to pxt-adafruit and run
npm install
npm link ../pxt
npm link ../pxt-common-packages

to run the local server

From root github folder,

cd pxt-adafruit
pxt serve

to build and deploy a single package via command line

cd libs/core
pxt deploy

License

MIT

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

MICROSOFT, the Microsoft Logo, and MAKECODE are registered trademarks of Microsoft Corporation. They can only be used for the purposes described in and in accordance with Microsoft’s Trademark and Brand guidelines published at https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general.aspx. If the use is not covered in Microsoft’s published guidelines or you are not sure, please consult your legal counsel or MakeCode team ([email protected]).

pxt-adafruit's People

Contributors

abchatra avatar ajs256 avatar audreyctseng avatar bartadv avatar chasemor avatar cssinate avatar darzu avatar dcbriccetti avatar ganicke avatar gbaman avatar guillaumejenkins avatar james1293 avatar jaqster avatar jwunderl avatar microsoft-github-policy-service[bot] avatar microsoftsam avatar mmitche avatar mmoskal avatar pelikhan avatar peterblazejewicz avatar riknoll avatar samelhusseini avatar scottbridges avatar sgk avatar shakao avatar tballmsft avatar tomzurales avatar veler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pxt-adafruit's Issues

Highlight simulator buttons/pins used in programs

Similar to how we add controls depending on the APIs that are hit (light sensor, temp, etc.), we should also be highlighting the pins and buttons that are referenced in the code. Or greying out the others.

On Button Click

Hey guys, can we default this block to show the Left button instead of Pin? Left/Right buttons are super important to be discoverable. I'm almost thinking we should have separate blocks for Pins vs. Buttons vs. Switch... even though I know they act the same, it would be easier for students.

reduce memory pressure of neopixel layer

The current neopixel implementation allocates of lot of objects and intermediate arrays.

  • remove the use of HSV in interpolate
  • review all uses of HSV and remove allocation
  • move hsvtoRgb into simple function logic

NeoPixelColors lost when JS -> Blocks translations

Try converting

let initialValue = 0
control.forever(() => {
    if (initialValue != pins.D3.digitalRead()) {
        light.pixels.showColor(NeoPixelColors.Blue)
    }
})
initialValue = pins.D3.digitalRead()
light.pixels.showColor(NeoPixelColors.Red)

Deployment over HID fails on windows

Attempt to flash the device leads to this error. Running bootloader 0.1.11

HF2: Connected; msgSize 320B; flash 256kB; bootloader mode
HF2: Board-ID: SAMD21G18A-CPlay-v0
HF2: recv error: could not read from HID device
HIDERR Timeout
HF2: error cannot open device with path \\?\hid#vid_239a&pid_8019&mi_03#7&33dca5b6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}; reconnecting attempt #1
HF2: error cannot open device with path \\?\hid#vid_239a&pid_8019&mi_03#7&33dca5b6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}; reconnecting attempt #2
HF2: error cannot open device with path \\?\hid#vid_239a&pid_8019&mi_03#7&33dca5b6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}; reconnecting attempt #3
HF2: error cannot open device with path \\?\hid#vid_239a&pid_8019&mi_03#7&33dca5b6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}; reconnecting attempt #4
HF2: error cannot open device with path \\?\hid#vid_239a&pid_8019&mi_03#7&33dca5b6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}; reconnecting attempt #5
HIDERR cannot open device with path \\?\hid#vid_239a&pid_8019&mi_03#7&33dca5b6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
HIDERR cannot open device with path \\?\hid#vid_239a&pid_8019&mi_03#7&33dca5b6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
HIDERR cannot open device with path \\?\hid#vid_239a&pid_8019&mi_03#7&33dca5b6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
HIDERR cannot open device with path \\?\hid#vid_239a&pid_8019&mi_03#7&33dca5b6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
HIDERR cannot open device with path \\?\hid#vid_239a&pid_8019&mi_03#7&33dca5b6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
HIDERR cannot open device with path \\?\hid#vid_239a&pid_8019&mi_03#7&33dca5b6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}

Edge Browser Error on Save As

Michal, you're too fast! :-)
Repro: On Edge, hit Download, Save As, Select CPLAYBOOT, Save
Browser throws this error:

edge error

Default brightness on neopixels is blinding

When you use the on-board neopixels in a program, they default to full brightness unless you explicitly set a lower value. The full brightness is way too bright (you can't look directly at it). I think that on our scale of 0-255, we should default to something more like 10 and that might even still be too bright if the board is held closer than arm's length. Anyone with a circuit playground want to weigh in on a good value?

bug in rotation simulator function

The following leveling code doesn't work in the simulator:

let roll = 0
let pitch = 0
control.forever(() => {
    pitch = input.rotation(Rotation.Pitch)
    roll = input.rotation(Rotation.Roll)
    if (Math.abs(pitch) < 10 && Math.abs(roll) < 10) {
        light.pixels.showColor(light.colors(NeoPixelColors.Blue))
    } else {
        light.pixels.showColor(light.colors(NeoPixelColors.Red))
    }
})

Update reference documentation

There are some microbit references in our documentation (see input.onGesture) and we need reference documentation for all of the API changes we are making. This is mostly a placeholder issue until we have all the APIs finalized.

Neopixels aren't cleared on reset

If you are showing something on the neopixels and reset (or go into the bootloader), the last thing being displayed on the neopixels will continue to show (i.e. they don't get turned off)

Docs decompilation adds unnecessary onstart

The following md in docs adds an unnecessary onstart:

let roll = 0
let pitch = 0
control.forever(() => {
    pitch = input.rotation(Rotation.Pitch)
    roll = input.rotation(Rotation.Roll)
    if (Math.abs(pitch) < 10 && Math.abs(roll) < 10) {
        light.pixels.showColor(light.colors(NeoPixelColors.Blue))
    } else {
        light.pixels.showColor(light.colors(NeoPixelColors.Red))
    }
});

converts to:
screen shot 2017-03-28 at 2 07 17 pm

see http://localhost:3232/reference/input/rotation

Sparkle

Built-in animation Sparkle doesn't seem to be working in the Sim...

TODO

Let's a list of TODOs in a single place rather with tons of issues.

Apis

  • capacitive buttons events / pressed apis
  • finalize pin mapping in board definition
  • generate API docs

Art

  • logo svg based
  • avatar image (svg)
  • loader image (svg)
  • review category colors

Docs

  • getting started
  • generate api docs (once finalized)
  • add 'Beta' somewhere on the page or in the domain name

Add some better APIs for the slide switch

Right now its all wrapped up with the button APIs. We can leave those, but it is not obvious how you achieve "when switch turned on" and "when switch turned off". The "Up" and "Down" terminology is confusing.

external neopixels not working

Repo:
[-] connect a 60-neopixel strip to ground, power and pin A8 on CP (note, we have "D" pins in our editor instead of "A")
[-] build and deploy this program
snippet

Nothing happens.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.