Comments (4)
https://github.com/shokai/arduino_firmata/blob/master/samples/on_digital_read.rb seems to do the same.
from arduino_firmata.
Hi. the sample code is not same.
You should use arduino.on :digital_read
at outside of loop.
Because it is a function to register the event for pin change.
If you use it inside of loop, it registers many pin-change-events.
from arduino_firmata.
Hi, thanks, it makes sense that it should sit outside the loop. However, I think I tried the sample code exactly as it is there and it did the same thing. I will confirm this though. Does that sample code give you the right value for the pin parameter?
from arduino_firmata.
@shokai , my apologies. I've confirmed, and the sample code does work as expected. I'll close the issue.
from arduino_firmata.
Related Issues (20)
- throw Error "device not found"
- evetmachine
- windows support HOT 9
- debouncing of on :analog_read HOT 1
- share an arduino with dRuby HOT 3
- share an arduino between multiple processes
- set pin_mode before analog_read HOT 3
- Performance and annoying sound
- check arguments (negative values)
- analog_read not works on Arduino UNO
- 10 second delay before using Arduino Mega 2560
- Process never exits
- cannot detect :digital_read with pin-8
- Initialization hangs without nonblock_io option
- [Arduino] Serialport not open
- Continuous reading from analog pin gets the same value HOT 1
- reading i2c sensors
- Sysex test is failing HOT 1
- Can't run tests with `ruby-2.2.2`
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 arduino_firmata.