Why doesn't a few simple changes work?

Hi,

I am not a c programmer and barely know how to UpLoad to the Arduino UNO. I want to change what the program says:

The original program:

#include "votraxsc01.h"

//Votrax Data Pins - For Ver-2: NOTE: Ver 1 is different!
const int SC01_P0 = 4; // 6-Bit Data LSB.
const int SC01_P1 = 3; // 6-Bit Data.
const int SC01_P2 = 2; // 6-Bit Data.
const int SC01_P3 = 11; // 6-Bit Data.
const int SC01_P4 = 10; // 6-Bit Data.
const int SC01_P5 = 5; // 6-Bit Data MSB.
const int SC01_I1 = 8; // 2-Bit Inflection LSB.
const int SC01_I2 = 9; // 2-Bit Inflection MSB.
const int SC01_Str = 7; // Data Strobe (Active=HIGH).
const int SC01_Ack = 6; // Ácknowledge/Request (Active=LOW).
const int ClockPower = 12; // Votrax Clock Power.

#define SC01_EH1 0x02
#define SC01_PA0 0x03
#define SC01_I3 0x09
#define SC01_N 0x0D
#define SC01_NG 0x14
#define SC01_AH1 0x15
#define SC01_L 0x18
#define SC01_K 0x19
#define SC01_H 0x1B
#define SC01_G 0x1C
#define SC01_D 0x1E
#define SC01_S 0x1F
#define SC01_AY 0x21
#define SC01_UH3 0x23
#define SC01_T 0x2A
#define SC01_R 0x2B
#define SC01_EE 0x2C
#define SC01_UH1 0x32
#define SC01_U 0x33
#define SC01_O1 0x35
#define SC01_U1 0x37

void Diag(){
ShutUp();
delay(500);
SayDiag();
ShutUp();
delay(500);
for(int p=0; p<64; p++){
for(int i=0; i<4; i++) {
Inflection(i);
Say(p);
Say(SC01_PA0);
}
}
}

void Say(int x){
Phoneme(x);
Strobe();
delay(20);
WaitForAck0();
}

void Say(int p, int d)
{
Phoneme(p);
Strobe();
delay(d);
}

void ShutUp(){
Say(63);
}

void Ahhhh(){
Say(47);
}

void Phoneme(int x){
digitalWrite(SC01_P0, bitRead(x,0));
digitalWrite(SC01_P1, bitRead(x,1));
digitalWrite(SC01_P2, bitRead(x,2));
digitalWrite(SC01_P3, bitRead(x,3));
digitalWrite(SC01_P4, bitRead(x,4));
digitalWrite(SC01_P5, bitRead(x,5));
}

void Inflection(int x){
digitalWrite(SC01_I1, bitRead(x,0));
digitalWrite(SC01_I2, bitRead(x,1));
}

void Strobe(){
digitalWrite(SC01_Str,HIGH);
delay(1);
digitalWrite(SC01_Str,LOW);
}

void WaitForAck0(){
W0:
if (digitalRead(SC01_Ack)==0){
goto W0;
}
}

void WaitForAck1(){
W1:
if (digitalRead(SC01_Ack)==1){
goto W1;
}
}

void TestIO(){
digitalWrite(SC01_Str,LOW);
delay(20);
digitalWrite(SC01_Str,HIGH);
delay(20);
}

void SC01_Setup(){
// Set the Arduino's I/O lines
pinMode(ClockPower, OUTPUT); digitalWrite(ClockPower,LOW); // Put Chip in Non-Clock mode while setting I/O.
pinMode(SC01_Ack, INPUT); pinMode(SC01_Ack, INPUT_PULLUP); // Ácknowledge/Request.
pinMode(SC01_P0, OUTPUT); digitalWrite(SC01_P0,LOW); // Data 0.
pinMode(SC01_P1, OUTPUT); digitalWrite(SC01_P1,LOW); // Data 1.
pinMode(SC01_P2, OUTPUT); digitalWrite(SC01_P2,LOW); // Data 2.
pinMode(SC01_P3, OUTPUT); digitalWrite(SC01_P3,LOW); // Data 3.
pinMode(SC01_P4, OUTPUT); digitalWrite(SC01_P4,LOW); // Data 4.
pinMode(SC01_P5, OUTPUT); digitalWrite(SC01_P5,LOW); // Data 5.
pinMode(SC01_I1, OUTPUT); digitalWrite(SC01_I1,HIGH); // Inflection 0.
pinMode(SC01_I2, OUTPUT); digitalWrite(SC01_I2,HIGH); // Inflection 1.
pinMode(SC01_Str, OUTPUT); digitalWrite(SC01_Str,LOW); // Strobe.
digitalWrite(ClockPower,HIGH); // Put Chip in Clocked mode.
}

void SayDiag() {
Say(SC01_R);
Say(SC01_UH1);
Say(SC01_UH3);
Say(SC01_N);
Say(SC01_EE);
Say(SC01_N);
Say(SC01_NG);
Say(SC01_PA0);
Say(SC01_D);
Say(SC01_AH1);
Say(SC01_AY);
Say(SC01_I3);
Say(SC01_G);
Say(SC01_N);
Say(SC01_AH1);
Say(SC01_UH3);
Say(SC01_S);
Say(SC01_T);
Say(SC01_I3);
Say(SC01_K);
Say(SC01_PA0);
}

void SayHello() {
Say(SC01_H);
Say(SC01_EH1);
Say(SC01_UH3);
Say(SC01_L);
Say(SC01_UH3);
Say(SC01_O1);
Say(SC01_U1);

}

I want to remove:
void SayDiag() {
Say(SC01_R);
Say(SC01_UH1);
Say(SC01_UH3);
Say(SC01_N);
Say(SC01_EE);
Say(SC01_N);
Say(SC01_NG);
Say(SC01_PA0);
Say(SC01_D);
Say(SC01_AH1);
Say(SC01_AY);
Say(SC01_I3);
Say(SC01_G);
Say(SC01_N);
Say(SC01_AH1);
Say(SC01_UH3);
Say(SC01_S);
Say(SC01_T);
Say(SC01_I3);
Say(SC01_K);
Say(SC01_PA0);
}

and add this:

void SayI() {
Say(SC01_AY);

}

void SayAM() {
Say(SC01_EH);
Say(SC01_M);

}

void SayAN() {
Say(SC01_AE);
Say(SC01_N);

}

void SayALTAIR() {
Say(SC01_AH);
Say(SC01_L);
Say(SC01_T);
Say(SC01_EH);
Say(SC01_R);

}

void SayCOMPUTER() {
Say(SC01_K);
Say(SC01_AH);
Say(SC01_M);
Say(SC01_P);
Say(SC01_Y);
Say(SC01_UW);
Say(SC01_T);
Say(SC01_ER);

}

void SayI() {
Say(SC01_AY);

}

void SayHAVE() {
Say(SC01_H);
Say(SC01_AE);
Say(SC01_V);

}

void SayAN() {
Say(SC01_AE);
Say(SC01_N);

}

void Say2() {
Say(SC01_T);
Say(SC01_UW);

}

void SayMEGAHERTZ() {
Say(SC01_M);
Say(SC01_EH);
Say(SC01_G);
Say(SC01_AH);
Say(SC01_H);
Say(SC01_ER);
Say(SC01_T);
Say(SC01_S);

}

void Say8080() {
Say(SC01_EY);
Say(SC01_T);

}

}
void Say8080() {
Say(SC01_EY);
Say(SC01_T);

}

void SayCOMPUTER() {
Say(SC01_K);
Say(SC01_AH);
Say(SC01_M);
Say(SC01_P);
Say(SC01_Y);
Say(SC01_UW);
Say(SC01_T);
Say(SC01_ER);

}

void SayCHIP() {
Say(SC01_CH);
Say(SC01_IH);
Say(SC01_P);

}

I typed it all in inside the Arduino IDE VOTRAXSC01.cpp tab, but all I get are errors ???

Hello @wperko - Would you show the errors that you see? What do you want it to "say?"

I think I found what you want...

Remove this
"Running (pause) diagnostic (pause)"

Say this
"I am an Altair computer"
"I have an two megahertz 8080 computer chip."

If this compiles, to accomplish what you want, rather than calling SayDiag(), you call: SayI(), SayAM(), SayAN(), SayALTAIR(), SayCOMPUTER(), SayI(), SayHAVE(), SayAN(), Say2(), SayMEGAHERTZ, Say80(), Say80(), SayCOMPUTER(), SayCHIP()

Please edit your post to add code tags. For instructions, see the "How to get the best out of this forum" post.

Hi,

I am attaching a link for the original files + a text file of what I want to replace in the program.

Maybe you can do the fixes, and send them back to me so I can just move forward and maybe see how the changes look.

You can send the fix back: wperko@brainless.org

https://www.brainless.org/Altair/Repository/VotraxSC01.zip

It would be better if the code were posted here... because not many (or none) will download and open a zip (except the Linux people. Linux people are like Honey Badgers).

SayNEVER() {
  Say(SC01_N);
  Say(SC01_EH);
  Say(SC01_V);
  Say(SC01_ER);
}

SayGONNA() {
  Say(SC01_G);
  Say(SC01_UH1);
  Say(SC01_UH3);
  Say(SC01_N);
  Say(SC01_AH1);
}

SayGIVE() {
  Say(SC01_G);
  Say(SC01_IH);
  Say(SC01_V);
}
SayYOU(); {
  Say(SC01_Y);
  Say(SC01_UW);
}

SayUP() {
  Say(SC01_AH);
  Say(SC01_P);
}

: )

1 Like

Hi,

VOTRAXSC01.ino CODE:

#include "votraxsc01.h"

void setup() {
  SC01_Setup();
  ShutUp(); 
  delay(1000);
  SayHello();
  ShutUp(); 
  delay(1000);
}

void loop() {
  Diag();
  //SayChip();
  //QBertCus();
  ShutUp(); 
  delay(1000);
}

//void QBertCus(){
//    int PhonemesToSay = random(10,20);
//    for(int x=0; x<PhonemesToSay; x++) {
    //for (;;){
//        int RandomPhoneme = random(0,61);
//        Say(RandomPhoneme,80);
//    }
//}

void SayChip(){
  Say(42);
  Say(16);
  Say(11);
  Say(37);
}

VOTRAXSC01.CPP CODE:

#include "votraxsc01.h"

//Votrax Data Pins - For Ver-2:  NOTE: Ver 1 is different!
const int SC01_P0 = 4;     // 6-Bit Data LSB.
const int SC01_P1 = 3;     // 6-Bit Data.
const int SC01_P2 = 2;     // 6-Bit Data.
const int SC01_P3 = 11;    // 6-Bit Data.
const int SC01_P4 = 10;    // 6-Bit Data.
const int SC01_P5 = 5;     // 6-Bit Data MSB.
const int SC01_I1 = 8;     // 2-Bit Inflection LSB.
const int SC01_I2 = 9;     // 2-Bit Inflection MSB.
const int SC01_Str = 7;    // Data Strobe (Active=HIGH).
const int SC01_Ack = 6;    // Ácknowledge/Request (Active=LOW).
const int ClockPower = 12; // Votrax Clock Power.

#define SC01_EH1 0x02
#define SC01_PA0 0x03
#define SC01_I3  0x09
#define SC01_N   0x0D
#define SC01_NG  0x14
#define SC01_AH1 0x15
#define SC01_L   0x18
#define SC01_K   0x19
#define SC01_H   0x1B
#define SC01_G   0x1C
#define SC01_D   0x1E
#define SC01_S   0x1F
#define SC01_AY  0x21
#define SC01_UH3 0x23
#define SC01_T   0x2A
#define SC01_R   0x2B
#define SC01_EE  0x2C
#define SC01_UH1 0x32
#define SC01_U   0x33
#define SC01_O1  0x35
#define SC01_U1  0x37

void Diag(){
  ShutUp();
  delay(500);
  SayDiag();
  ShutUp();
  delay(500);
  for(int p=0; p<64; p++){
    for(int i=0; i<4; i++) {
      Inflection(i);
      Say(p);
      Say(SC01_PA0);
    }
  }
}

void Say(int x){
  Phoneme(x);
  Strobe();
  delay(20);
  WaitForAck0();
}

void Say(int p, int d)
{
  Phoneme(p);
  Strobe();
  delay(d);  
}

void ShutUp(){
  Say(63);
}

void Ahhhh(){
  Say(47);
}

void Phoneme(int x){
    digitalWrite(SC01_P0, bitRead(x,0));
    digitalWrite(SC01_P1, bitRead(x,1));
    digitalWrite(SC01_P2, bitRead(x,2));
    digitalWrite(SC01_P3, bitRead(x,3));
    digitalWrite(SC01_P4, bitRead(x,4));
    digitalWrite(SC01_P5, bitRead(x,5));  
}

void Inflection(int x){
    digitalWrite(SC01_I1, bitRead(x,0));
    digitalWrite(SC01_I2, bitRead(x,1));
}

void Strobe(){
    digitalWrite(SC01_Str,HIGH);
    delay(1);
    digitalWrite(SC01_Str,LOW);    
}

void WaitForAck0(){
W0:
  if (digitalRead(SC01_Ack)==0){
    goto W0;
  }
}

void WaitForAck1(){
W1:
  if (digitalRead(SC01_Ack)==1){
    goto W1;
  }
}

void TestIO(){
  digitalWrite(SC01_Str,LOW);
  delay(20);
  digitalWrite(SC01_Str,HIGH);
  delay(20);
}

void SC01_Setup(){
  // Set the Arduino's I/O lines
  pinMode(ClockPower, OUTPUT);       digitalWrite(ClockPower,LOW);    // Put Chip in Non-Clock mode while setting I/O.
  pinMode(SC01_Ack, INPUT);          pinMode(SC01_Ack, INPUT_PULLUP); // Ácknowledge/Request. 
  pinMode(SC01_P0, OUTPUT);          digitalWrite(SC01_P0,LOW);       // Data 0.
  pinMode(SC01_P1, OUTPUT);          digitalWrite(SC01_P1,LOW);       // Data 1.
  pinMode(SC01_P2, OUTPUT);          digitalWrite(SC01_P2,LOW);       // Data 2.
  pinMode(SC01_P3, OUTPUT);          digitalWrite(SC01_P3,LOW);       // Data 3.
  pinMode(SC01_P4, OUTPUT);          digitalWrite(SC01_P4,LOW);       // Data 4.
  pinMode(SC01_P5, OUTPUT);          digitalWrite(SC01_P5,LOW);       // Data 5.
  pinMode(SC01_I1, OUTPUT);          digitalWrite(SC01_I1,HIGH);       // Inflection 0.
  pinMode(SC01_I2, OUTPUT);          digitalWrite(SC01_I2,HIGH);       // Inflection 1.
  pinMode(SC01_Str, OUTPUT);         digitalWrite(SC01_Str,LOW);      // Strobe.
  digitalWrite(ClockPower,HIGH);                                      // Put Chip in Clocked mode.
}

void SayDiag() {
  Say(SC01_R);
  Say(SC01_UH1);
  Say(SC01_UH3);
  Say(SC01_N);
  Say(SC01_EE);
  Say(SC01_N);
  Say(SC01_NG);
  Say(SC01_PA0);
  Say(SC01_D);
  Say(SC01_AH1);
  Say(SC01_AY);
  Say(SC01_I3);
  Say(SC01_G);
  Say(SC01_N);
  Say(SC01_AH1);
  Say(SC01_UH3);
  Say(SC01_S);
  Say(SC01_T);
  Say(SC01_I3);
  Say(SC01_K);
  Say(SC01_PA0);
}

void SayHello() {
  Say(SC01_H);
  Say(SC01_EH1);
  Say(SC01_UH3);
  Say(SC01_L);
  Say(SC01_UH3);
  Say(SC01_O1);
  Say(SC01_U1);
  
}
#include "votraxsc01.h"

//Votrax Data Pins - For Ver-2:  NOTE: Ver 1 is different!
const int SC01_P0 = 4;     // 6-Bit Data LSB.
const int SC01_P1 = 3;     // 6-Bit Data.
const int SC01_P2 = 2;     // 6-Bit Data.
const int SC01_P3 = 11;    // 6-Bit Data.
const int SC01_P4 = 10;    // 6-Bit Data.
const int SC01_P5 = 5;     // 6-Bit Data MSB.
const int SC01_I1 = 8;     // 2-Bit Inflection LSB.
const int SC01_I2 = 9;     // 2-Bit Inflection MSB.
const int SC01_Str = 7;    // Data Strobe (Active=HIGH).
const int SC01_Ack = 6;    // Ácknowledge/Request (Active=LOW).
const int ClockPower = 12; // Votrax Clock Power.

#define SC01_EH1 0x02
#define SC01_PA0 0x03
#define SC01_I3  0x09
#define SC01_N   0x0D
#define SC01_NG  0x14
#define SC01_AH1 0x15
#define SC01_L   0x18
#define SC01_K   0x19
#define SC01_H   0x1B
#define SC01_G   0x1C
#define SC01_D   0x1E
#define SC01_S   0x1F
#define SC01_AY  0x21
#define SC01_UH3 0x23
#define SC01_T   0x2A
#define SC01_R   0x2B
#define SC01_EE  0x2C
#define SC01_UH1 0x32
#define SC01_U   0x33
#define SC01_O1  0x35
#define SC01_U1  0x37

void Diag(){
  ShutUp();
  delay(500);
  SayDiag();
  ShutUp();
  delay(500);
  for(int p=0; p<64; p++){
    for(int i=0; i<4; i++) {
      Inflection(i);
      Say(p);
      Say(SC01_PA0);
    }
  }
}

void Say(int x){
  Phoneme(x);
  Strobe();
  delay(20);
  WaitForAck0();
}

void Say(int p, int d)
{
  Phoneme(p);
  Strobe();
  delay(d);  
}

void ShutUp(){
  Say(63);
}

void Ahhhh(){
  Say(47);
}

void Phoneme(int x){
    digitalWrite(SC01_P0, bitRead(x,0));
    digitalWrite(SC01_P1, bitRead(x,1));
    digitalWrite(SC01_P2, bitRead(x,2));
    digitalWrite(SC01_P3, bitRead(x,3));
    digitalWrite(SC01_P4, bitRead(x,4));
    digitalWrite(SC01_P5, bitRead(x,5));  
}

void Inflection(int x){
    digitalWrite(SC01_I1, bitRead(x,0));
    digitalWrite(SC01_I2, bitRead(x,1));
}

void Strobe(){
    digitalWrite(SC01_Str,HIGH);
    delay(1);
    digitalWrite(SC01_Str,LOW);    
}

void WaitForAck0(){
W0:
  if (digitalRead(SC01_Ack)==0){
    goto W0;
  }
}

void WaitForAck1(){
W1:
  if (digitalRead(SC01_Ack)==1){
    goto W1;
  }
}

void TestIO(){
  digitalWrite(SC01_Str,LOW);
  delay(20);
  digitalWrite(SC01_Str,HIGH);
  delay(20);
}

void SC01_Setup(){
  // Set the Arduino's I/O lines
  pinMode(ClockPower, OUTPUT);       digitalWrite(ClockPower,LOW);    // Put Chip in Non-Clock mode while setting I/O.
  pinMode(SC01_Ack, INPUT);          pinMode(SC01_Ack, INPUT_PULLUP); // Ácknowledge/Request. 
  pinMode(SC01_P0, OUTPUT);          digitalWrite(SC01_P0,LOW);       // Data 0.
  pinMode(SC01_P1, OUTPUT);          digitalWrite(SC01_P1,LOW);       // Data 1.
  pinMode(SC01_P2, OUTPUT);          digitalWrite(SC01_P2,LOW);       // Data 2.
  pinMode(SC01_P3, OUTPUT);          digitalWrite(SC01_P3,LOW);       // Data 3.
  pinMode(SC01_P4, OUTPUT);          digitalWrite(SC01_P4,LOW);       // Data 4.
  pinMode(SC01_P5, OUTPUT);          digitalWrite(SC01_P5,LOW);       // Data 5.
  pinMode(SC01_I1, OUTPUT);          digitalWrite(SC01_I1,HIGH);       // Inflection 0.
  pinMode(SC01_I2, OUTPUT);          digitalWrite(SC01_I2,HIGH);       // Inflection 1.
  pinMode(SC01_Str, OUTPUT);         digitalWrite(SC01_Str,LOW);      // Strobe.
  digitalWrite(ClockPower,HIGH);                                      // Put Chip in Clocked mode.
}

void SayDiag() {
  Say(SC01_R);
  Say(SC01_UH1);
  Say(SC01_UH3);
  Say(SC01_N);
  Say(SC01_EE);
  Say(SC01_N);
  Say(SC01_NG);
  Say(SC01_PA0);
  Say(SC01_D);
  Say(SC01_AH1);
  Say(SC01_AY);
  Say(SC01_I3);
  Say(SC01_G);
  Say(SC01_N);
  Say(SC01_AH1);
  Say(SC01_UH3);
  Say(SC01_S);
  Say(SC01_T);
  Say(SC01_I3);
  Say(SC01_K);
  Say(SC01_PA0);
}

void SayHello() {
  Say(SC01_H);
  Say(SC01_EH1);
  Say(SC01_UH3);
  Say(SC01_L);
  Say(SC01_UH3);
  Say(SC01_O1);
  Say(SC01_U1);
  
}

Finally, the VOTRAXSC01.h CODE:

#ifndef VOTRAXSC01_H

#define VOTRAXSC01_H

#include <Arduino.h>

void SC01_Setup();

void Say(int a);

void Say(int a, int b);

void ShutUp();

void Phoneme(int x);

void Inflection(int x);

void Strobe();

void WaitForAck0();

void WaitForAck1();

void TestIO();

void Diag();

void SayDiag();

void SayHello();

#endif

I want the program to only say:

void SayI() {
  Say(SC01_AY);
  
}

void SayAM() {
  Say(SC01_EH);
  Say(SC01_M);
  
}

void SayAN() {
  Say(SC01_AE);
  Say(SC01_N);
  
}

void SayALTAIR() {
  Say(SC01_AH);
  Say(SC01_L);
  Say(SC01_T);
  Say(SC01_EH);
  Say(SC01_R);
  
}

void SayCOMPUTER() {
  Say(SC01_K);
  Say(SC01_AH);
  Say(SC01_M);
  Say(SC01_P);
  Say(SC01_Y);
  Say(SC01_UW);
  Say(SC01_T);
  Say(SC01_ER);
  
}

void SayI() {
  Say(SC01_AY);
  
}

void SayHAVE() {
  Say(SC01_H);
  Say(SC01_AE);
  Say(SC01_V);
  
}

void SayAN() {
  Say(SC01_AE);
  Say(SC01_N);
  
}

void Say2() {
  Say(SC01_T);
  Say(SC01_UW);
  
}

void SayMEGAHERTZ() {
  Say(SC01_M);
  Say(SC01_EH);
  Say(SC01_G);
  Say(SC01_AH);
  Say(SC01_H);
  Say(SC01_ER);
  Say(SC01_T);
  Say(SC01_S);
  
}

void Say8080() {
  Say(SC01_EY);
  Say(SC01_T);
  
}

}
void Say8080() {
  Say(SC01_EY);
  Say(SC01_T);
  
}

void SayCOMPUTER() {
  Say(SC01_K);
  Say(SC01_AH);
  Say(SC01_M);
  Say(SC01_P);
  Say(SC01_Y);
  Say(SC01_UW);
  Say(SC01_T);
  Say(SC01_ER);
  
}

void SayCHIP() {
  Say(SC01_CH);
  Say(SC01_IH);
  Say(SC01_P);
  
}

I don't know c, I don't know the Arduino system beyond hitting the UpLoad button.

IF you can zip up the three files after they're fixed, here so I can download it, that would be great, I hate these tiny editing windows with extremely limited editing.

Does it now say "Running Diagnostic"? And, do you want it to say "I am an Altair computer. I have an [sic] two megahertz 8080 computer chip?"

Hi,

Correct. "Hello, Running Diagnostic", then spews out a bunch of odd sounds/phomenes for a couple of minutes, then say's then repeats everything.

I only want it to say; "Hello, I am an Altair computer, I have a two MegaHertz 8080 computer chip.

Say(SC01_H);
Say(SC01_EH1);
Say(SC01_UH3);
Say(SC01_L);
Say(SC01_UH3);
Say(SC01_O1);
Say(SC01_U1);

Say(SC01_AY);

Say(SC01_EH);
Say(SC01_M);

Say(SC01_AE);
Say(SC01_N);

Say(SC01_AH);
Say(SC01_L);
Say(SC01_T);
Say(SC01_EH);
Say(SC01_R);

Say(SC01_K);
Say(SC01_AH);
Say(SC01_M);
Say(SC01_P);
Say(SC01_Y);
Say(SC01_UW);
Say(SC01_T);
Say(SC01_ER);

Say(SC01_AY);

Say(SC01_H);
Say(SC01_AE);
Say(SC01_V);

Say(SC01_AE);
Say(SC01_N);

Say(SC01_T);
Say(SC01_UW);

Say(SC01_M);
Say(SC01_EH);
Say(SC01_G);
Say(SC01_AH);
Say(SC01_H);
Say(SC01_ER);
Say(SC01_T);
Say(SC01_S);

Say(SC01_EY);
Say(SC01_T);

Say(SC01_EY);
Say(SC01_T);

Say(SC01_K);
Say(SC01_AH);
Say(SC01_M);
Say(SC01_P);
Say(SC01_Y);
Say(SC01_UW);
Say(SC01_T);
Say(SC01_ER);

Say(SC01_CH);
Say(SC01_IH);
Say(SC01_P);

I believe the "spews out a bunch of odd sounds" was Q-bert swearing.

Below are the three files I have tried to correct. BEFORE YOU ERASE ANYTHING, be sure to save/backup your original files. Then, try these files in their places. "SayPhrase()" is your phrase. I "commented-out" the Diag

Be sure to have LOWER CASE extensions (.ino, .cpp, .h)

I saved the files at the following links:
VOTRAXSC01.ino
VOTRAXSC01.cpp
VOTRAXSC01.h

I probably made mistakes. Post your results here!

**************************************************.
**************************************************.

VOTRAXSC01.ino

#include "votraxsc01.h"

void setup() {
  SC01_Setup();
  ShutUp();
  delay(1000);
  SayHello();
  ShutUp();
  delay(1000);
}

void loop() {
  Diag();
  // SayChip();
  // QBertCus();
  SayPhrase(); // THIS IS THE PHRASE
  ShutUp();
  delay(1000);
}

void QBertCus() {
  int PhonemesToSay = random(10, 20);
  for (int x = 0; x < PhonemesToSay; x++) {
    for (;;) {
      int RandomPhoneme = random(0, 61);
      Say(RandomPhoneme, 80);
    }
  }
}

void SayChip() { // This is Chip (upper case C, lower case hip - not CHIP - see below)
  Say(42);
  Say(16);
  Say(11);
  Say(37);
}

/*
  Hello, I am an Altair computer, I have a two MegaHertz 8080 computer chip.
*/
void SayPhrase() {
  SayHello();
  Say(SC01_PA0); // pause
  SayI();
  SayAM();
  SayAN();
  SayALTAIR();
  SayCOMPUTER();
  Say(SC01_PA0); // pause
  SayI();
  SayHAVE();
  SayA();
  Say2();
  SayMEGAHERTZ();
  Say80();
  Say80();
  SayCOMPUTER();
  SayCHIP();
}

void SayI() {
  Say(SC01_AY);
}

void SayAM() {
  Say(SC01_EH);
  Say(SC01_M);
}

void SayA() {
  Say(SC01_EH); // As close as I could find to "A"
};

void SayAN() {
  Say(SC01_AE);
  Say(SC01_N);
}

void SayALTAIR() {
  Say(SC01_AH);
  Say(SC01_L);
  Say(SC01_T);
  Say(SC01_EH);
  Say(SC01_R);
}

void SayCOMPUTER() {
  Say(SC01_K);
  Say(SC01_AH);
  Say(SC01_M);
  Say(SC01_P);
  Say(SC01_Y);
  Say(SC01_UW);
  Say(SC01_T);
  Say(SC01_ER);
}

void SayI() {
  Say(SC01_AY);
}

void SayHAVE() {
  Say(SC01_H);
  Say(SC01_AE);
  Say(SC01_V);
}

void SayAN() {
  Say(SC01_AE);
  Say(SC01_N);
}

void Say2() {
  Say(SC01_T);
  Say(SC01_UW);
}

void SayMEGAHERTZ() {
  Say(SC01_M);
  Say(SC01_EH);
  Say(SC01_G);
  Say(SC01_AH);
  Say(SC01_H);
  Say(SC01_ER);
  Say(SC01_T);
  Say(SC01_S);
}

void Say80() {
  Say(SC01_EY);
  Say(SC01_T);
}

void Say80() {
  Say(SC01_EY);
  Say(SC01_T);
}

void SayCOMPUTER() {
  Say(SC01_K);
  Say(SC01_AH);
  Say(SC01_M);
  Say(SC01_P);
  Say(SC01_Y);
  Say(SC01_UW);
  Say(SC01_T);
  Say(SC01_ER);
}

void SayCHIP() {
  Say(SC01_CH);
  Say(SC01_IH);
  Say(SC01_P);
}

VOTRAXSC01.cpp

#include "votraxsc01.h"

//Votrax Data Pins - For Ver-2:  NOTE: Ver 1 is different!
const int SC01_P0 = 4;     // 6-Bit Data LSB.
const int SC01_P1 = 3;     // 6-Bit Data.
const int SC01_P2 = 2;     // 6-Bit Data.
const int SC01_P3 = 11;    // 6-Bit Data.
const int SC01_P4 = 10;    // 6-Bit Data.
const int SC01_P5 = 5;     // 6-Bit Data MSB.
const int SC01_I1 = 8;     // 2-Bit Inflection LSB.
const int SC01_I2 = 9;     // 2-Bit Inflection MSB.
const int SC01_Str = 7;    // Data Strobe (Active=HIGH).
const int SC01_Ack = 6;    // Ácknowledge/Request (Active=LOW).
const int ClockPower = 12; // Votrax Clock Power.

#define SC01_EH1 0x02
#define SC01_PA0 0x03
#define SC01_I3  0x09
#define SC01_N   0x0D
#define SC01_NG  0x14
#define SC01_AH1 0x15
#define SC01_L   0x18
#define SC01_K   0x19
#define SC01_H   0x1B
#define SC01_G   0x1C
#define SC01_D   0x1E
#define SC01_S   0x1F
#define SC01_AY  0x21
#define SC01_UH3 0x23
#define SC01_T   0x2A
#define SC01_R   0x2B
#define SC01_EE  0x2C
#define SC01_UH1 0x32
#define SC01_U   0x33
#define SC01_O1  0x35
#define SC01_U1  0x37

void Diag() {
  ShutUp();
  delay(500);
  // SayDiag();
  // ShutUp();
  // delay(500);
  for (int p = 0; p < 64; p++) {
    for (int i = 0; i < 4; i++) {
      Inflection(i);
      Say(p);
      Say(SC01_PA0);
    }
  }
}

void Say(int x) {
  Phoneme(x);
  Strobe();
  delay(20);
  WaitForAck0();
}

void Say(int p, int d)
{
  Phoneme(p);
  Strobe();
  delay(d);
}

void ShutUp() {
  Say(63);
}

void Ahhhh() {
  Say(47);
}

void Phoneme(int x) {
  digitalWrite(SC01_P0, bitRead(x, 0));
  digitalWrite(SC01_P1, bitRead(x, 1));
  digitalWrite(SC01_P2, bitRead(x, 2));
  digitalWrite(SC01_P3, bitRead(x, 3));
  digitalWrite(SC01_P4, bitRead(x, 4));
  digitalWrite(SC01_P5, bitRead(x, 5));
}

void Inflection(int x) {
  digitalWrite(SC01_I1, bitRead(x, 0));
  digitalWrite(SC01_I2, bitRead(x, 1));
}

void Strobe() {
  digitalWrite(SC01_Str, HIGH);
  delay(1);
  digitalWrite(SC01_Str, LOW);
}

void WaitForAck0() {
W0:
  if (digitalRead(SC01_Ack) == 0) {
    goto W0;
  }
}

void WaitForAck1() {
W1:
  if (digitalRead(SC01_Ack) == 1) {
    goto W1;
  }
}

void TestIO() {
  digitalWrite(SC01_Str, LOW);
  delay(20);
  digitalWrite(SC01_Str, HIGH);
  delay(20);
}

void SC01_Setup() {
  // Set the Arduino's I/O lines
  pinMode(ClockPower, OUTPUT);       digitalWrite(ClockPower, LOW);   // Put Chip in Non-Clock mode while setting I/O.
  pinMode(SC01_Ack, INPUT);          pinMode(SC01_Ack, INPUT_PULLUP); // Ácknowledge/Request.
  pinMode(SC01_P0, OUTPUT);          digitalWrite(SC01_P0, LOW);      // Data 0.
  pinMode(SC01_P1, OUTPUT);          digitalWrite(SC01_P1, LOW);      // Data 1.
  pinMode(SC01_P2, OUTPUT);          digitalWrite(SC01_P2, LOW);      // Data 2.
  pinMode(SC01_P3, OUTPUT);          digitalWrite(SC01_P3, LOW);      // Data 3.
  pinMode(SC01_P4, OUTPUT);          digitalWrite(SC01_P4, LOW);      // Data 4.
  pinMode(SC01_P5, OUTPUT);          digitalWrite(SC01_P5, LOW);      // Data 5.
  pinMode(SC01_I1, OUTPUT);          digitalWrite(SC01_I1, HIGH);      // Inflection 0.
  pinMode(SC01_I2, OUTPUT);          digitalWrite(SC01_I2, HIGH);      // Inflection 1.
  pinMode(SC01_Str, OUTPUT);         digitalWrite(SC01_Str, LOW);     // Strobe.
  digitalWrite(ClockPower, HIGH);                                     // Put Chip in Clocked mode.
}

void SayDiag() { // "RUNNING (PAUSE) DIAGNOSTIC (PAUSE)
  Say(SC01_R);
  Say(SC01_UH1);
  Say(SC01_UH3);
  Say(SC01_N);
  Say(SC01_EE);
  Say(SC01_N);
  Say(SC01_NG);
  Say(SC01_PA0);
  Say(SC01_D);
  Say(SC01_AH1);
  Say(SC01_AY);
  Say(SC01_I3);
  Say(SC01_G);
  Say(SC01_N);
  Say(SC01_AH1);
  Say(SC01_UH3);
  Say(SC01_S);
  Say(SC01_T);
  Say(SC01_I3);
  Say(SC01_K);
  Say(SC01_PA0);
}

void SayHello() { // "HELLO"
  Say(SC01_H);
  Say(SC01_EH1);
  Say(SC01_UH3);
  Say(SC01_L);
  Say(SC01_UH3);
  Say(SC01_O1);
  Say(SC01_U1);
}

VOTRAXSC01.h

#ifndef VOTRAXSC01_H

#define VOTRAXSC01_H
#include <Arduino.h>

void SC01_Setup();
void Say(int a);
void Say(int a, int b);
void ShutUp();
void Phoneme(int x);
void Inflection(int x);
void Strobe();
void WaitForAck0();
void WaitForAck1();
void TestIO();
void Diag();
void SayDiag();
void SayHello();

#endif

Hi, @wperko

Who or what is the code for?

Can you please tell us your electronics, programming, arduino, hardware experience?

Is this a school/college/university project?

Do you want to learn Arduino C++?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

It is a speech synth... Circa 1982(?)

Ah! Happy memory of trying to get a Votrax to sing George and Ira Gershwin's "Let's call the whole thing off"

"You like potato and I like potato
You like tomato and I like tomato
Potato, potahto, tomato, tomahto
Let's call the whole thing off"

Hi,

I have a an old VOTRAX SC-01A chip.

I bought a little Arduino shield that uses the VOTRAX SC-01A chip.

I thought it would be easy to replace the initial demo speech with new speech, but that's not working and I don't know the c programming language. I can barely do BASIC programming.

I want to change the program from the current "Hello, Running Diagnostics" and making noises, to saying; "Hello, I am an Altair computer with a two megahertz 8080 chip."

The demo program works, but should be written better so that somebody like myself can easily change what is said.

It would be so much easier to have a separate data file of what the program should speak, or put the speech data at the end so people can just change it out.

Hi,

Too bad you can't attach files here. The files sent did not have the changed speech code. ???

Next time, just attach the files to an email. That was another clumsy way to send files.

I see one mistake (maybe) of mine (at least) is not commenting-out "diag()" but I believe it is part of setting up. It pronounces all the letters. Maybe that is the nonsense you hear. All the files are on these links (above) and correct (with diag() commented out). Use the links, click "code" tabs.

I will not email to anyone.

[edit]... I know it is awkward to "describe" the sounds you hear, but try these files and let them play through, and "describe" the incorrect part. The .INO definitely has your phrase ready to go.

Hi,

The .cpp file doesn’t have the new sentence ??? It’s just the same old program.

image001.jpg

Hi,

I already hear all that original sounds and stuff ... I want the board to say "Hello, I am an Altair computer with a two megahertz 8080 chip."

I tried changing the code, but my copy/paste new phonemes idea didn't work.

void SayI() {
Say(SC01_AY);

}

void SayAM() {
Say(SC01_EH);
Say(SC01_M);

}

void SayAN() {
Say(SC01_AE);
Say(SC01_N);

}

void SayALTAIR() {
Say(SC01_AH);
Say(SC01_L);
Say(SC01_T);
Say(SC01_EH);
Say(SC01_R);

}

void SayCOMPUTER() {
Say(SC01_K);
Say(SC01_AH);
Say(SC01_M);
Say(SC01_P);
Say(SC01_Y);
Say(SC01_UW);
Say(SC01_T);
Say(SC01_ER);

}

void SayI() {
Say(SC01_AY);

}

void SayHAVE() {
Say(SC01_H);
Say(SC01_AE);
Say(SC01_V);

}

void SayAN() {
Say(SC01_AE);
Say(SC01_N);

}

void Say2() {
Say(SC01_T);
Say(SC01_UW);

}

void SayMEGAHERTZ() {
Say(SC01_M);
Say(SC01_EH);
Say(SC01_G);
Say(SC01_AH);
Say(SC01_H);
Say(SC01_ER);
Say(SC01_T);
Say(SC01_S);

}

void Say8080() {
Say(SC01_EY);
Say(SC01_T);

}

}
void Say8080() {
Say(SC01_EY);
Say(SC01_T);

}

void SayCOMPUTER() {
Say(SC01_K);
Say(SC01_AH);
Say(SC01_M);
Say(SC01_P);
Say(SC01_Y);
Say(SC01_UW);
Say(SC01_T);
Say(SC01_ER);

}

void SayCHIP() {
Say(SC01_CH);
Say(SC01_IH);
Say(SC01_P);

}

YOUR version of the .CPP is the same old program. MY version has been changed to remove SayDiag(). Linked above.

This is your version of the code. I removed the extra line feed, the extra close brace, and renamed Say8080() to Say80().

You are still using your code. Not mine. Linked above.

aha: brainless

If you don't want to learn any programming
How about using a ready to use sound-recorder that replays anything recorded by pressing a button?
Type your sentence into any kind of online tool robot voice saying ....
record it and you are done.