hi SirThanksalot,
agree to the awesomeness of the name ;)
from your setup i guess you want to get the “speed” of your wheel. or just the trigger point?
as far as i understood what you want to achieve, it is a bit hard to do really right in vvvv. i will try to make this a bit more transparent:
when the wheel turns too fast you will get multiple “bangs” within one vvvv-frame but on the arduino board, so these alternations might not show up correctly. you can also view at the arduino and vvvv as two different timing/clock sources. vvvv runs frame based, but what you actually need is kind of an interrupt behavior - technically speaking. anyway, this leads to multiple bytes being received on the serial line buffer (internally handled by the system) within one frame. the firmata plugin is coded such a way to discard the last values set on a pin. so e.g. imagine within one vvvv-frame the following sequence was read by digitalRead (which standard firmata also uses) on the arduino board: 01100110. the value in the spread for this pin would be 0.
what you could do is to use a simple sketch like this:
void setup() {
Serial.begin(9600);
}
void loop() {
// assuming this is the only(!) value you send, send the pin value straight over serial
Serial.write( digitalRead(HAL_SENSOR_PIN) );
}
you can actually use quite a low baudrate to get faster buffer flushes.
nevertheless, vvvv will only retrieve the buffer every 16ms or so, depending on your framerate. use the standard RS232 (Devices) node and an AsValue (Raw) to turn the received buffer into a spread of values (toggles). you have to set the Format of the AsValue (Raw) to Byte! if any of the toggles is true (meaning > 1), the hal sensor was triggered since the last frame.
hm. let’s me think of a pin history feature for firmata… makes sense?
best! jens