Comments (2)
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.
Thank you very much for the fast answer!
I would like to try it soon.
from bitlash.
Related Issues (20)
- Talk to arduino without >command HOT 6
- run bitlash code stored in flash HOT 5
- eeprom overflow error with bitlash run command for a user defined function HOT 3
- Blank user function causes following functions not to appear HOT 2
- Port to spark-core or esp-8266 HOT 7
- Not working on new Arduino.. HOT 9
- Can't save user functions to startup? HOT 27
- Deleted-cant add user functions to memory
- Cant add more then 9 commands inside startup functions
- No support for bypass serial
- Serial flash support? HOT 2
- No need to wait after Wire.requestFrom().
- LED was very dim when using bitlash HOT 1
- bitlash demo - blink does not blink HOT 5
- Problem of output buffer when using bitlash
- ========^ unexpected number error for functions HOT 5
- Run code from eeprom HOT 2
- Make SdCard example code use IDE's inbuilt SD API
- Maintained fork?
- update library for support lastet arduino ide version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bitlash.