What are the variable types supported by Spark?

I’ve looked everywhere but I can’t find a specific list of types specifically supported (int, char, etc) - can someone please point me to this documentation? Can anyone confirm if all types listed on http://arduino.cc/en/Reference/HomePage are supported by Spark?

Hi @jonathanzufi,

Oh good catch, looks like that should be in the docs more clearly. In the meantime you can use INT, BOOLEAN, STRING, and DOUBLE for variables :smile:

edit: added this to our docs bug list

Thanks,
David

1 Like

Thanks Mike for the speedy reply!

A quick followup - do you know where I might find an overlay/comparison document of Spark libraries against common Arduino libraries - many of the libraries at http://arduino.cc/en/Reference/Libraries seem to map 1:1 with the Spark libs but a core list would be great.

Also any plans to support LiquidCrystal?

Just to clarify, do you mean Spark.variable() or just variables in your program? If the former, then what Dave said… if the later there are quite a few more… float, uint8_t, uint16_t, uint32_t, int8_t, int16_t, int32_t, bool, byte, char, #define for constants, long… and some others I’m forgetting at the moment.

For LiquidCrystal support, see my post here:

2 Likes

Thanks @BDub - will test on the new 16x2 display I just ordered from Adafruit (http://www.adafruit.com/products/784)

1 Like

That LCD is a little different than what the LiquidCrystal library supports. LiquidCrystal is for writing to Hitachi chipset HD44780-compatible displays in 4-bit parallel mode.

The one you just ordered is meant to be used with a TTL Serial (UART) 3- wire connection (power, gnd and TX)

That’s ok, you just need to use the TX pin on the Spark Core, Vin for power, and GND to GND of the LCD. Then you can use the Serial1 built in library. http://docs.spark.io/#/firmware/communication-serial

Just replace all lcd. with Serial1. in their example and leave off the:

#include <SoftwareSerial.h>
SoftwareSerial lcd = SoftwareSerial(0,2);

Should work well!

1 Like

what about LONG? or are both int and long 32bit?

Got it working - as you said, very easy using just serial commands (the piggyback unit makes everything a lot easier).

1 Like