I am a Arduino/UbiMash Newbie

5 views
Skip to first unread message

DavideMadeddu

unread,
Sep 27, 2010, 3:26:12 PM9/27/10
to UbiMash
Hello everybody!
I am Davide, i have known Ubimash project after SmartGeometry in
Barcelona, and now i am doing first steps with arduino board. I have a
good experience with GC and now I am really interested to connect it
with arduino. I tried to play with the ubimash files that i found in
your website..but, maybe my very low experience with arduino, i can't
did anything. How i can start? There is an updated tutorial? And, the
files pubblished here (the *.dll) Norton says that have a virus, how i
can have the right one?
Any suggestion?
Thank you

Davide

Flora Salim

unread,
Sep 28, 2010, 4:45:00 AM9/28/10
to ubi...@googlegroups.com
Hi Davide,
Thank you for your interest in UbiMash.
Your request has pushed me to finalise and publish UbiMash manual which is available from http://ubimash.com/downloads/

I will start publishing Arduino tutorials but have you got an Arduino kit yourself. Get Arduino Innovation Kit - which is a good starter pack.

Looking forward to collaborate with you further.

Regards,
Flora

DavideMadeddu

unread,
Sep 28, 2010, 5:24:24 AM9/28/10
to UbiMash
Thank you Flora!
I've just downloaded your update, i will try in these days!
I've got an Arduino starter kit from fritzing.com, and I started to do
somenthing very simple with their tutorials.
I would to compliment with you and UbiMash team for your work!

Davide


On 28 Set, 10:45, Flora Salim <flora.sa...@gmail.com> wrote:
> Hi Davide,
> Thank you for your interest in UbiMash.
> Your request has pushed me to finalise and publish UbiMash manual which is
> available fromhttp://ubimash.com/downloads/
>
> <http://ubimash.com/downloads/>I will start publishing Arduino tutorials but
> have you got an Arduino kit yourself. Get Arduino Innovation Kit - which is
> a good starter pack.
>
> Looking forward to collaborate with you further.
>
> Regards,
> Flora
>

DavideMadeddu

unread,
Oct 1, 2010, 6:59:15 AM10/1/10
to UbiMash
Hi
I have tried in these days..
I started with a simple circuit with an LDR.
I was able to see the light values in real time with SensorMashUI..:-)
next i tried to play with GC following the tutorial (that might be
based more on Wii than Arduino..)
I created a simple GC file with one line that change its length with a
variable called lightVal (the same name of lightVal variable in
arduino..)
I want that the line changes its lenght based on the values read from
LDR. (Should be Arduino as publisher and GC as client, is it right?)
I was able to call ConnectUbi() inside GC..but when i select lightVal
(gc var) and subscribe to lightVal (arduino var) nothing happens..
I didn't understand very well the workflow to use GC as client..
Can you help me? :-)
and..another question..i see the servo example..but i see that there
is a .dll for servos..is a special case for servos? I will to compile
dll for my next "complicated" projects? :-(
Thank you in advance!

here the arduino code

int ledPin=9;//pin led
int ldrPin=1;//pin fotoresistore
int lightVal;

void setup(){
Serial.begin(9600);
Serial.flush();
pinMode(ledPin,OUTPUT);
}

void loop(){
lightVal=analogRead(ldrPin);
int ledVal = map (lightVal, 0,900,0,255);
digitalWrite(ledPin,ledVal);
delay(lightVal);
digitalWrite(ledPin,ledVal);
Serial.print("light:");
Serial.println(lightVal);
}

and gct code:
transaction graphChange 'Add lightVal'
{
feature User.Objects.lightVal Bentley.GC.Features.GraphVariable
{
Value = 10.0;
}
}

transaction graphChange 'Add line01'
{
feature User.Objects.line01 Bentley.GC.Features.Line
{
Direction = baseCS.ZDirection;
Length = lightVal;
StartPoint = baseCS;
}
}

transaction script 'Add assemblies'
{
AddAssemblySearchDirectory("E:\\RESEARCH\\ARDUINO_PROCESSING\
\UBIMASH\\UbiMash_v3.1\\library");
LoadAssembly("PubSubSubscriber.dll");
LoadAssembly("ResponsiveGC.dll");
}

Flora Salim

unread,
Oct 5, 2010, 8:44:09 AM10/5/10
to ubi...@googlegroups.com
Hi Davide,
Great to see you start trying out the codes.

If you've got light values in real time in SensorMashUI, you've configured the publisher correctly. Well done!
You now need to make sure that GC is set up properly. 
When you call ConnectUbi() what's the name of the variable from Arduino? Is it ARDLIGHT?
If it is ARDLIGHT, you might want to try to rename your GC variable as the same name as the published data - so rename it as ARDLIGHT - and call SubscribeAll() instead. I might need to update the code behind ConnectUbi() if what I thought might be a bug is true.

DLL means it's a compiled library, so you don't have to compile it again if you need to use the presupplied DLL such as for controlling servo. 

However, if you need to access the source code, it will be in Google code. As you use subversion, you'll be able to keep getting updates on the source code and you can also submit code revisions. If you do change the code, then you need to recompile it to produce DLLs.

Btw, which version of GC are you using?

Let me know how it goes.

Cheers,
Flora

DavideMadeddu

unread,
Oct 5, 2010, 10:33:15 AM10/5/10
to UbiMash
Hi Flora
I am using GC 08.11.08.202 and arduino 0019.
I have tried changing the name of the variables in arduino and GC with
"ARDLIGHT"
In GC if I use ConnectUbi() I am able to see the variables in left and
right panel and the values in the bottom panel but if i click on
connect nothing happens..
but..If I use SubscribeAll() is ok and i can control the length of the
line !!! :-D
I would thank you for your help!
And now..i would try the same thing with a potentiometer..
Finally I have a question..after this simple example (that it seems a
little check to control the GC and Arduino setup!)..can I use sensors,
potentiometer, buttons (...), simply adding as variables in GC and
Arduino?
I will try in next days..

Best,
Davide

DavideMadeddu

unread,
Oct 5, 2010, 10:53:28 AM10/5/10
to UbiMash
I found that it function only if the variables (in GC and Arduino) are
named as "ARDLIGHT"...even I use ConnectUbi() or SubscribeAll()...
Reply all
Reply to author
Forward
0 new messages