Author Topic: Digispark and bluetooth  (Read 7789 times)

MichaelMeissner

  • Full Member
  • ***
  • Posts: 166
Digispark and bluetooth
« on: January 14, 2013, 03:16:43 pm »
Next week, when I get some time, I was planning on getting started with the spark.  One of the things I would like to do is setup the spark to do things remotely.  To that end, I just purchased one of the HC-05 bluetooth transceivers (http://www.ebay.com/itm/221158958927?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649) to put on my microprocessors, and control it from my Galaxy S-II phone.

Now, as I read these forums, one of the things sticks out that I had missed previously, is that the sparks don't have the serial support like the Uno has.  I don't really care what the bit-level protocol for uploading code is, so it didn't matter that you use something different.  However, if I wanted to use the spark to communicate with something that expects a serial connection, there is no hardware serial support.  That means I would need to use something like software serial support.  Is this correct?  Or would I need to do something else (i2c device perhaps)?

I also have two RadioBlocks (http://www.kickstarter.com/projects/545073874/radioblock-simple-radio-for-arduino-or-any-embedde?ref=category) and that looks like by default you would want a serial device as well.

Finally to complete the remote capabilities, there is good old fashioned IR (and I have an IR shield in the several I bought), but another post indicates that the IRR library support right now does not work.  However, that looks like it may be fixed shortly.  Again, is my understanding correct?

Assuming the spark does not have hardware serial support, does it support software serial such that I could use serial devices like the bluetooth transceiver?
« Last Edit: January 14, 2013, 03:23:37 pm by MichaelMeissner »

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Digispark and bluetooth
« Reply #1 on: January 14, 2013, 04:39:48 pm »
The Digispark has something called \"USI\" - Universal Serial Interface. It is a more generic peripheral which can act as a UART, as well as doing SPI stuff and some other protocols. This means libraries which depend on the UART hardware found in many atmegas will not immediately work, but someone should be able to make a USI serial library for digispark. Aside from that, you might find SoftwareSerial is good enough for your needs?

MichaelMeissner

  • Full Member
  • ***
  • Posts: 166
Digispark and bluetooth
« Reply #2 on: January 14, 2013, 04:54:53 pm »
I suspect SoftwareSerial would be acceptable.  I suspect if there was a library that had a different name than Serial, but took the same arguments, it would be a lot simpler to move code back and forth among the different microprocessors.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Digispark and bluetooth
« Reply #3 on: January 14, 2013, 06:05:32 pm »
There would be no reason to name such a library any differently to Serial.

MichaelMeissner

  • Full Member
  • ***
  • Posts: 166
Digispark and bluetooth
« Reply #4 on: January 14, 2013, 08:25:19 pm »
Yes, I agree it should be Serial.  I just didn\'t know if it could be a drop in replacement for the Serial used on Arduinos.

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Digispark and bluetooth
« Reply #5 on: January 15, 2013, 12:10:45 am »
I don\'t see why not - someone just has to port it to use USI instead of UART hardware backend.