8.07.2010

Setting up Environment for Arduino and Testing of Blinking LED


I got an Arduino which is a single-board microcontroller and a software suite for programming it.
I will try to make some sensors/switches connected to the internet through the Arduino and control them from an android phone.

At first, I made a development environment for the Arduino. This was really simple way for my PC (Win7 64bit).

  1. Connect the Arduino to PC with USB cable.
    (In my environment its device driver was automatically installed)
  2. Download zip file of IDE from an official web site.
    http://arduino.cc/
  3. Unzip it.
  4. Run arduino.exe.
  5. Choose your Serial Port in menu [Tools -> Serial Port].
    (You can confirm its number in the Device Manager. In my case, it is "COM4.")

Then I test a simple sketch which blink LED. In Arduino community, code is called "sketch" and it is similar to C/C++. The sketch is below. Insert a LED into Digital 13 socket and upload the sketch . (I didn't use any register with the LED, but it's not good exactly)

// Blinking LED

#define LED 13 // Digital 13 for LED

void setup() {
  pinMode(LED, OUTPUT); // set the pin output
}

void loop() {
  digitalWrite(LED, HIGH); // LED on
  delay(1);
  digitalWrite(LED, LOW);  // LED off
  delay(1000);
}

I confirmed my Arduino works well, so next time I'll try to use some kind of sensor. :)

3.05.2010

The PlayStation's Problem Triggered by Confusing Binary-Coded Decimal with Binary?

1 March 2010, a system failure occurred in PlayStation Network and PlayStation 3. The problem was solved now, but Sony Computer Entertainment (SCE) haven't announced about a cause of  the problem yet. A post which I wrote about this problem is below.
http://hikaruhorie.blogspot.com/2010/03/system-failure-of-playstation-network.html



Today, I found a post written about the problem by Yaju. (in Japanese)
http://blogs.wankuma.com/yaju/archive/2010/03/04.aspx

The author said that the problem might be due to confusing Binary-coded decimal (BCD) with binary. In BCD, every four digits are corresponding to each decimal digit. And many real time clock (RTC) count only last two digits of years in BCD. Then last two digits of 2010 is expressed 00010000. However, if a program took 00010000 as binary, it would be 16 and the program takes the year as 2016. Then it is a leap year. The author said that this PlayStation's problem might result of this RTC's bug.

I agree with his opinion and I want SCE to announce soon.


A correspondence table of decimal, BCD, binary and hexadecimal is below.

    decimal    BCD      binary    hexadecimal
       0    0000 0000  0000 0000     0x00
       1    0000 0001  0000 0001     0x01
       2    0000 0010  0000 0010     0x02
       3    0000 0011  0000 0011     0x03
       4    0000 0100  0000 0100     0x04
       5    0000 0101  0000 0101     0x05
       6    0000 0110  0000 0110     0x06
       7    0000 0111  0000 0111     0x07
       8    0000 1000  0000 1000     0x08
       9    0000 1001  0000 1001     0x09
      10    0001 0000  0000 1010     0x0A
      11    0001 0001  0000 1011     0x0B
      12    0001 0010  0000 1100     0x0C
      13    0001 0011  0000 1101     0x0D
      14    0001 0100  0000 1110     0x0E
      15    0001 0101  0000 1111     0x0F
      16    0001 0110  0001 0000     0x10

 Photo: http://www.vend123.com/

3.03.2010

System Failure of PlayStation Network Due to a-Leap-Year-Judging?

PlayStation Network (PSN) is marred by its system failure on 1 March 2010. During this problem occurred, users of PlayStation 3 (PS3) gaming console couldn't sign up PSN and some users said that their data was broken. A newer PS3 which was called "slim model" is safe.

Sony Computer Entertainment (SCE) said that this problem occurred due to a bug of an internal clock of PS3 and it confused 2010 with a leap year. They also said that this system failure was solved already because "29 February 2010" was ended. However, they haven't announced yet about a reason of the bug and a treatment of users whose data was crashed.

I think that this bug involves something about authentication because users' broken data was bound for PSN account and a-leap-year-judging algorithm is too simple to make a mistake in ordinary circumstances. So, I wanna know why they generated this kind of bug.


SCE's announcement (in Japanese)
http://www.jp.playstation.com/info/support/sp_20100302_ps3.html

3.02.2010

Getting Nexus One in Japan

Early this year, Google released a new android phone "Nexus One" by HTC; however, Google sales it in few countries. Japan isn't included them!! :(

Google's phone shop rejects accesses from Japan. They says "Sorry, the Nexus One is not available in your country." But I really want it., so I used Hotspot Shield and Spear Net to get Nexus One.

In Japan, there is no service provider which officially supports "SIM Free Phones" with flat-rate/low pricing. I think that is stupid. Docomo is gonna release Xperia X10 in April, so I expect they start a reasonable pricing for Xperia. I strongly hope that they also support SIM Free Phones. Until that, I use Nexus One with only WiFi.


Hotspot Shield: a free VPN service
http://hotspotshield.com/

Spear Net: a forwarding service
http://www.spearnet-us.com/

2.25.2010

Gadget1: An Event of Handheld Devices and Social Applications

I attended "Gadget1" which is an event of handheld devices and social applications. Gadget1 was held at the Oracle Aoyama center in Tokyo.
Gadget1's website: http://gadget1.jus.or.jp/

There were many geeks attendees and hot presenters. I report this event little.

Feel Sketch
An AR application using a PC, a printer and a handheld device which has a camera. Draw a picture on the PC with a drawing application, then convert it into PM code* and print it on a paper. When you take the printed code with your camera, the picture you wrote is superimposed on the camera's image in real time. The author said that this application could be used in stores as digital signage.
* PM code is similar to QR code, but PM code is colorful (color is 3rd dimension).

EatNow
A social application sharing information about what people eat. This application works on Facebook and Twitter now. Take a picture of foods you eat and upload with its information (e.g. place, price and description) using iPhones, androids or web browsers. Users can see what they ate each other.

Comparison of Nexus One with HTC Magic (HT-03A)
Nexus One has about twice high frequency CPU than Magic and almost same capacity battery with Magic, but Nexus One has a Magic-like stamina. So the presenter said that Nexus One may have great power-saving mechanisms.
And he demonstrate sprite tests on them. Using "Canvas", Nexus One is about twice faster than Magic. Using "OpenGL", however, Nexus One is only about 1.5 times faster than Magic. It is because, "Canvas" reflects only CPU's difference, but "OpenGL" does not. I think that Nexus One's CPU spec is much greater than its other specs.

Carevo Cam
Cerevo Cam is a web-friendly digital steal camera. When you take pictures using this camera, it automatically uploads them to web albums, blogs or SNS through wireless LAN or 3G network (e-mobile only now).
One of my hobby is photograph, so I wanna take pictures with my favorite camera. Then, Cerevo Cam doesn't make an appeal for me.
Cerevo's website: http://cerevo.com/


2.03.2010

Hello World

Hello Blogger.

This is my first post to this blog. I'm master's student of computer science and studying distributed systems now. I'm gonna write on this blog about computers, IT or what happened around me.

I'm not good at English, but I wanna make it better through writing this blog in English.

thx

hikaru