Git Product home page Git Product logo

Comments (1)

jguille2 avatar jguille2 commented on June 12, 2024

Hi @woronin

This is not a bug. I explain the current operation and the different possibilities:

  1. Snap! (and then Snap4Arduino) decided not to execute generic javascript code without the user's permission, to prevent bad practices (especially considering the execution of projects that are made directly from the web, to test them, without seeing the code or knowing who has done). And yes, this happened at version 7.
    But you only have to go to Snap4Arduino settings menu, and click to allow "Javascript extensions". And that's all.

allowJs

  1. If you want to avoid this requeriment (having to enable the extensions each time) you still have two options:
    2.1 You have libraries that have this "ping" block implemented. I use SA5Firmata, and then, this SA5Firmata library has this block (and others: tone, pulses, nunchuck and dht11). You can use that "ping" block or you can use the generic "pulseIn" block to build your own.

pingBlock

2.2 If you use another Firmata code to implement this ping option, you can take a look at the Snap4Arduino "primitives" because we set different "general used options" to allow these "javascript known code" without extensions. These functions are at https://github.com/bromagosa/Snap4Arduino/blob/master/src/s4a/extensions.js#L117-L215

That's all.
I close this issue, but you continue if needed with questions or suggestions.

Joan

from snap4arduino.

Related Issues (20)

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.