Author Topic: Arduino IDE direction  (Read 5256 times)

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Arduino IDE direction
« on: April 15, 2013, 07:41:33 pm »
It seems like a lot of trouble is caused by trying to maintain the Digispark Arduino IDE varient with both digispark and traditional arduino ide support. I propose giving up on that, and making the Digispark IDE only support digispark-compatibles, and redoing the libraries so they are API-compatible with the standard arduino ones.


There's no reason the digispark couldn't implement the standard arduino Keyboard and Mouse libraries, or for that matter implement USB Serial emulation as an alternative to DigiUSB. There's no technological reason why you shouldn't be able to use all of Keyboard, Mouse, and DigiUSB together - they're all HID devices and fairly easy to merge with some preprocessor ifdefs to keep code size under control by omiting the bits your project isn't opting in to. For that matter, Mangler could detect the presence of Keyboard.begin, Mouse.begin, and DigiUSB.begin, and use that to control what libraries are included and how, as well as controlling the hid descriptor at compile time (straight forward to do) I don't yet know if it would be straight forward to support USB Serial Port emulation at the same time as keyboard and mouse, but some arduino's seem to be able to do it so it might be possible for digispark as well.


Imagine if digispark just supported USB serial emulation out of the box? that'd make so many people happy, even if it's a bit of a dodgy hack (but lets be honest, just about everything here is)


What do you guys think? What do Digistump think? Should the Digispark software abandon Arduino as a target and focus in exclusively on supporting digispark-compatibles while staying as API compatible and library compatible with arduino as possible, getting rid of all this DigiKeyboard, DigiMouse gunk in favour of Keyboard, Mouse?


I'm investigating the possibility of calling usbPoll from the millis timer system - if that can be made to work, Mouse, Keyboard, DigiUSB, will be able to be made to not require special delay functions or calling refresh/update functions in your program.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Arduino IDE direction
« Reply #1 on: April 16, 2013, 06:07:00 pm »
It seems like a lot of trouble is caused by trying to maintain the Digispark Arduino IDE varient with both digispark and traditional arduino ide support. I propose giving up on that,


We are planning to move over to the 1.5 IDE soon (due to our next product needing it) - where it is much easier to support very different boards and not break or even tamper with the regular Arduino stuff. I imagine that would achieve the same goal?


and making the Digispark IDE only support digispark-compatibles, and redoing the libraries so they are API-compatible with the standard arduino ones.
This would be super awesome - of course, I'd be happy to help/contribute/etc if there was support to do this - but could not do it on my own.


There's no reason the digispark couldn't implement the standard arduino Keyboard and Mouse libraries, or for that matter implement USB Serial emulation as an alternative to DigiUSB. There's no technological reason why you shouldn't be able to use all of Keyboard, Mouse, and DigiUSB together - they're all HID devices and fairly easy to merge with some preprocessor ifdefs to keep code size under control by omiting the bits your project isn't opting in to. For that matter, Mangler could detect the presence of Keyboard.begin, Mouse.begin, and DigiUSB.begin, and use that to control what libraries are included and how, as well as controlling the hid descriptor at compile time (straight forward to do) I don't yet know if it would be straight forward to support USB Serial Port emulation at the same time as keyboard and mouse, but some arduino's seem to be able to do it so it might be possible for digispark as well.


Imagine if digispark just supported USB serial emulation out of the box? that'd make so many people happy, even if it's a bit of a dodgy hack (but lets be honest, just about everything here is)


What do you guys think? What do Digistump think?
It sounds like on heck of an undertaking, but we'd certainly do all we could to help and support it - it would be great! And I think with IDE 1.5 it might be possible to not cut away from supporting other boards - I believe its just a matter of putting things in the right directories and writing some board.txt files.





I'm investigating the possibility of calling usbPoll from the millis timer system - if that can be made to work, Mouse, Keyboard, DigiUSB, will be able to be made to not require special delay functions or calling refresh/update functions in your program.
I think this would save lots of troubleshooting!

Mark

  • Full Member
  • ***
  • Posts: 196
Re: Arduino IDE direction
« Reply #2 on: April 17, 2013, 04:13:20 am »
Quote
It seems like a lot of trouble is caused by trying to maintain the Digispark Arduino IDE varient with both digispark and traditional arduino ide support. I propose giving up on that, and making the Digispark IDE only support digispark-compatibles, and redoing the libraries so they are API-compatible with the standard arduino ones.

I think Bluebie makes a good point.
This would save some confusion to new users, while still allowing the normal Arduino sketches/libaries to be imported much like the existing IDE.

Not sure how this would sit with the Arduino team.

Personally I have 3 Arduino IDEs sitting in separate directories, so I use them each of them for task at hand, and copy in the necessary sketch to use the bits of code I want, as required.

Perhaps some of the other forum members can comment if they use the DS version to write and program other Arduino boards.


Mark

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: Arduino IDE direction
« Reply #3 on: April 18, 2013, 05:26:45 pm »
I doubt the arduino crew will want to include digispark support in their official IDE unless they come out with a very similar product. Maybe I'm wrong though? There are a few other similar projects - the LilyTiny and Adafruit's Gemma (little Flora) both come to mind. Adafruit's Gemma even has a decent chance of using some micronucleus variant - though adafruit haven't announced anything yet, so perhaps they'll make a bootloader of their own design. It would be awesome to see adafruit embrace open source and pool their efforts to create a really great micronucleus and attiny85 arduino platform with Digistump and it's fans. On the other hand, the might create an even better bootloader, which could benefit digispark's as well! A wearable digispark is a very cool idea ^_^


I have two arduino apps - Digispark and the regular arduino one - though I don't even have the regular arduino app on my laptop, which I do about half my stuff on, simply because I don't actually use arduino stuff anymore - digispark is just that good!