Komm nicht dahinter warum es nicht geht. Gibt es ne möglichkeit zu überprüfen ob der TTS256 überhaupt daten bekommt?
Hab mal ein Beispielprogramm gefunden ist aber für arduino.
Code:
TTS256 Speakjet Interface Chip Demo Sketch
Written by Ryan Owens
SparkFun Electronics
Uses the Voice Box Shield and the TTS256 Text To Speech Processor to turn text input on an Arduino to a voice output.
A speaker can be plugged directly into the SPK+ and - pins on the shield. See the tutorial for more information on how to connect the TTS256 to the Voice Box Shield.
SparkFun Product Links:
TTS256:
Arduino Duemilanove:
Voicebox Shield:
Speaker:
*/
//Soft serial library used to send serial commands on pin 2 instead of regular serial pin.
#include <SoftwareSerial.h>
//Define the Pin Numbers for the sketch.
#define E0 5
#define E1 6
#define E2 7
#define E3 8
#define E4 9
#define E5 10
#define E6 11
#define E7 12
#define RDY 13
#define RES 3
#define SPK 4
#define txPin 2
//Create a SoftSerial Objet
#include "WProgram.h"
void setup();
void loop();
void getMessage(char * message);
SoftwareSerial speakjet = SoftwareSerial(0, txPin);
//Create a message buffer to hold the ascii message to be converted to sound
char message[128]="";
void setup()
{
//Configure the pins for the SpeakJet module
pinMode(txPin, OUTPUT);
pinMode(SPK, INPUT);
//Set up a serial port to talk from Arduino to the SpeakJet module on pin 3.
speakjet.begin(9600);
//Set up a serial port to get the ascii message from the host
Serial.begin(9600);
//Configure the Ready pin as an input
pinMode(RDY, INPUT);
//Configure Reset line as an output
pinMode(RES, OUTPUT);
//Configure all of the Event pins as outputs from Arduino, and set them Low.
for(int i=E0; i<=E7; i++)
{
pinMode(i, OUTPUT);
digitalWrite(i, LOW);
}
//All I/O pins are configured. Reset the SpeakJet module
digitalWrite(RES, LOW);
delay(100);
digitalWrite(RES, HIGH);
}
void loop()
{
//Get a message from the serial port
getMessage(message);
//Send the message to the TTS256
speakjet.println(message);
Serial.println(message);
//Wait 12ms before checking the ready line
delay(12);
//Wait for the Speakjet to become 'ready' before sending more text.
while(digitalRead(RDY)==0);
}
void getMessage(char * message)
{
char in_char=0;
while(Serial.available() <=0);
in_char=Serial.read();
while(in_char != 0x0D){
*message++=in_char;
while(Serial.available() <=0);
in_char = Serial.read();
}
*message++='\r';
*message='\0';
return;
}
int main(void)
{
init();
setup();
for (;;)
loop();
return 0;
}
Werd aber nicht schlau drauß.
Lesezeichen