Git Product home page Git Product logo

Comments (2)

billroy avatar billroy commented on August 10, 2024

Hello and thanks for your note.

The usual way to handle your requirement is to have the C-based User Function which does the I2C or SPI work return the sensor value as the function’s return value. Then you can simply call the function and use the result (like “print getsensor1()”).

Another is to use a Bitlash global variable to contain the result. Your User Function can call “setvar(0, 100)” to set the Bitlash variable ‘a’ to 100, for example, and then it’s available to all Bitlash code.

A third approach would be to use two functions, one to acquire the sensor value and store it in a global unsigned C variable, and another to retrieve and return that value.

Hope that helps, and happy to take followup questions.

-br

On Oct 29, 2014, at 2:09 AM, guaifi [email protected] wrote:

Hello, I am planning to use bitlash in my home to read sensors remotely.

Some sensors are not than simple as reading a pin, so for example a sensor who works via I2C or SPI... One wire temperature sensors...

So, I can run in arduino a function that communicates with the sensor in the specified protocol, reads the value and stores the result in a local variable. An unsigned int Sensor1Value for ex...

¿¿Do you know any way from remote terminal to say Bitlash that returns me the value of Sensor1Value stored in arduino RAM??


Reply to this email directly or view it on GitHub #39.

from bitlash.

guaifi avatar guaifi commented on August 10, 2024

Thank you very much for the fast answer!

I would like to try it soon.

from bitlash.

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.