Code Monkey home page Code Monkey logo

pxt-calliope's Introduction

calliope target for PXT

pxt-calliope is a Microsoft Programming Experience Toolkit (PXT) target that allows you to program a Calliope mini.

Issue tracking

Please add an issue if you discover an (unreported) bug.

Developing new extensions

Authoring and testing of new extensions can be done directly from the web editor. See our documentation on how to get started. If you want to run the editor locally, keep reading.

Local server setup

The local server lets you to run the editor and serve the documentation from your own computer. It is meant for a single developer used and not designed to serve the editor to a large amount of users.

  1. Install Node.js 8.9.4 or higher.
  2. Clone this repository.
git clone https://github.com/microsoft/pxt-calliope
cd pxt-calliope
  1. Install the PXT command line (add sudo for Mac/Linux shells).
npm install -g pxt
  1. Install the pxt-calliope dependencies.
npm install

Go to the Running section.

Developer Setup

This is the typical setup used by the MakeCode team to work on the microbit.

  1. Install Node.js 8.9.4 or higher.
  2. Install Docker if you plan to build .cpp files.
  3. Clone the pxt repository.
git clone https://github.com/microsoft/pxt
cd pxt
  1. Install the dependencies of pxt and build it
npm install
npm run build
cd ..
  1. Clone the pxt-common-packages repository
git clone https://github.com/microsoft/pxt-common-packages
cd pxt-common-packages
npm install
cd ..
  1. Link pxt-common-packages to pxt
npm link ../pxt
cd ..
  1. Clone this repository.
git clone https://github.com/microsoft/pxt-calliope
cd pxt-calliope
  1. Install the PXT command line (add sudo for Mac/Linux shells).
npm install -g pxt
  1. Install the pxt-calliope dependencies.
npm install
  1. Link pxt-calliope back to base pxt repo (add sudo for Mac/Linux shells). This step is only required if you intend to make changes to pxt and/or pxt-common-packages repos. If all you want is serve a local Makecode, you can skip this step.
npm link ../pxt
npm link ../pxt-common-packages

Note the above command assumes the folder structure of

       makecode
          |
  ----------------------------------
  |       |                        |
 pxt      pxt-common-packages  pxt-calliope

Running

Run this command from inside pxt-calliope to open a local web server

pxt serve

If the local server opens in the wrong browser, make sure to copy the URL containing the local token. Otherwise, the editor will not be able to load the projects.

If you need to modify the .cpp files (and have installed yotta), enable yotta compilation using the --localbuild flag:

pxt serve --local

If you want to speed up the build, you can use the rebundle option, which skips building and simply refreshes the target information

pxt serve --rebundle

Cleaning

Sometimes, your built folder might be in a bad state, clean it and try again.

pxt clean

Updates

Make sure to pull changes from all repos regularly. More instructions are at https://github.com/Microsoft/pxt#running-a-target-from-localhost

Update playlists in markdown

Get a Google API key and store it in the GOOGLE_API_KEY environment variables (turn on data from the app).

pxt downloadplaylists

Repos

The pxt-calliope target depends on several other repos. The main ones are:

History

See the MakeCode blog.

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-calliope's People

Contributors

abchatra avatar amerlander avatar bluetooth-martin avatar chmora avatar darzu avatar ganicke avatar gbaman avatar gingemonster avatar guillaumejenkins avatar jwunderl avatar marcelpetrick avatar mebrauns avatar microsoft-github-policy-service[bot] avatar microsoftsam avatar mmoskal avatar msftgits avatar msprotz avatar owenbrotherwood avatar pelikhan avatar rdmueller avatar riknoll avatar samelhusseini avatar sgk avatar tballmsft avatar thinkberg avatar thomasdenney avatar tinfoilhatter avatar whaleygeek 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

Watchers

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

pxt-calliope's Issues

makecode calliope mini

Hi,

I got a problem with the makecode editor, you may help me with.
When I use the "on start" and the "forever" Blocks, the code from the "on start" is executed before the code within the "forever"-loop. As the code gets longer, it becomes a real issue, beacuse the "forever"-loop isn't executed at all.
Switching to the JavaScript, I can change the order of the code. As long as the code in the loop "basic.forever" is on the beginning, everthing works out.
But as soon as I switch back to the Blocks, the order is changed again and the program does not execute properly.

Is there a reason for the order that I don't see?
Thank you!

Sharing in beta doesn't work

The sharing of beta files doesn't work right now.
The generated link is headed to the normal environment and that can't open the beta file, because it needs the 2.1.48 target version.

Cannot run pxt serve

Hi,

I am constantly facing the following error while running pxt serve.
I have checked yotta already as it was mentioned by a similar error report.
Any idea on what can be the root of this problem?

building sim...
[run] cd sim; node ../node_modules/typescript/bin/tsc
log strings: 66 files; 0 strings -> sim-strings.json
building target.json in /home/....../pxt-calliope...
building libs/core
  skip native build of non-project
building libs/radio
  skip native build of non-project
building libs/devices
  skip native build of non-project
building libs/bluetooth
  skip native build of non-project
building libs/blocksprj
*** yotta target calliope-mini-classic-gcc
INTERNAL ERROR: Error: spawn yotta ENOENT
    at _errnoException (util.js:992:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)

Pins mapped wrong in Simulator

The Pins P0, P1, P2, P3 should be marked when high and the analog/digital values should be displayed at the correct place. ( The other pins on the Expansion-port should be marked, too when they are used)
Unbenannt

built of extensions fails

If you create an extension and create a release it ends in an error because of missing pxt-calliopemini

5

Doublicate Identifier in package devices

When using devices I get 16 Errors because of double identifier in devices and core/enum.d.ts.
I pasted devices/enumd.d.ts into main.ts and there you can see the 16 double identifiers. It´s in MesDpadButtonInfo

unbenannt

Editor update

Can we expect a revamp of the pxt-calliope editor in the near future like the one the pxt-microbit editor received recently?

Beta Hosting

The newest releases are not available at https://makecode.calliope.cc/beta as I would expect.

The beta.ref file exists and has "appref": "v", so I thought every release should get deployed on the website as beta.

Since there are a Issues like #59 and #57 which seem to interfere with the hosting it would be great, if we would have the newest releases on the Microsoft hosting as beta.

Missing pins for rx and tx

The pins C16 and C17 don´t appear for serial connections!
So I can´t use and update my ESP-Extension
1

Translation appears different

When opening German version of MakeCode within a WebView of an App (on iOS) I see the string „show leds“ in German. However, when directly surfing to it on the same device and same language settings the English version is displayed.
On a desktop, if I have a session open for a very long time I see the blocks „on Pin pressed“ in German as well, but when refreshing the page it is displayed in English!

Don't use Google fonts CDN

@importGoogleFonts: true which means this repo is using Google fonts CDN which is against MS security policy.

We need to bundle the font into our CSS instead.

pxt-neopixel library doesn´t work any more (only) on CalliopeMini

We have Problems using the neopixel library because of missing math functions.
As a workaround we have to add

// notwendige Funktionen für das aktuelle Neopixel-Paket
namespace Math {
export function idiv(x: number, y: number) { return x / y }
export function round(x: number) { return x }
}

So I think we need this two functions in makecode ;-)

1

Umlaute do not work

When you change those blocks to Javascript

Unbenannt2

... and change something in Javascript. (add a return)
and change back to Blocks you get errors:

Unbenannt

Missing and outdated extensions

The old Extensions for Calliope Mini like RGB-Colorsensor or calliope BC95 are missing. The Grove Extension v0.1.5 is outdated (v0.1.7).
The Servo Extension would be nice, too.

Feature Request: add loudness for the microphone in Simulator and Input

Circuit playground has a microphone, too. You can change the value for loudness in the simulator like the lightlevel or temperature. So it would be nice to have this for Calliope Mini!

Unbenannt

And the way to read the values of the microphone is a little bit difficult/inkonsequent for children. You know Calliope Mini is designed for Children at the age of 9 years. So it would be better to add a loudness Block in Input instead of reading an analog Pin and search the Button for the microphone.

Unbenannt2

Thanks! Michael

The Mic readings are random. Possibly a hardware bug?

Describe the bug
In the new hardware version (Version 1.3). The MIC values seem random. There is no accurate read.

To Reproduce
Steps to reproduce the behavior:

Simply screen the pins.analogReadPin(AnalogPin.MIC) .
The numbers vary between 480 and 530

Expected behavior
It should reflect the noise around. Simply attach a previous hardware version and see

Additional context
I am not sure if it is something that can be done through software changes. is it simply a production bug?

Cannot export staticpkg from the freshly installed calliope target

Right after complete installation, i try to export a static version. I face the following error.

INTERNAL ERROR: TypeError: Cannot read property 'replace' of undefined
at Object.renderMarkdown (~/pxt-calliope/node_modules/pxt-core/built/pxt.js:58949:33)
   at renderDocs (~/pxt-calliope/node_modules/pxt-core/built/pxt.js:81652:33)
   at ~/pxt-calliope/node_modules/pxt-core/built/pxt.js:83305:34
   at tryCatcher (~/pxt-calliope/node_modules/bluebird/js/release/util.js:16:23)
   at Promise._settlePromiseFromHandler (~/pxt-calliope/node_modules/bluebird/js/release/promise.js:512:31)
   at Promise._settlePromise (~/pxt-calliope/node_modules/bluebird/js/release/promise.js:569:18)
   at Promise._settlePromise0 (~/pxt-calliope/node_modules/bluebird/js/release/promise.js:614:10)
   at Promise._settlePromises (/~/pxt-calliope/node_modules/bluebird/js/release/promise.js:694:18)
   at Promise._fulfill (~/pxt-calliope/node_modules/bluebird/js/release/promise.js:638:18)
   at Promise._resolveCallback (~/pxt-calliope/node_modules/bluebird/js/release/promise.js:432:57)
   at Promise._settlePromiseFromHandler (~/pxt-calliope/node_modules/bluebird/js/release/promise.js:524:17)
   at Promise._settlePromise (~/pxt-calliope/node_modules/bluebird/js/release/promise.js:569:18)
   at Promise._settlePromise0 (~/pxt-calliope/node_modules/bluebird/js/release/promise.js:614:10)
   at Promise._settlePromises (~/pxt-calliope/node_modules/bluebird/js/release/promise.js:694:18)
   at Promise._fulfill (~/pxt-calliope/node_modules/bluebird/js/release/promise.js:638:18)
   at MappingPromiseArray.PromiseArray._resolve (~/pxt-calliope/node_modules/bluebird/js/release/promise_array.js:126:19)

appearantly this has been an issue before microsoft/pxt#3612, but i did not get any info on how was is solved in microbit.

"more" submenu in blocks menu not longer working (in beta)

makecode.calliope.cc Version: 2.1.45
Microsoft MakeCode Version: 5.32.21
Laufzeitumgebung calliope Version: pxtgc-0

Describe the bug
The submenu "...more" (...mehr) in the blocks menu is not working any longer. The presented blocks stay the same. So you cannot access the additional blocks.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://makecode.calliope.cc/beta#editor
  2. Click on e.g. 'Eingabe' (input blocks are shown)
  3. Click on '...mehr' (blocks don't change)

Expected behavior
Clicking on a '...more' submenu should show the additional blocks.

Screenshots

grafik

grafik

Desktop (please complete the following information):

  • OS: Win7 Prof.
  • Browser: Firefox
  • Version: 72.0.2 (64 bit)

Error in simulator

Hm, show number doesn´t work any more in simulator. Only LED(0/0) is blinking

grafik

Extensions are localized wrong

Testing my new extensions I discovered that they stay in german even when I switch to english. Same Error with other extensions like Neopixel

Unbenannt

No block to turn off RGB Led

There is no block to turn off the RGB led. Turning it off using the '0' from the 'maths' menu is very counter intuitive.

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.