spark core
As I did in 9. Temperature iPhone App, we can measure temperature using TMP36. I thought it would be great if we could log temperature and draw graph automatically. Let’s use google spreadsheet :)I used Ruby library to control google sprea…
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…
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(…
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…
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…
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…
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$" .…
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…
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…
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) …
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 …
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 …
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(…
http://docs.spark.io/start/ を読んで動作確認。 1. USB で Mac と接続 開封して USB ケーブルで Mac と接続。青く点滅すれば OK。 2. Spark Core アプリ iPhone に Spark Core アプリをインストールしてアカウントを作る。 SSID が表示されるので Spark Co…