Showing posts with label technical. Show all posts
Showing posts with label technical. Show all posts

Wednesday, July 1, 2015

WIFI Configure Baud rate to 38400 instead of 9600 for both XBEES

http://cpham.perso.univ-pau.fr/WSN/XBee.html

Baud rate lists for ATBD
1 = 2400bps
2 = 4800bps
3 = 9600bps
4 = 19200bps
5 = 38400bps
6 = 57600 bps
7 = 115200 bps
http://forums.trossenrobotics.com/tutorials/how-to-diy-128/xbee-basics-3259/


These two are very reliable tutorials.

ATBD5
OK
ATWR (to save and lock in)
OK



And Saiful told me that I could use my powerbank to power my boards HAHAH

Tuesday, February 3, 2015

Got the easy part done - WIFI ARDUINO XBEE LILYPAD

Post 50

Happiness Level: 6

I have to admit, I have been avoiding this project for quite sometime ever since my Dengue fever.
But I did double check the connection with the wifi and it works fine.

To make life easier, and to clear up what the tutorial failed to mention, (which resulted me and Yee Siang into panic mode) is that the +++ command is automatic, but the other commands are not.

Which means after typing ATMY or any other command, you have to press enter.

If not you would be like me, waiting for the automatic OK response for like forever.

I used two computers to send the messages, my desktop and my laptop and configured the 2 xbees by myself, with the help of the tutorial.

This is the CoolTerm on my desktop which acts as the SENDER,


And the xbee,



And this is the CoolTerm (receiver) on my laptop.


And the Xbee.




One thing I noticed though, I cannot send messages from the receiver to the sender. Only the Glove Xbee could send the info, because I set it that way, There's not back and forth communication.
I don't think that would be a worry though, my project does not require back and forth comm.

Now to link it with Processing.
I'm not excited.

More things to do:
- Wait for Jam Long to reply me on the tutorial he had which could fix my unlinkable pages
- Set the invoke for the delay thing to restart. (probably only I would understand what I'm typing)

An update on the logistics too,
Looks like I won't be needing an arch or stage mount thing, the ceiling at Publika blackbox would suffice.
Sad that nobody wants to be near my installation because of its loudness.

As for the unity and the delay matter,
David told me that there is no such thing as 'YEILD' for unity C# and that I should only use INVOKE.


Monday, January 5, 2015

UNITY VIDEO-ARDUINO LAG SOLVED WITH READTIMEOUT

Post no 46

Happiness level: 10
Thanks to this tutorial, I have solved the lag with ReadTimeout!
Unity keeps reading the code from arduino causing my game to lag. So, I put a Readtimeout so that it only calls the info when there is change in the values! So happy!


And #projectbeautify commences.

I cut a bottle in half, stick some tape over the places I wanted clear and spray painted it white.

Will be adding further details next. I'm excited on how this would turn out!
The band seems a little bit tighter than usual now that all the boards are sewn in.


As for the wifi I have yet to get the parts from Singapore.


Monday, December 15, 2014

Preparing for Week 7 Guest Visit

Post 43

Happiness level:3

I've been really busy and focusing all my time on the construction of the wooband, codes and graphics. Full steam ahead!

Technical problems encountered:
- Unity can't change scenes with Serial ports. (can't call) Might have to put everything in one scene.
- SO LAGGY and the quality reduces because I had to convert all videos to OGG format.
- Only Unity pro could enable MovieTextures. (solved by using the trial mode..and uh. you know.)
- Arduino RGB colors overlapping each other (solved, but didn't get the color I want)

Motion Graphics problems encountered:
- I need plugins to achieve plexus. (It's complicated, I can't download them. And I'm cheap.)
- Had to depend A LOT on tutorials. (I thought my creative juices and spontaneity were enough, But no.)

Logistics problems encountered:
- My RM175 polystyrene ball dents easily and I don't plan on investing in another one.
- There's a line on the ball which has to covered. (It's the little opening that can't close properly when I sandwich the two halves together)

A great thank you to Yee Siang and David Tan for patiently teaching me and explaining to me the rules of Arduino and Unity.
I'm actually quite disappointed at TOA for not keeping up with the pace and installing UNITY in all the computers. They could install them for free and hire professionals! C# is dang important.

The only person who knows UNITY is Jam, and he's not even assigned to any of us. We had to call him on his personal mobile. This is ridiculous.

Can't believe I have to outsource so many talents and hardware.

Actions to do next:
TRY OUT THE WIFI MODULE!

Saturday, December 6, 2014

Logistics and Microphone Debugging

Post 39

Happiness levels: 8

Tutor(s) present: Jazmi, Yee Siang, Jam!

Okay first up, the logistics.





Jazmi and I discovered that there was a leak at the wall from my graphics and suggested that I should vignette it out so the hard edges would be gone and there isn't gonna look like an error.

Other than that, the outcomes were pretty good, I suspended my polystyrene ball with a piece of fishing string and clasped the two halves together with the roll of fishing string in between to hold it up from within. Discovered that if I wanted to project on two sides of the ball I needed 3m+ of space.
That would be difficult since there are going to be about 30+ projects in the same area.

Should I compromise with just one side of the ball? :(

Discovered that the ball should be slightly higher than eye level so the users won't be able to see the shadowed top of the ball. Overall logistics looks pretty good and the user would be standing behind the projector to interact with it. 

Ill disguise the table and projector into my glove compartment holder & table (which I would also hide my computers and what not under it) and wrap it around with white board so it looks super clean and white and professional looking,

So happy everything works amazing.

Microphone Debugging

Jam came to the rescue!
My microphone got fixed and apparently I was uploading unnecessary scripts which hindered it to work. I also had to fix the baud rate so it matches the baud rate of my accelerator code. Everything is moving along swiftly. 
I just have to turn the strings to numbers with Parse and put them altogether, separate the game into three parts and upload the videos separately and I'm done with the coding! I'll have to focus on the wifi module next. (oh god)

And sewing. =(

Things to do next:
- Finish up the motion graphics for the two songs
- Code up the game
- Debug Wifi


Friday, November 28, 2014

Ball and things

Post 38

Happiness level: 6

Personal progress

As for unity, David has coached me own how to create and link my scenes in UNITY. To call the scenes I would have to use 0 or 1, I think it's way better, you couldn't get the name wrong by typo.


I have also purchased my project ball. It's diameter is about 50cm, it's a bit small but it's alright since the users are going to be standing really near it and the projector wouldn't be so far. I have a limited space only. It's crazy expensive, RM175.

As of for now I have spent RM720 on materials. So expensive. But if you look at it from an agency point of view, it's actually a pretty cheap project. Many projects reach thousands of ringgit. Yeah, I'm comforting myself.




Tutor(s) present: Yee Siang

Yee Siang lent me this microphone from college which worked perfectly. The problem with my previous microphone was that it was too sensitive to sound. Excuse my badly manicured finger.



Thursday, November 20, 2014

Placement and Wiring Test & Testing out microphone

Post 35

Happiness level: -10

Personal Progress

I tested out the placements and the wiring at home the night before the Friday consultation, and tested the microphone in the morning. While testing out the wiring with fishing string, I discovered a couple of problems. It's a lucky thing I had experience with circular boards, I would know how to deal with overlapping wiring.

I took some notes on which port would be nearer to certain parts, which would also then effect the way I code my boards.

- accelerometer change from a0 to a1 for z
- rx tx need to be taped over to avoid interferance
- RGB bulb change to pin 5 6 7 rather than 9, 10 , 11


References

Barragán, H. (2014). ElectretMicrophone \ Learning \ Wiring. [online] Wiring. Available at: http://wiring.org.co/learning/basics/electretmicrophone.html [Accessed 20 Nov. 2014].
Instructables, (2014). The microphone and breakout board. [online] Available at: http://www.instructables.com/id/Arduino-Wind-Instrument/step4/The-microphone-and-breakout-board/ [Accessed 20 Nov. 2014].

Tutorial Session

Tutor(s) present: Yee Siang

I brought my woes and my microphone and did not get to solve it.
I could have burnt my microphone.

I keep getting values even though the board wasn't hooked up to the microphone.
And when I did, Yee Siang suggested that I poke through the holes with wire instead of using alligator clips because it couldn't reach deep enough the breakout board.

It worked for awhile, but the value changes with movement. It's almost like a touch sensor rather than a microphone.

I was utterly depressed and unmotivated when I couldn't get a 'supposedly easy' mechanism to work and took 4 hours to do it. Even connecting to arduino with the accelerometer was quicker. One of the reasons why I was devastated is because I worked with sound sensors/mics twice before and had amazing results. I even singed bits of conductive thread today. Sparks. Fire. If I had burned my microphone, I burnt 8USD, just like that. With no ROI.

Why am I failing at this now? I'm determined to get it to work. In the mean time these are my current to do lists for this project.

- Make game mechanism in UNITY: Put accelerometer and changescene scripts
- Get wifi module to work
- Get microphone to work
- Sketch stage for projection mapping
- Sketch wiring in Ai
- Sketch motion graphics

It's getting down to the wire, I better get some graphics in already too.

Tuesday, November 18, 2014

It works

Post 33

Happiness Level: 6

I have made it a point to record every single detail of my working progress.

Note to self:

1. Open arduino first and link up the sketch,
then only open unity.

Why? If I open up unity first, the serial port would be already in use and I wouldn't be able to upload new sketches to my board.

2. z to a2

Wire it like this. I'm only using the Z index, so yeah I only need to hook one up.

3. blah c# script put ON THE CUBE (element)


Yes, out of frustration I named the file blah. I tried renaming it but it messes up everything. So yeah, I'm sticking with blah.


I was trying to hook up my wifi module and connect it to the computer but had some troubles. Apprently online people said the usb port has to be on com1.

I downloaded different terminals, hyperterminal, coolterm, x-ctu and XCTU. Still doesn't work. I'm starting to think it's the wiring problem.

Totally cannot be the driver problem because I already got the accelerometer to work.

BUT, after awhile I got it to work with HYPERTERMINAL and it connects! You had to pay for it.



I had to make sure the board is clean from code, I got spammed because my accelerometer code is still in it.

I have to adjust Baud rate to 38400 so I don't get alien wordings. Like this.


So after awhile I got what I wanted, but not really. It didn't say OK like it's supposed to after I typed in +++. It's to show that it's connected. Tutorials in the links below.
It was supposed to be +++OK.


Well, it's a step.


References

Faludi, R. (2013). Common XBee Mistakes. [online] Faludi. Available at: http://www.faludi.com/projects/common-xbee-mistakes/ [Accessed 18 Nov. 2014].
Hartman, K. and Faludi, R. (2012). D I Y : Superhero Communicator Cuffs. 1st ed. [ebook] New York: OCAD University. Available at: http://research.ocadu.ca/sites/research.ocadu.ca/files/socialbody/201106_SuperHeroCommunicatorCuffs.pdf [Accessed 18 Nov. 2014].
Ladyada, (2012). Xbee Adapter - Connecting, Configuring and Upgrading. [online] Available at: http://www.ladyada.net/make/xbee/configure.html [Accessed 18 Nov. 2014].
sparkfun, (2014). Serial Terminal Basics. [online] Available at: https://learn.sparkfun.com/tutorials/terminal-basics/all [Accessed 18 Nov. 2014].

Friday, November 14, 2014

First Technical Tutorial of the Final Sem

Post 32

Tutor(s) present: Yee Siang

Happiness level: -5

Yes, this is the first time my happiness level went below 0. Not that seeing him after the two month holiday was bad at all, it was more on how embarrassed I was with the little progress I had for the technical parts over that period.
Spent the whole time trouble shooting stuff I managed to do at home on my desktop. One thing I did though, I tried out the wifi router,

Problem 1:
I didn't record my success and what I did when I got the Unity and Arduino linked at the time, (the post which had a youtube of me waving around the working accelerometer)
I didn't even record how the wiring map looked like. I brought the try out files with ghoul files with weird namings like 'blah, tryout, try2' so I did not know which file was the exact one which worked.
So here it is:





Problem 2:
I did not try out the Xbee wifi module at all and discovered that XCTU was more complicated to use than I thought it was. There;s this new software called CoolTerm which I found online on the Arduino site which could help with the wifi on my xbee.


Saturday, September 20, 2014

TESTING ARDUINO + RGB BULBS

Post 29

OH GOLLY IT WORKS! I SUCCESSFULLY CONNECTED ARDUINO TO UNITY. LIKE YEAYS.

And my RGB works!
Turns out I couldn't use any other FTDI other than the special FTDI FOR Lilypad.



This is me testing out the accelerometer in Arduino.



Here's a video of me waving it around with unity at the background.



I had an error about an extra unused class but it was just a minor problem. They didn't want me to waste the declaration.

I'm overjoyed. One step closer!

ALL THANKS TO THESE TUTORIALS:

I'm going to add a Happiness level graph later on. I thought I wanted it to be Stress Level, but..it's a little bit discouraging for my tastes.

Happines level : 10


References

LilyPad Arduino, (2013). LilyPad Accelerometer. [online] Available at: http://lilypadarduino.org/?p=384 [Accessed 20 Sep. 2014].
Mengsk, C. (2010). Unity3d + Arduino (Read serial in Unity3d) - Arduino Forum. [online] Forum Arduino. Available at: http://forum.arduino.cc/index.php/topic,40001.0.html [Accessed 20 Sep. 2014].
Stackoverflow, (2014). Weird warning : "is assigned but its value is never used". [online] Available at: http://stackoverflow.com/questions/6330491/weird-warning-is-assigned-but-its-value-is-never-used [Accessed 20 Sep. 2014].

Sunday, September 14, 2014

Misery & Linking Arduino to Unity

Post 28

I tried and tried again with my boards but it just couldn't connect.

I keep getting the same errors I got in my Aug 27 post.

Turns out I had to buy a SPECIAL FTDI Breakout board and the one I got from China is not compatible.

So, I have to get a new one. From Singapore.



I'm going to have to use my Adafruit flora to test this out while waiting for my usb chip, the tutorial to link unity and Arduino looks pretty simple.

My adafruit Flora works swimmingly and I got the response I needed. Step 1 complete.



I keep getting errors for the UNITY. Will look more into this soon. I can't seem to find the problem, I followed the tutorial word by word.





I'm going to start on editing the music tomorrow.


Happiness Level : 2

Wednesday, August 27, 2014

Starting with the Arduino

Post 25


Alright looks like I'm facing the same problem like I've had since Livetags.

I CAN'T ARDUINO ON MY WINDOWS 8.1 LAPTOP.

Apparently the my OS could not recognize the drivers. I'd probably end up using my old desktop to code the Arduinos like last time.

But, the thing is, I need my laptop because it's portable.

Below is the video of what I'm experiencing exactly. Except that I update the drivers from the windows folder. But it keeps saying is already updated with the best drivers. My COMPORT is still not lilypad.

The sketch and tutorial for the RGB LED is Here.

I get this error after uploading my sketch: avrdude stk500_getsync() not in sync resp=0x00

Researched online and it's probably a driver problem.


So this is what I did today.

I hooked up my arduino and it could upload the Basic Blink Sketch. I doesn't loop forever though.


So fix the drivers, I tried installing the FTDI drivers from here but it still wouldn't work.

And this is only the first day.

Happiness Level : 4

References

Buechley, L. (2014). programming the LilyPad Arduino: color (RGB LEDs). [online] Web Media MIT edu. Available at: http://web.media.mit.edu/~leah/LilyPad/06_rgb.html [Accessed 27 Aug. 2014].
Ftdichip, (2014). Virtual COM Port Drivers. [online] Available at: http://www.ftdichip.com/Drivers/VCP.htm [Accessed 27 Aug. 2014].
LilyPad Arduino, (2014). Lesson 2: Light (LEDs). [online] Available at: http://lilypadarduino.org/?page_id=212 [Accessed 27 Aug. 2014].
Van Vlymen, B. (2013). problem with serial port Arduino uno on Window 8.1. [online] YouTube. Available at: http://www.youtube.com/watch?v=uZpyPgk5NmU [Accessed 27 Aug. 2014].

Friday, August 15, 2014

Meeting with our Specialists 9

Post no.20

Tutors Present: Yee Siang & Jam

So today I brought my TM router and boards for my 10.30 Am tutorial. Yee Siang was testing out my router but we couldn't get it to work because the default password (blank space) for the D-Link wouldn't get through although we reset it a thousand times.

Finally he opted that I get a cheap TP Link router from lowyat at RM79. Their product lists is HERE.
He suggested that I didn't need to get the 3G/Unifi router. I could just get AP/ROUTER/Repeater.

Then Yaw walked in and he brought in the exact same router we were talking about! His project needed wireless connections too for his web sockets.

He tested Yaw's router and it worked perfectly!

One thing he said to us is that we should reserve the IP address for our wireless device if not they're just going to keep refreshing whenever we restarted our machines.

Finally after

3 weeks, my parts from China arrived!
My two FTDI boards, Arduino Lilypad and two RGB leds arrived safely.


HOWEVER, I realised I bought the wrong FTDI cable because I bought the one with teeth on it. My arduino had teeth on it as well. So how are teeth and teeth going to connect to each other?

I was supposed to get THIS ONE!
But instead I ordered THIS ONE!

See? The Arduino has teeth too.
Jam came to my rescue and loaned me some cables so I didn't need to re-buy the parts. Thank you Jam.
So, I used the female-female cables to connect them. I was so relieved. Jam also borrowed me 4 makey makey alligator clips for my testings.


CURRENT UPDATED EXPENDITURES:


I found some videos that could get me started with the connections:

This one sends data from the computer to the the Xbee:

This one receives data from the xbee to the computer:


Happiness Level : 6


References

Arduino, (n.d.). Arduino - ArduinoBoardLilyPad. [online] Available at: http://arduino.cc/en/Main/arduinoBoardLilyPad [Accessed 15 Aug. 2014].
Gravitech, (n.d.). Arduino LilyPad/Pro/ProMini Programmer. [online] Available at: http://www.gravitech.us/arliandpropr.html [Accessed 15 Aug. 2014].
Jung, C. (2014). Lilypad Arduino Xbee Communication (Receiving Data). [online] YouTube. Available at: http://www.youtube.com/watch?v=LesKsP5-olM [Accessed 15 Aug. 2014].
Jung, C. (2014). Lilypad Arduino Xbee Communication (Sending Data). [online] YouTube. Available at: http://www.youtube.com/watch?v=Xjg4oRwSDE0 [Accessed 15 Aug. 2014].
Pricelists. (2014). 1st ed. [ebook] Malaysia, p.1. Available at: http://images-cdn.lowyat.net/pricelists/PCHardware/C-Zone/pchardware-czone.pdf [Accessed 15 Aug. 2014].
TaoBao, (n.d.). 【Realplay】USB转TTL 支持3.3V 5V双电源FT232RL FTDI MWC调试器. [online] Available at: http://detail.tmall.com/item.htm?spm=a230r.1.14.1.hUAnPU&id=26917352895&ad_id=&am_id=&cm_id=140105335569ed55e27b&pm_id= [Accessed 15 Aug. 2014].





Monday, July 28, 2014

Learning Unity and C#

Post no. 15


Friend and Tutor(s): David Tan - UNITY Game Developer at MediaSoft

Already having moderate knowledge of JavaScript and Actionscript, David was so kind to teach me UNITY and C#!

As for the finished lesson, we managed to create a game with two interchangeable scenes via clicking.

Here are a couple of screenshots!

This first screenshot here, shows how I could drag effects like water, smoke, particles and such from the assets.


He taught me how to animate via sprite!


For the Animation Script,
He used DeltaTime to Average out the time, basically giving it optimum time the graphics need. The sprite is easily separated, all I needed to do was go to Sprite Mode>check multiple> and slice. I have to make sure the background is transparent.

There was a problem at first when he was trying to animate it because the code kept waiting for the 8th Frame when it only went to the 7th. So, he added a -1 to its code like this:

(frame > animate.Length - 1) then  frame=0.

else,

GetComponent<SpriteRenderer> ().sprite = animate [(int)frame]; 

I needed to convert the integers into frames so the program can recognize them!

Then it worked fine!


Okay so basically this is what I've learned:

There's three types of coding that I could do, Boo Script, Java Script and C#. Personally I think C# is awesome cause they have drop down shortcuts for me to use like Actionscript. It's very much like the combination of the two; (JS and AS).

So Hierarchy is something like a library, - a place where you could temporary store your elements. To keep the area clean, it's good practice to make a Prefab folder where it could store all the elements' properties and children.

In the script, you could just load them up from the PreFab folder.

Individual scripts can be dragged and dropped into different elements. I could do it the old fashion way by giving it a tagname (kinda like instance name : FindObjectWithTag) but it would be too much of a hassle when I could just drag and drop!

So the Inspector contains all the element's properties. Like the scale, positions and such.
It's basically 3D space, so if I were to create a background, I would just need to insert a plane element onto the stage.

I could either choose Perspective (3D) or Orthographic (2D)

The clipping planes set the maximum and minimum for the camera.

To add a layer, I could just simply look for the through the first sentence in the Inspector tab. I could hide and see them just like I would do in AI or Photoshop.

Unity already has automatic physics ready at my dispense, so he dragged RigidBody into one of those elements. When he clicked play, it fell onto the plane(floor) created!
To access RigidBody, I would just need to go to top tool bar and hit 'Components' > 'Physics'.

I could create spotlights in hierarchy as well to play with shadows. (Shader)

Then, he opened a C# doc, and changed to position with code.
LocalPosition affects the scene space whereas Position affects just the object itself.

As for scaling, there is just LocalScale.

Float is for values that contain decimals whereas Int are for rounded of integers.

Just a basic little reminder:

up : +y
left : -x
right : +x
down : -y

To test script, like Trace in AS I was required to type 'Debug.Log("CALL/whateverIwanttocheck")

COLLIDING: The element falls and stays on top another element.
TRIGGER: The element can fall through another element. To enable this, click the trigger option at Box Collider.

If I see and error with Null Object, it means that one of the obj has no reference. Like, it;s calling something that isn't there. So it's best to check if you properly linked the objects to the elements.

To CLONE and object: "Instantiate(clone)" Instantiate basically means create, or initiate.

He put in a code Quatermion.identity and said it's basically for rotation.

Okay so basically for my game, I didn't want any key to be specific and have their own layers to upload. I want it at a first come first serve basis. So it should look like this:
It's put under Update so it keeps running.

void Update () {
if (Input.anyKey)
{
if (Input.inputString != "")
{
Debug.Log(Input.inputString + " call");
}


And at the top, to test :
string name = "dog";

Once played, the program recognized that 3 characters are present.

MOUSECLICK
To create a button, he first showed me the GUI method. Which is inefficient because it would keep running as it its placed under Update.

void OnGUI()
{
GUI.Label (new Rect (10, 10, 100, 100), "Blah!");

if (GUI.Button (new Rect (10, 50, 100, 100), "Channge", style)) {

Application.LoadLevel (1);
}
}

The Application.LoadLevel is to call the second scene. Once I publish, I could see its ID on the right to the name of the file. Like 0,1,2 and so on.

So for a more efficient way, he did this:

if (Input.GetMouseButtonDown(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit, 100))
Debug.Log(hit.collider.name);
}

For the number beside GetMouseButtonDown(0):
0 : Left click on the mouse
1: Scroller on the mouse
2: Right Click on the mouse

Basically there's this RaycastHit function where a ray would be shot in front of the object to test whether it is there after the mouse is clicked. (therefore, it would only run one time) So, it could sense that it is there.

Ellipsoid is a kind of particle property.

To add text into the stage: GameObject>insert 3D Text)

TO EXPORT: I can go to File>Build Settings and click switch platform if I needed to switch between mobiles and what not.

TO HIDE A SCENE/ELEMENT: It's pretty straight forward, it's Other.GameObject.SetActive(false).

TO UPLOAD A FONT: Just drag and drop the ttf into the folders! 

For uploading the CAMERA : I just needed to paste this chunk of code.

WebCamTexture webcamTexture = new WebCamTexture();
renderer.material.mainTexture = webcamTexture;
webcamTexture.Play();

ENUM (Enumeration)
This term was new! But it works the same as SwitchCase in AS. I could put in switches in it too.

Basically the wonderfulness of c# is that you don't need to define every single element individually by creating public vars one by one. Which is annoying. I could just do this!! Just commas! Amazing!

public enum item
{
rock,
stick,
paper

then

if (pick == item.rock)
{
}
else if (pick == item.stick)
{
}
else if (pick == item.paper)
{
}

IT'S SO CLEAN!

Okay, now to the complicated part.


DELEGATE
Now what is that?
Delegate is kinda like a remote control/mini robot to help you organize which script to call first. Sometimes there are two scripts, one running slower than the other. We need delegate so that the faster script doesn't run so fast when the slower one is not completed yet. Basically, to input hierarchy and to check it the script is being run or not.

So, I will have to put this line of code under the Start function in my ChangeScene script:
objDelegate.call += Trigger;

and put :

if (Input.GetKeyDown(KeyCode.Space))
{
if (call != null)
call (" dog");
}

in my Delegate script. I have to make sure I put using System; at the top to call the system from the library if not its not going to work!

Anyway, I learned alot through this 4 hours! Amazing! Maybe TOA should hire him to teach UNITY. (it's the FUTURE!)



Friday, July 25, 2014

Meeting with our Specialists 7

Post no.14

Tutor(s) present: Yee Siang

So the moment I saw him, I immediately told him my woes about whether the wi-fi could connect to my home router. His reply released all my tension. He said yes!

He brought his box of sensors, and showed me this really cool heartbeat sensor. Also, since I didn't buy the accelerometer sensor just yet, he showed me his tilt sensor!

Yee Siang taught me how to connect my router and check out my I.P. address as well. He said I needed to test if the lilypad xbee could work on its own without the main board. To connect the Xbee to the computer I needed to know php. *gasp* I know none of it.

He wants to know how sensitive Trace Sensors are since he was more familiar with wired sensors (the one with the antenna sticking out).

I could test the lan connection of the home router (the one Gerry's housemate so generously borrowed) first with my computer and other computers, but I need to get the cable to connect them first.

PLANNED ACTIONS:
- Sketch some graphics for goodness sake
- Test if Lilypad Xbee could be used as a main board


Next Session: He wants to see a working prototype.

Later in the evening.


My boards came today!


I didn't order a few items like the accelerometer, the RGB leds and the vibration motors. I couldn't see the price tag go up to 300 Sing. Also, I had to make sure that I was going in the right direction. I want to dip my toes in the lake first. But in this case, I've already dipped my entire right leg into it.


But, l discovered I'm missing this piece! The FTDI chip to connect to the Arduino lilypad.

I had a friend in UK that gave me a private message (Justin Kong) about how cheap all his components were because he shipped them from China. And I was thinking, WHY didn't I think of CHINA's TAOBAO in the first place?! They sold alot of sensors at such a cheap price, I could get the arduino lilypad at just RM11 when I bought it at RM70!

However, they didn't sell some of the parts which I bought, so that was a huge relief. I noticed I accidentally ordered TWO lilypad Lipowers. How silly of me.

Justin was really helpful, he gave me a pdf on C language and it looks really useful! He said that he could be able help out with some stuff in the process when he comes back to Malaysia for 2 weeks. After that, he's going back to UK to start on his PhD in Mathematics. And he's only a year older than I am. *APPLAUDS*

I fixed the Trace Xbee onto the Lilypad Xbee. At first, it didn't quite fit because I had it facing the other way. I panicked a little.

I turned it around and, OH IT FITS! I was so glad. Another weight lifted off my shoulders.

I measured all the parts on my hand and discovered that this wearable was never going to just fit on my hand. It was going to be an ARMBand.

It's going to be called a WOO BAND. I'd better do some research on the name in case it means something horrible in another language.

As for the installation mechanics, a friend from my cellgroup (David Tan) is willing to meet up and teach me some UNITY! I have always wanted to learn the software!

I'm also quite glad that I do not need to use Actionscript anymore (hopefully) because apparently UNITY could link with ARDUINO!

I'm so glad that I have friends to help!

I sound extremely excited and loud in this post albeit the bad news of my participation in recent awards and college.

I guess I'm just really excited with this project!

So, my current team mates for my final year project would be (they don't know they're in it):

- Me
- Yee Siang (Arduino's expert a.k.a. my tutor)
- Jazmi, Sweii , and Daniel Chong (Contextual  and User Experience Gurus)
- David Tan (UNITY game developer)
- Justin Kong (Self initiated Arduino Robotics expert - he's doing a self-balancing robot right now: I'd like to know how he handles the accelerometers' sensitivity and axis')
- MY DAD (he's going to be helping me with the sewing)
- Gerry (he's going to be dealing with little technical problems I have and my ever so fluctuating moods)

Ohmygod! That's a team of 7 already! 

I'm going to name us, THE CREED. (I'm easily influenced by the current books I read)

Somehow, I love basking in the glory of being so technical.

Friday, July 18, 2014

Meeting with our Specialists 6

Post No. 11

Tutor(s) present: Yee Siang

I have added a label and separated my sessions between idea and technical posts.

I discussed my technical concerns about how bluetooth is limited and I would connect my boards to to the computer.
YS then suggested I stick to wifi connections because BlueTooth had latency- it lags when it sends and receive signals.

We also decided how I would need to get a Lilypad board instead of reusing my Adafruit Flora.
Reason why: My Adafruit Flora could not support wifi signals.

There are several types of Lilypads, so I did some research and discovered that I had to get the one called Lilypad Xbee, which is made to connect to the Wifi Xbee board.

X-BEE 

The one on the left is the Xbee with the Trace Antenna, the one on the right is the Xbee with the Built-in Antenna. Basically its just the one on the left, but it has an a black antenna soldered into it. I proceeded to find the difference.

One of the comment by the name of SteveCh clarified this with his comment made 2 years ago the difference between Printed Circuit Board and :
 "No RF-way to solder on an antenna where there already is an antenna. Disrupts the impedance. There are XBee’s with u.FL connectors so you can plug in a coax going to a variety of antennas.
PCB(Printed Circuit Board) antenna to me means antenna formed by copper traces on the XBee. That’s what’s talked about in the WRL-11215. There is/was an XBee with a similar antenna, in the form of a (blue) silicon chip antenna that mounts on the PCB. That kind of chip antenna is widely used in WiFi and Bluetooth. The antenna has poor/negative gain and an irregular radiation pattern. The PCB trace antenna is likely very similar to the chip antenna, but less costly.
The wire antenna, if you have the space, and if the XBee isn’t inside a ferrous metal box, is the best choice. If in an aluminum box- you may be surprised as to how RF-transparent aluminum is, vs. steel."

Antenna, Antennas, Antennae...

  • Chip Antenna – Basically a small chip that acts as an antenna. Quick, easy, cheap, not in the way. These are being phased out in favor of trace antennas, which are essentially the same but printed directly to the circuit board.
  • Wire Antenna – Well its a small wire sticking up, a little more of what you think of when you think of antenna.
  • u.FL Antenna – A tiny connector to connect your own antenna, this is great if your object is in a box and you want your antenna outside the box.
  • RPSMA Antenna – A bigger connector to connect your own antenna, once again great if your object is in a box and you want your antenna outside the box.
  • Trace Antenna – Also called a PCB antenna, these are formed directly on the module with conductive traces. 


They perform about the same as wire antennas.This entire text is found from the Xbee Buying guide from Sparkfun here. It cleared up alot of confusion! 

After reading all and comparing all of them, I wanted to get the PCB antenna. Its antenna is embedded into the chip. But after much research, the Trace Antenna is the PCB!  (got stock) It might be the more likely one to be bought. (8pins)


There's a question on StackOverFlow regarding multiple receivers of multiple Xbees.
Here.

Here's a video tutorial on Xbees: Here

Through this tutorial I discovered that I would need to connect my Xbee to an API ROUTER, because I'm going to be using more than one device. Through his tutorials, I also discover that I needed to download a software called X-CTU to upload to the wifi boards.


I called and checked their stocks, There's only one left in MyDuino!

As you can see the one on the left is the LilyPad Xbee and the one on the right is the LilyPad Arduino. The LilyPad Xbee has two rows of sockets that could nicely slot the Xbee wifi board.

I might also need to buy The LilyPad Arduino as the Main board and connect it to the LilyPad Xbee. So I might need both.

Here are more details on the Lilypad Xbee and each ports' functions.

DETAILS ON LILYPAD XBEE

More tips on how to connect both of the main board and xbee wifi together : Here and Here





Here's the tutorial on how to link my boards via wifi and connect it to a Router which I fortunately could borrow for free from a friend who wasn't using it anymore.

TUTORIAL TO LINK LILYPAD TO COM VIA WIFI

The battery

So for the batteries to power my wireless device, YS suggested I go for a 5V Power supply.

The one below is the Lilypad Power Supply DEV-11259. It runs on AAA batteries and is easy to switch. However, it is very expensive to ship and it takes a month. This board amps up the voltage to 5V, from the 3.3V the AAA battery gives.


The wiring is not messy. Below is map that connects to the microphone I plan to sew into the glove. This is the mic that could detect the volume and initiate the installation. It's called the Electret Microphone Breakout.



Therefore, I opt the second option, which is to get a Lilypad LiPower. It's smaller too. This little extension also amps up the voltage to 5V, my ideal amount of voltage. Below are some of the examples for wiring the board with the LiPower and the Polymer lithium battery.


This Polymer Lithium Ion battery - 400mAh has 3.7V but it will be amped up to 5V from the Lilypad LiPower above. It comes with the JST cable too, the one that is red and black in color. The wire goes into the white socket in the image above to power it.

 Below are some examples of how to wire the Lipower to the LilyPad.



They are using Arduino Lilypad for the picture above.

The wiring 

First I would need conductive thread, this would act as the wires.
This one in particular is only $5 and its 30ft. The Conductive Thread Bobbin.



I had one question, do I need an extra board Arduino Lilypad to connect to the accelerometer like the wiring map below, or could I just attach it to the Xbee? And the answer is YES, YES I DO. I can feel my wallet getting colder already.


This images are from a tutorial from here. They are communicator cuffs.

Feedback 
I probably would also need the lilypad tri-color LED as feedback on the glove.

Below is a vibration motor. A prompt to get the users start Fist Pumping.



I researched thoroughly. I don't wanna be cheap and naive like the last time. For livetags, we actually bought the wrong board. Waited 3 weeks for it. But since my mom is going over to Singapore next week, I could ask the shop to deliver it to her office like the last time I did for the Adafruit Flora.

Basically, this is the closest map I could find to what I need. Without the extra LED's at the pinky and ring finger.

I got this map from here.

Here's a really good tutorial site as well: HOW TO GET WHAT YOU WANT

I did a calculation to my overall budget for one glove, and it came to RM407. Looks like its gonna be just one player. SO EXPENSIVE. My budget is 500. That's it. It's gonna be just one user.

The Xbee board may not be available in Singapore, but it could be bought at MyDuino Malaysia.


Apparently I need an xBee connected via usb to my computer to send the signals out to the other xBees. That means if I want two users, I need to have 3 xBees. 1 for my computer, and two for the remotes. So, yeah my budget already reached 500+ before even starting on the project.



References


Fusion-artist, (2010). Marco's XBee Tutorial. [online] Available at: http://fusion-artist.com/XBee/XBeeTutorial.htm [Accessed 18 Jul. 2014].
HOW TO GET WHAT YOU WANT, (2010). XBEE DIRECT (MULTIPLE XBEE – XBEE- COMP). [online] Available at: http://www.kobakant.at/DIY/?p=270 [Accessed 18 Jul. 2014].
Lilypad XBee, (n.d.). LilyPad XBee. [online] Available at: http://lilypadxbee.faludi.com/about-board/ [Accessed 18 Jul. 2014].
Sense/Stage, (n.d.). Using your own Arduino-XBee combination. [online] Available at: http://sensestage.hexagram.ca/using-your-own-arduino-xbee-combination [Accessed 18 Jul. 2014].
Sgbotic, (2014). Singapore Robotic. [online] Available at: http://www.sgbotic.com/index.php [Accessed 14 Jul. 2014].
Smart Citizen, (2014). MANUAL SETUP : THE SERIAL WAY. [online] Available at: http://smartcitizen.me/posts/view/10 [Accessed 18 Jul. 2014].
Sparkfun, (n.d.). XBee Buying Guide. [online] Available at: https://www.sparkfun.com/pages/xbee_guide [Accessed 18 Jul. 2014].
Stackoverflow, (2014). swing - How to Send and Receive Multiple XBee's Packet in Java Properly. [online] Available at: http://stackoverflow.com/questions/24632318/how-to-send-and-receive-multiple-xbees-packet-in-java-properly [Accessed 18 Jul. 2014].
YouTube, (2013). XBee Basics - Lesson 1 - General Information and Initial Setup. [online] Available at: http://www.youtube.com/watch?v=odekkumB3WQ [Accessed 18 Jul. 2014].