Hello have the Adafruit Feather 32u4 Bluefruit LE keep getting an error
BLEdogCollar:16:10: fatal error: Adafruit_BluefruitLE_SPI.h: No such file or directory
#include <Adafruit_BluefruitLE_SPI.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Adafruit_BluefruitLE_SPI.h: No such file or directory
Is there an updated code to use thank you
Phone-Activated Talking Dog Collar
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- MOCKLE
- Posts: 12
- Joined: Sun May 16, 2021 10:37 am
Phone-Activated Talking Dog Collar
- Attachments
-
- ADA Error.jpg (104.31 KiB) Viewed 286 times
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Phone-Activated Talking Dog Collar
Have you read through the Feather 32u4 BLE tutorial? https://learn.adafruit.com/adafruit-fea ... uefruit-le
Dave
Dave
- MOCKLE
- Posts: 12
- Joined: Sun May 16, 2021 10:37 am
Re: Phone-Activated Talking Dog Collar
Code: Select all
// Smartphone-activated audio gizmo (e.g. talking dog collar).
// Uses the following Adafruit parts:
//
// - Bluefruit LE Micro (adafruit.com/product/2661)
// - 500 mAh LiPoly battery (1578)
// - LiPoly backpack (2124)
// - Audio FX Mini sound board (2342 or 2341)
// - 2.5W class D mono amp (2130)
// - Speaker (TBD)
//
// Needs Adafruit_BluefruitLE_nRF51 and Adafruit_Soundboard libs:
// github.com/adafruit
#include <SPI.h>
#include <SoftwareSerial.h>
#include <Adafruit_BluefruitLE_SPI.h>
#include <Adafruit_Soundboard.h>
#define LED A0 // LED on while "talking"
#define AUDIO_ACT 5 // "Act" on Audio FX
#define AUDIO_RESET 6 // "Rst" on Audio FX
Adafruit_Soundboard sfx(&Serial1, NULL, AUDIO_RESET);
Adafruit_BluefruitLE_SPI ble(8, 7, 4); // CS, IRQ, RST pins
char filename[12] = " OGG"; // Tail end of filename NEVER changes
// PROGMEM string arrays are wretched, and sfx.playTrack() expects a
// goofy fixed-length space-padded filename...we take care of both by
// declaring all the filenames inside one big contiguous PROGMEM string
// (notice there are no commas here, it's all concatenated), and copying
// an 8-byte section as needed into filename[]. Some waste, but we're
// not hurting for space. If you change or add any filenames, they MUST
// be padded with spaces to 8 characters, else there will be...trouble.
static const char PROGMEM bigStringTable[] = // play() index
"1 " "2 " "3 " "4 " // 0-3
"5 " "6 " "7 " "8 " // 4-7
"BOOT "; // 8-
void fail(uint16_t ms) { // If startup error, LED flash indicates status
for(uint8_t x=0;;) {
digitalWrite(LED, ++x & 1);
delay(ms);
}
}
void setup(void) {
pinMode(LED, OUTPUT);
digitalWrite(LED, HIGH); // LED steady on during init
Serial1.begin(9600); // Audio FX serial link
if(!sfx.reset()) fail(250); // Audio FX init error? Slow blink
if(!ble.begin(false)) fail(100); // BLE init error? Fast blink
ble.echo(false);
digitalWrite(LED, LOW); // LED off = successful init
play(8); // Play startup sound
}
void loop(void) {
if(ble.isConnected()) {
ble.println(F("AT+BLEUARTRX")); // Request string from BLE module
ble.readline(); // Read outcome
if(!strncmp(ble.buffer, "!B", 2) && // Controller button command
checkCRC(255-'!'-'B', 4) && // Verify checksum
(ble.buffer[3] == '1')) { // Button press? 1=press 0=release
play(ble.buffer[2] - '1');
}
ble.waitForOK();
}
}
boolean checkCRC(uint8_t sum, uint8_t CRCindex) {
for(uint8_t i=2; i<CRCindex; i++) sum -= (uint8_t)ble.buffer[i];
return ((uint8_t)ble.buffer[CRCindex] == sum);
}
void play(uint16_t i) {
digitalWrite(LED, HIGH);
memcpy_P(filename, &bigStringTable[i * 8], 8); // PROGMEM -> RAM
sfx.playTrack(filename);
delay(250); // Need this -- some delay before ACT LED is valid
while(digitalRead(AUDIO_ACT) == LOW); // Wait for sound to finish
digitalWrite(LED, LOW);
}
Last edited by Franklin97355 on Sun Oct 31, 2021 1:39 pm, edited 1 time in total.
Reason: Added code tags
Reason: Added code tags
- MOCKLE
- Posts: 12
- Joined: Sun May 16, 2021 10:37 am
Re: Phone-Activated Talking Dog Collar
this code does not work..
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Phone-Activated Talking Dog Collar
Did you install those libraries?Needs Adafruit_BluefruitLE_nRF51 and Adafruit_Soundboard libs
Dave
- MOCKLE
- Posts: 12
- Joined: Sun May 16, 2021 10:37 am
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Phone-Activated Talking Dog Collar
It looks like you have the board set to Arduino UNO. The Tools->Board setting should match the hardware you are using, "Adafruit Feather 32u4" in this case.
Dave
Dave
- MOCKLE
- Posts: 12
- Joined: Sun May 16, 2021 10:37 am
Re: Phone-Activated Talking Dog Collar
that is correct I followed the instruction and nothingdastels wrote:It looks like you have the board set to Arduino UNO. The Tools->Board setting should match the hardware you are using, "Adafruit Feather 32u4" in this case.
Dave
- Attachments
-
- dont know.jpg (335.77 KiB) Viewed 247 times
- MOCKLE
- Posts: 12
- Joined: Sun May 16, 2021 10:37 am
Re: Phone-Activated Talking Dog Collar
now when i plug it in this pops up
- Attachments
-
- dont know20.jpg (16.58 KiB) Viewed 247 times
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Phone-Activated Talking Dog Collar
Go to the "Tools->Board->Adafruit Boards" menu and select "Adafruit Feather 32u4". If you don't see it there install "Adafruit AVR Boards".
See https://learn.adafruit.com/adafruit-fea ... t-le/setup for more details.
Dave
See https://learn.adafruit.com/adafruit-fea ... t-le/setup for more details.
Dave
- MOCKLE
- Posts: 12
- Joined: Sun May 16, 2021 10:37 am
Re: Phone-Activated Talking Dog Collar
ok got that far and will not connect
- Attachments
-
- adas.jpg (632.23 KiB) Viewed 230 times
-
- dont know20.jpg (16.58 KiB) Viewed 230 times
- MOCKLE
- Posts: 12
- Joined: Sun May 16, 2021 10:37 am
- MOCKLE
- Posts: 12
- Joined: Sun May 16, 2021 10:37 am
Re: Phone-Activated Talking Dog Collar
board does not work????
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Phone-Activated Talking Dog Collar
This seems to be getting Windows specific where I am of no use. All I can suggest is try changing the cable to a different USB port. I find that can help on Linux.
Dave
Dave
- adafruit_support_carter
- Posts: 29168
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Phone-Activated Talking Dog Collar
How is the board showing up in Windows Device Manager once connected?
Please be positive and constructive with your questions and comments.