Browse Source

add languages

develop
Dslak 6 years ago
parent
commit
03f7e6fce0
  1. 24
      Arduino/Controller/Controller.ino
  2. 22
      Arduino/Lights/Lights.ino
  3. BIN
      Circuit/Controller.fzz
  4. BIN
      Circuit/Controller.pdf
  5. BIN
      Circuit/Trace.fzz
  6. BIN
      Circuit/Trace.pdf
  7. 8
      Processing/Processing.pde
  8. BIN
      Processing/data/Russian.aiff
  9. BIN
      Processing/data/Russian.mp3
  10. 1892
      SVG/stoneFull.svg

24
Arduino/Controller/Controller.ino

@ -1,15 +1,15 @@
int langs[] = {2,3,4,5};
int leds[] = {6,9,10,11};
bool state[] = {0,0,0,0};
int langs[] = {2,4,7,8,12,13};
int leds[] = {3,5,6,9,10,11};
bool state[] = {0,0,0,0,0,0};
int old = 0;
int current = 0;
void setup() {
Serial.begin(9600);
for(int i=0; i<4; i++) {
for(int i=0; i<6; i++) {
pinMode(langs[i], INPUT);
pinMode(leds[i], OUTPUT);
}
@ -18,18 +18,18 @@ void setup() {
void loop() {
checkStatus();
if(current == 0) {
for(int i=0; i<255; i++) {
checkStatus();
for(int x=0; x<4; x++) {
for(int x=0; x<6; x++) {
analogWrite(leds[x], i);
}
delay(10);
}
for(int i=255; i>0; i--) {
checkStatus();
for(int x=0; x<4; x++) {
for(int x=0; x<6; x++) {
analogWrite(leds[x], i);
}
delay(10);
@ -54,16 +54,16 @@ void loop() {
void checkStatus() {
current = 0;
for(int i=0; i<4; i++) {
for(int i=0; i<6; i++) {
state[i] = digitalRead(langs[i]);
//Serial.print(state[i]);
//Serial.print("\t");
if(state[i] == LOW) {
current = i+1;
}
}
}
if(old != current) {
old = current;

22
Arduino/Lights/Lights.ino

@ -1,7 +1,7 @@
int langs[] = {2,4,7,8};
int langs[] = {2,4,5,7,8,12};
int leds[] = {6,9,10,11};
int triggerPin = 12;
int triggerPin = 13;
int tracePin = 3;
bool langStatus[] = {0,0,0,0};
@ -14,10 +14,10 @@ bool trigger = 0;
int traceStatus = 0;
void setup() {
Serial.begin(9600);
for(int i=0; i<4; i++) {
for(int i=0; i<6; i++) {
pinMode(langs[i], INPUT);
pinMode(leds[i], OUTPUT);
}
@ -33,16 +33,16 @@ void setup() {
void loop() {
trigger = digitalRead(triggerPin);
if(oldTrigger != trigger) {
oldTrigger = trigger;
if(trigger == HIGH) {
checkLang();
Serial.print("speech");
Serial.print("\t");
Serial.println(currentLang);
for(int i=traceStatus; i>=0; i--) {
analogWrite(tracePin, i);
delay(5);
@ -82,16 +82,16 @@ void loop() {
void checkLang() {
currentLang = 0;
for(int i=0; i<4; i++) {
for(int i=0; i<6; i++) {
langStatus[i] = digitalRead(langs[i]);
//Serial.print(langStatus[i]);
//Serial.print("\t");
if(langStatus[i] == LOW) {
currentLang = i+1;
}
}
}
if(oldLang != currentLang) {
oldLang = currentLang;

BIN
Circuit/Controller.fzz

Binary file not shown.

BIN
Circuit/Controller.pdf

Binary file not shown.

BIN
Circuit/Trace.fzz

Binary file not shown.

BIN
Circuit/Trace.pdf

Binary file not shown.

8
Processing/Processing.pde

@ -1,14 +1,14 @@
import processing.serial.*;
import processing.sound.*;
SoundFile[] soundfile = {null,null,null,null,null,null};
SoundFile[] soundfile = {null,null,null,null,null,null,null};
Serial myPort;
String dataIn = "";
int linefeed = 10;
int currentLang = 0;
String[] langs = {"NONE","Italian","English","Spanish","German","French"};
String[] langs = {"NONE","Italian","English","Spanish","German","French","Russian"};
void setup() {
size(600, 400);
@ -17,14 +17,14 @@ void setup() {
println("Loading language file: "+langs[i]+".aiff");
soundfile[i] = new SoundFile(this, langs[i]+".aiff");
}
println("Ready!");
}
void draw() {
background(0);
float sw = textWidth(langs[currentLang]);
fill(255);
stroke(255);

BIN
Processing/data/Russian.aiff

Binary file not shown.

BIN
Processing/data/Russian.mp3

Binary file not shown.

1892
SVG/stoneFull.svg

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Loading…
Cancel
Save