PUNTHOOFT
ArduinoVoice
De little buddy talker, is een project van Kickstarter voor de ontwikkeling van een klein kaartje met daarop een voorgeprogrammeerde geluidchip. Via een koptelefoon kun je de teksten afluisteren, of deze aansluiten op een versterker natuurlijk.
Als je de plaat voor je hebt liggen, dan zie je een grote hoeveelheid connectoren. Leg het printje op zijn pootjes met de koptelefoonconnector rechts.
- Aan de onderkant/voorkant
- 5V - 5Volt
- GD - Ground
- NA - Not applicable
- Aan de bovenkant/ver van je
- 5V - 5Volt
- GD - Ground
- DI - Data in
- SC - System clock
- CS - Chip select
- NA - Not applicable
- En aan de linkerkant op de kopse kant
- 5V - 5Volt
- GD - Ground
- DI - Data in
- SC - System clock
- CS - Chip select
Als je deze aansluitingen gaat bekijken zie je, dat er veel dubbel bij zit. Uiteindelijk zijn er maar 5 connectors waarmee je alles kunt doen.
ArduinoBreadboard
Aansluiten is zo eenvoudig dat ik hier geen tekening van heb gemaakt.
- Ground vanuit de Arduino kan op een van de GND aansluitingen
- Power 5V van de Arduino kan op een van de 5V aansluitingen
- Arduino pin 13 aansluiten op de SC (System clock)
- Arduino pin 11 aansluiten op de DI (Digital in)
- Arduino aansluiten op CS (Chip select)
ArduinoSource code
/* Little buddy talker (C) copyright www.punthooft.nl 2019-2023 */ #include <SPI.h> // include the SPI communcation library // Variables int cs=10; // Chip-select pin for SPI int del=200; // Short 200ms delay int value1 = 0x98; // Play command - This value never changes int value2 = 0; // Voice address - when you place a hex value in this integer and // Call the "readout()" function, that specific word will play int value3 = 0xA8; // COUT ramp up - This value never changes int value4 = 0xB8; // COUT ramp down - This value never changes // Setup function runs once when powerup the board and on reset void setup() { SPI.begin(); // Initialize SPI SPI.setClockDivider(SPI_CLOCK_DIV32); // Low frequency SPI pinMode(cs,OUTPUT); // Chip select pins is an output digitalWrite(cs,HIGH); // Set chip select to be HIGH (5v) by default. // The chip on the shield is selected when // this line is brought low. SPI.setBitOrder(MSBFIRST); // OTP requires MSB first SPI.setDataMode(SPI_MODE0); // Use MODE0, as all other modes to not work value2 = 0x00; // Start at voice group 0 delay(1000); // One second delay digitalWrite(cs,LOW); SPI.transfer(value3); SPI.transfer(0x00); digitalWrite(cs,HIGH); } // The loop function runs over and over again forever void loop() { readout(); // SPI command transfer function. Whenever you // call this function, it calls a word to be played. // The value in the "value2" integer is the word that is played. delay(100); value2 = value2 + 1; } // Calls a word to be played void readout() { delay(7); // Transmit Data digitalWrite(cs,LOW); // Select the Little Buddy Talker SPI.transfer(value1); // Send fixed value1 integer to LBT SPI.transfer(value2); // Send word address and play digitalWrite(cs,HIGH); // Unselect LBT delay(700); // As soon as the word starts to play, this delay starts. You need to give the word enough time to play. Once the delay is done, }

Copyright 2023 www.punthooft.nl
We do not collect cookies for advertisement. Your data is never send to third parties.