Bluefruit LE Firmata for Arduino Micro

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
karlq
 
Posts: 3
Joined: Fri Aug 08, 2014 8:57 pm

Bluefruit LE Firmata for Arduino Micro

Post by karlq »

Hi,

I'm trying to modify the Bluefruit LE Firmata code for the nrf8001 breakout to use it with an Arduino Micro. I've updated the board.h file to include the pin configurations for the Micro and the sketch can compile ok, but pins are unresponsive to the IPhone app. Is there a version of the sketch compatible with the Micro/Leonardo? Barring that, is there any document that track what changes were made from the standard Firmata files to modify them for the nrf8001 and specifically the Arduino Uno?

Thanks,
Karl

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Bluefruit LE Firmata for Arduino Micro

Post by adafruit_support_rick »

No modifications should be necessary for the Micro. Follow the wiring instruction for the Leonardo in the tutorial.
https://learn.adafruit.com/getting-star ... rything-up

User avatar
karlq
 
Posts: 3
Joined: Fri Aug 08, 2014 8:57 pm

Re: Bluefruit LE Firmata for Arduino Micro

Post by karlq »

The instructions only work for the UART portion of the tutorial, but I would like to use the ported version of Firmata to control individual pins on the Arduino (https://learn.adafruit.com/getting-star ... it-firmata). However, the adafruit_blefirmata code only works for the Uno currently (https://github.com/adafruit/Adafruit_BLEFirmata). I have edited the hardware abstraction layer (board.h file), but it is still not working. Any tips?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Bluefruit LE Firmata for Arduino Micro

Post by adafruit_support_rick »

No tips, really. The board abstraction for the Leonardo/Micro should be pretty similar to the Uno.

User avatar
karlq
 
Posts: 3
Joined: Fri Aug 08, 2014 8:57 pm

Re: Bluefruit LE Firmata for Arduino Micro

Post by karlq »

I basically added the code below to the board.h file. I took into account that pins 2, 9, 10, as well as the ICSP pins (pins 14-17) were used for communicating with the BT LE. Then I run the StandardFirmata sketch as provided.

Code: Select all

#elif defined(__AVR_ATmega32U4__)
#define TOTAL_ANALOG_PINS       12
#define TOTAL_PINS              30 // 14 digital + 12 analog + 4 SPI (D14-D17 on ISP header)
#define VERSION_BLINK_PIN       13
// we don't use pin 2, 9, 10 or the SPI
#define IS_PIN_DIGITAL(p)       (((p) >= 3 && (p) <= 8) || ((p) >= 11 && (p) <= 13) || ((p) >= 18 && (p) < TOTAL_PINS))

#define IS_PIN_ANALOG(p)        ((p) >= 18 && (p) < TOTAL_PINS)
#define IS_PIN_PWM(p)           ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 11 || (p) == 13)
#define IS_PIN_SERVO(p)         ((p) >= 0 && (p) < MAX_SERVOS)
#define IS_PIN_I2C(p)           ((p) == 2 || (p) == 3)
//#define IS_PIN_SPI(p)           ((p) == SS || (p) == MOSI || (p) == MISO || (p) == SCK)
#define PIN_TO_DIGITAL(p)       (p)
#define PIN_TO_ANALOG(p)        (p) - 18
#define PIN_TO_PWM(p)           PIN_TO_DIGITAL(p)
#define PIN_TO_SERVO(p)         (p)  

However, when I try to use the IPhone app, I see this on the serial monitor where the program hangs and I get disconnected from the nrf8001:

Code: Select all

* Connected!
Init firmata
Begin firmata
	Writing one byte 0xF9
	Writing one byte 0x2
	Writing one byte 0x3
***RESET***
Set pin #3 to input
Set pin #4 to input
Set pin #5 to input
Set pin #6 to input
Set pin #7 to input
Set pin #8 to input
Set pin #11 to input
Set pin #12 to input
Set pin #13 to input
Will report analog pin #0
Set pin #18 to analog
Will report analog pin #1
Set pin #19 to analog
Will report analog pin #2
Set pin #20 to analog
Will report analog pin #3
Set pin #21 to analog
Will report analog pin #4
Set pin #22 to analog
Will report analog pin #5
Set pin #23 to analog
Will report analog pin #6
Set pin #24 to analog
Will report analog pin #7
Set pin #25 to analog
Will report analog pin #8
Set pin #26 to analog
Will report analog pin #9
Set pin #27 to analog
Will report analog pin #10
Set pin #28 to analog
Will report analog pin #11
Set pin #29 to analog
	Received 0xF4 0x5 0x0
Se
I'm not sure what the problem is right now. Is there any file other than the board.h file I need to edit to make the adafruit_bleFirmata compatible with my Arduino Micro?

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: Bluefruit LE Firmata for Arduino Micro

Post by adafruit2 »

It may not be possible to make it compatible - we used the original Firmata implementation which is very much Uno-specific

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Bluefruit LE Firmata for Arduino Micro

Post by adafruit_support_rick »

Code: Select all

// Leonardo
#elif defined(__AVR_ATmega32U4__)
#define TOTAL_ANALOG_PINS       12
#define TOTAL_PINS              30 // 14 digital + 12 analog + 4 SPI (D14-D17 on ISP header)
#define VERSION_BLINK_PIN       13
#define IS_PIN_DIGITAL(p)       ((p) >= 0 && (p) < TOTAL_PINS)
#define IS_PIN_ANALOG(p)        ((p) >= 18 && (p) < TOTAL_PINS)
#define IS_PIN_PWM(p)           ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11 || (p) == 13)
#define IS_PIN_SERVO(p)         ((p) >= 0 && (p) < MAX_SERVOS)
#define IS_PIN_I2C(p)           ((p) == 2 || (p) == 3)
#define IS_PIN_SPI(p)           ((p) == SS || (p) == MOSI || (p) == MISO || (p) == SCK)
#define PIN_TO_DIGITAL(p)       (p)
#define PIN_TO_ANALOG(p)        (p) - 18
#define PIN_TO_PWM(p)           PIN_TO_DIGITAL(p)
#define PIN_TO_SERVO(p)         (p)  

User avatar
dzfan
 
Posts: 18
Joined: Fri Jan 06, 2012 3:12 pm

Re: Bluefruit LE Firmata for Arduino Micro

Post by dzfan »

I see that Firmata has been updated to be compatible with Leonardo in version 2.3.2. Will the Adafruit BLE Firmata library be updated to reflect any of the changes? I tried updating my boards.h file and I still have the same trouble as the O.P.

User avatar
adafruit2
 
Posts: 22144
Joined: Fri Mar 11, 2005 7:36 pm

Re: Bluefruit LE Firmata for Arduino Micro

Post by adafruit2 »

can you add an issue on the github repo? its not on our todo list but we'll take a look at it... :)
please note there's no ETA at this time!

User avatar
dzfan
 
Posts: 18
Joined: Fri Jan 06, 2012 3:12 pm

Re: Bluefruit LE Firmata for Arduino Micro

Post by dzfan »


User avatar
dzfan
 
Posts: 18
Joined: Fri Jan 06, 2012 3:12 pm

Re: Bluefruit LE Firmata for Arduino Micro

Post by dzfan »

Any word on BLE firmata compatibility with with Arduino Micro (ATmega32u4)? I'd love to add this to my project.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Bluefruit LE Firmata for Arduino Micro

Post by adafruit_support_rick »

No ETA, sorry.

User avatar
eduvon0220
 
Posts: 2
Joined: Wed Nov 26, 2014 9:12 am

Re: Bluefruit LE Firmata for Arduino Micro

Post by eduvon0220 »

Is there any compatibility of BLE Firmata with Arduino Due at this time? If not, as far as bluetooth communication from an iOS app to an Arduino Due, what do you recommend I use?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Bluefruit LE Firmata for Arduino Micro

Post by adafruit_support_rick »

Unfortunately, neither BLE Firmata nor nRF8001 are compatible with the Due. We don't have a bluetooth solution for Due and iOS.

User avatar
angel777
 
Posts: 16
Joined: Tue Jan 20, 2015 7:43 am

Re: Bluefruit LE Firmata for Arduino Micro

Post by angel777 »

Is not possible to make nRF8001 compatible with arduino DUE or are you planning to make library for it?

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”