Entries from 2014-09-01 to 1 month

12.Force-Sensitive Resistor - Spark Core

Let’s read data sheet (PDF ). It says resistance changes 1K - 100K (roughly linear). I used 10K ohm resistor to measure as follows. In theory, if you touch the censor, resistor values decreases and the voltage increases. So simply read the…

11. Piezo Buzzer - Spark Core

Buzzer would be useful in some cases, so let’s learn how to use it. I started using Fritzing to draw how I connect things.And code is below // Turn on/off Piezo Buzzar // void setup() { Serial.begin(9600); pinMode(A0, OUTPUT); } void loop(…

10. Daddy is coming home app for iPhone - Spark Core

In Spark Core Maker kit, I have Servo motor. It’s easy to control using Servo class as follows. Servo servo; servo.attach(A0); // Attach servo to A0 int pos = servo.read(); // Get current position servo.write(pos + 10); // Move to new posi…

9. Temperature iPhone App - Spark Core

Now lest’s TMP36 to measure temperature. Hook up a analog temperature sensor (TMP36) as follows. You may want to read data sheet of TMP36. Implement API We are using Spark.variable() function to expose temperature as API. Spark.variable("t…

8. Send email when someone turns on light - Spark Core

Here is a user story. It’s 5pm and dark Someone comes home He/She turns light on You receive email notification pushingbox.com I searched some articles in the spark community. To use smtp server provided by gmail wouldn’t work, as it requi…

7. Emacs + Spark - Spark

https://www.spark.io/build is great IDE, but you may want to use your own tool, which is Emacs :) Open your .emacs and associate .ino file to cc-mode. (setq auto-mode-alist (append '(("\\.h$" . c++-mode) ("\\.cpp$" . c++-mode) ("\\.ino$" .…

6. Turn on LED when it's dark - Spark Core

Now I know how to use the photo resistor. Let’s create useful application, which would turn on LED when it’s dark :) I use exact same bread board setting in 5. Photo Resistor. The point here is we’re using isDark & isOn variables. int volt…

5. Photo Resistor - Spark Core

Read data sheet for Photo Resistor (http://docs.spark.io/assets/datasheets/makerkit/photoresistor.pdf). It says that resistance decreases with increasing light intensity. I understand it, but how can we use it? As first step, I think debug…

4. Control LED blink speed via Internet - Spark Core

Let's add more to 3. Bread Board & LED. I use exact same setting on the bread board. Just changed code.Here is code for accepting API request via Internet. As you can see, we register “blink” API endpoint which will call int blink(String) …

3. Bread Board & LED - Spark Core

Let’s connect a LED to the bread board and control it. You may want to read http://www.instructables.com/id/Breadboard-How-To/ to learn how to use bread board. As described in http://docs.spark.io/examples/, we need a resistor. Disconnect …

2. Debug print - Spark Core

To create more complex app, I think I need to have a way to debug print. Yes you can do it very easily using serial port. http://docs.spark.io/firmware/#communication-serial I’m connecting my Core to MacBook Air by USB cable, so you would …

1. Hello, World - Spark Core

Now I know how to turn on/off the RGB LED. Let’s change color of the LED. Found a document at http://docs.spark.io/firmware/#libraries-rgb. Okay, I need to call RGB.control(true) in setup() method and can change color by calling RGB.color(…

1. Spark Core 動作確認

http://docs.spark.io/start/ を読んで動作確認。 1. USB で Mac と接続 開封して USB ケーブルで Mac と接続。青く点滅すれば OK。 2. Spark Core アプリ iPhone に Spark Core アプリをインストールしてアカウントを作る。 SSID が表示されるので Spark Co…

アメリカ英語の数字の読み方

サンフランシスコに来てから1年半以上経ったがいまだに英語の数字になれない。例えばミーティングでユーザー数、QPS、インプレッション数などについて話すときにぱっと数字が口から出てこない。100 以下の数字は日本語の時と同じくらい自然に出てくるのだが…