Pages: [1]   Go Down
Author Topic: VSync Library - Synchronize variables between Arduino and Processing  (Read 649 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I just finished the first version of my VSync library which 'magically' binds two variables on an Arduino and in a Processing sketch and keeps them in sync. Synchronizing between two arduinos is supported too.

Have a look here: http://erniejunior.github.io/VSync/ and play with the examples.

I would love to hear your feedback.
Maybe somebody has a use for it.



Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

HI, I'm loving your library. It is much better than parsing the data  but I think I am running into a problem. I am using your bidirectional example.  What I am doing is synchronizing 32 variables (arduino and processing) and reading a rotary encoder to run a dial on the processing screen driven off of one of the synchronized variables. What I want to do is be able to hit a button to reset the encoder to position 0 but when I try to reset, it goes to zero initially but then I think it reads the buffer that was stored for the variable that runs the dial and jumps to that value. I try to "rezero" the variable but the encoder steps one (pulse++ or pulse --) and adds or subtracts from the last value.

Code:
newpulses=0;
pResetEncoder=0;
aResetEncoder=pResetEncoder;
pPulses=0;
pulses=pPulses;
  println("pResetEncoder"+pResetEncoder);
   println("aResetEncoder"+aResetEncoder);
  println("pulses"+pulses);
  println("pPulses"+pPulses);

pulses26  <------------------------------------------
pResetEncoder0
aResetEncoder0
pulses0<-------------------------------------------
pPulses0
26
pulses62<---------------------------------------------
pResetEncoder0
aResetEncoder0
pulses0
pPulses0
26

If I stop then restart processing, it resets to zero and steps correctly.
Is this data stored on the arduino side (which has the sender.sync and receiver sync  or processing side which has the ValueReceiver and ValueSender ? Is there a way to manually change one (pair of) value(s) or "reset" the whole thing to gather the new values after the first initialization?
Another option would be not to use this variable within the scope of your library  and send data via serial but not sure if and how to do that. I'm new to arduino so please excuse my newbie-ness. Thanks for the library. Joe
« Last Edit: July 06, 2014, 03:09:30 am by JSan1964 » Logged

Pages: [1]   Go Up
Jump to: