Problem with ArdOSC with ethernet shield to companion

Hello all, first time posting here.

I'm new to arduino, and as my first project, i'm using a script from the bitfocus guys to control a soft caled companion via OSC commands.


I'm missing the links to the used libraries. In the ArdOSC version that the library manager of the IDE installs, there is no file ArdOSC/src/socket.cpp. So I guess you're using an ancient or ultra-new version of this library but without the link I cannot check.

PG_PG: The socket.cpp, socket.h and w5100.h are all copied from the Ethernet library.

Why the hell do you copy the files from another library? I'm not surprised it won't compile if mix everything together.

I had a deeper look at the library code. It uses internals of an old version (about 7-8 years old) of the Ethernet library. This library needs major updates to compile with current IDE versions. You can try to compile the sketches with an old IDE (version 1.0.5 should work) but you might have problems to use other newer libraries with the old IDE.

What could i do to update the script to 2019?

That's quite some work! Read through the ArdOSC code and through the Ethernet library code, then adapt to the new Ethernet library. Not a job for newbies though.

i want to have a LED light up depending of the button that is pressed, then stop the script from letting the user push another button until it has been reseted. Something like the family feud big red button.

I don't know if I understood your intention correctly but if you want to take the first button press, send the OSC message and then accept nothing until the Arduino is resetted (by power cycling or pressing the reset button), you just have to insert the line

while (1); // wait forever

after the button released press_bank() call.

The script compile, but nothing is happening...

What does that mean? Does it send out messages? Are the messages just not correct or does it freeze before it's able send anything?

Was my interpretation of your intention correct? If yes, than your sketch does not what you requested.

But there is something wrong with the second if. the OSC command “blinks”…

Sure it does. Go through your code and think about what happens if

  1. button 1 is pressed, button 2 is not pressed.
  2. button 2 is pressed, button 1 is not pressed.

In both cases you will see a blinking OSC as both buttons have the same target.

Do you really want to send OSC messages for every loop round? I don’t know what exactly you’re trying to achieve but most probably it’s sufficient to send messages if the state one of the buttons has changed.