2010年5月31日月曜日

Serial.print(num,type)

http://arduino.cc/en/Serial/Print

the word "byte" confuses me.

a "byte" sometime indicates

"A byte stores an 8-bit unsigned number, from 0 to 255."

but in a parentheses  of Serial.print, "BYTE" indicates 2 bit. 

Connecting Arduino and Isadora version2

I made up a more easy way to connect Isadora and Arduino.

First I need to do is write a program for Arduino

------------------------------------------------

int digiPin = 3; // This number will decide the input digital pin
   
int val = 0; // just a variable for calculation

void setup()
{
  Serial.begin(9600); // serial speed
}

void loop()
{
 val = digitalRead(digiPin); // read the input pin
  Serial.println(99,BYTE);

/*

99 = c It is ASCII Any world is fine as long as match with Isadora,

BYTE indicate 2-bit it seems critical, since other commend did not work.

*/

 
  Serial.println(val); // actual data which will be sent 
  delay(1000); // control frequency  
}

----------------------------------------------

The next step is to run Isadora

Prepare "serial in watcher binary"

Double click it and open a window

type in followings

---------------------------------------------

"c"

value_2 : integer = 2 digits

---------------------------------------------

c must be a small c not a large C

Any word is fine for "value_2"

Since this program deal with 2-bit, the number 2 before digits can be omitted.



Setup serial seed and port.

Make sure serial is enabled.


It should be OK


Main strructure of the Arduino board

http://www.arduino.cc/en/Main/ArduinoBoardDiecimila

Isadora with Arduino video

Succeed connecting Arduino and Isadora

I finally succeed connecting Arduino and Isadora.

This is today's goal, so I am happy.


I am preparing the youtube video.

Basically, I analyzed a source for Arduino made by somebody.
I prepared hardware based on a example that is shown in a tutorial of the Arduino webpage.  

http://arduino.cc/en/Tutorial/Button





And then move to the Isadora and setup USB port.








make sure that the seep is set properly and choose right connection(in this case COM3).

Sometime Isadora can not find the USB connection since other software uses it. 

In such case , most of the time Arduino programing software using the connection so just close it.

However, somehow it is still unstable, and Isadora was dead couple times.


More experiment result check video.

The sources are come from below link

http://forum.troikatronix.com/forum/Isadora_C2/Communication_%26_Sensors_F6/Arduino_to_Isadora_Example_P3642/



From the experiment

Test of the switch

2010年5月30日日曜日

Collaboration Isadora and Arduino

I understand a way to connect Isadora and Arduino little bit.

I, actually, could send some data from Arduino to Isadora, but I could not control it since I did not have hardwares and my understanding of program and hardwares was not enough.

As long as I seeing a program for Arduino, it is very simple.

I think that I need to understand Isadora more to solve this issue.

I will hack the ready made program to understand more properly and to control Isadora well tomorrow.



Somehow, my computer had a problem, probably at my video card, while I am running the program on Arduino. It was bit scare me.


else if (program)

It is little bit difficult to control. The location of the increment is critical.


//========program================================
int a;

void setup()
{
Serial.begin(9600);
Serial.println("test of if");
a=1; //set a value for variable a
}
void loop()
{
if (a++, a <>20)
{
Serial.println("else if");
delay(10000);
}
else
{
Serial.println("else section");
delay(5000);


}
}

Useful webpage for Arduino

http://www.ladyada.net/learn/arduino/index.html

Useful webpage for learning


about variable

http://www.javadrive.jp/start/var/index4.html  (Japanese)

The webpage is actually designed for Java but it works well.

about increment and decrement 

http://www.javadrive.jp/start/ope/index6.html (Japanese)

"if"

http://www.javadrive.jp/start/if/index2.html (Japanese)

Fixed program

Problem fixed version.

test of "if"

Square root test with arduino

Square root (Memo/note)

Square root


√ is expressed by the symbol sqrt


Therefore, in the program, it will be like following.

/*

  |\

  |    \   c

a|       \

  | ____\

       b

*/

int a, b, c;

c = sqrt(a*a+b*b);


Center for Contemporary Art in Kitakyusyu(Research)

Center for Contemporary Art in Kitakyusyu(in Japan)

http://www.cca-kitakyushu.org/english/index.html

Icinema(Research)

Icinema does  very interesting experiments of interactive video art. 


http://www.icinema.unsw.edu.au/index.html

Riley Harmon(Artist research)

Riley Harmon uses Arduino and makes interesting pieces.

http://rileyharmon.com/09/2009/lag





Research

SONY ExploraScience

http://www.sonyexplorascience.jp/english/index.html

Onedotzero (related to art and technology)


Onedotzero has a film festival that  mainly  about innovated and technological film.

It matches my interesting field. 


Onedotzero

http://www.onedotzero.com/events.php



My piece that was made for my NewMedia project 1 will be sent to Onedotzero.

Check my old blog for NewMedia.

http://newmediacourseblog.blogspot.com/

Program test

New Program(original)

This is a program that control LED with more conplex way.
========================================================

int w, r; //define variables
int e=13;

void setup()
{
Serial.begin(9600);
Serial.println("ligth control with variable and increment"); 
w=1;// add a value to the w in this 'void setup' section
}



/*
Basically, this program use increment to control the length of the LED litten.
Increment add +1 to a variable whenever the loop goes and the length(time) of the delay is
decided by the variable.
*/



void loop()
{
w++; // increment(add +1 whenever this loop goes)
digitalWrite(e, HIGH);
delay(r=w*1000); //r is a variable for length and its value is decided by e variable
digitalWrite(e, LOW);
delay(1000);
}

2010年5月29日土曜日

extra

Calculation of floating decimal point


This is a test of decimal point.

Instead of use "int", I use "double".

Text sent back from Arduino


Arduino

void setup()
{
Serial.begin(9600);
Serial.println("Hellow world");
}
void loop()
{

}


Java

class sample{
public static void main(String args[]){
  System.out.println("Hello World");
}

}


Both languages use "println" to display words. It makes easier to understand.

Also escape sequence is available such as , \n.

A little modifications of the program and circuit

FOR Emily
this circuit might have a problem. It was worked perfectly yesterday but it burn my LEDs today. I totally do not know why.



This circuit and program are control the LEDs. The green LED lits 0.1 second and 0.1 second later, the Red lits 0.6 second.


I know very very little bit about Java. Java developed from C and the Arduino has similarity with C. Therefore, I can understand the Arduino program little more easier.

I did a modification.

int nko =11;// LED connected to digital pin 11 which is yellow

int ten =13;// LED connected to digital pin 13 which is red



void setup() {
// initialize the digital pin as an output:
pinMode(nko, OUTPUT);
pinMode(ten, OUTPUT);
}



void loop()
{

digitalWrite(nko, HIGH); // set the LED on

delay(1000); // wait for a second

digitalWrite(nko, LOW); // set the LED off
delay(1000); // wait for a second


digitalWrite(ten, HIGH); // set the LED on
delay(6000);

digitalWrite(ten, LOW); // set the LED off
delay(1000);
}

Simple circuit


Any GNDs are fine for this circuit.

Test of a USB port and simple function

9V DC 100-500mA

I finally find a proper power supply adapter.

From many webpage the voltage should be among 6~12 no more than them.

From arduino web page 6~20v

The below example is from one of a tutorial webpage.(Arduino has many varieties and I am not 100% sure whether this is suit to my board ) 

9V DC 100-500mA 


P.S. it seems that as long as connecting the USB cable to a computer, USB cable can supply enough amount of electricity to the Arduino board.

Test of aduino main board

This is a test of main board with USB and 9V 400mA power adapter.


Equipment


Purchase(ed) material 


Arduino

    Arduino Starter Kit

    Arduino Lilypad Deluxe-Kit(waiting)

    X-bee wireless shield(waiting)

   Arduino Motor Shield(waiting)

   Arduino Ethernet Shield(waiting)

   Arduino Sensor Kit(waiting)

   Arduino 9V battery case(waiting)

Application

   Touch OSC iphone app(waiting)



Environment

Workstation computer based on Dell precision 490

   64bit Windows 7 /XP, Xeon 5355 x2, 8GB RAM, Quadro FX 5600, Approx. 1TB HDD. 

Laptop Dell studio 1555

        32bit Windows 7,  C2D p8600, 4GB RAM, Radeon 4570, 500GB HDD.


Applications

PuTTy

PureData

processing

Arduino Software

TroikaTronix Isadora

Adobe Production Premium CS4

Autodesk Entertainment Creation 2010 + V ray for Maya

Java JDK


Other Hardwares

USB web-cam

Wacom Intuos 4 tablet

Creative USB sound card

ViewSonic projector

Nikon xD40

JVC video camera


Beginning of the project (Week 1) 28, May,10

Discuss about the 8 week project.

Assignment research about arduino, precedent artists, institutes(about art and technology), none- profitable grant, background.

Start to draw idea sketches.

Got a main board of Arduino.

Cleaned up my studio space and setup computers in my  room for the research.

Next meeting schedule is June 9.