This week, we wrote haikus. However, in order to read the haiku a knob had to be turned to carrying degrees to have one of the three sentences (lines) appear on our computer screen. Each line of the haiku was given a range within, what for me was, two thresholds; it would appear based on the values, known as potValue(s), detected on the Arduino circuit. From power to sensor, it triggered one of three lines to print in the terminal on our computer screen.
Below is my code with comments and Haiku lines:
__________________________________________
int potPin = A0;
int potValue;
int threshold1 = 300;
int threshold2 = 900;
void setup() {
pinMode(potPin, INPUT);
Serial.begin(9600);
}
void loop() {
potValue = analogRead(potPin);
if (potValue < threshold1){
Serial.println("I want some pasta"); // line 1 .... three sentences of three different thoughts
}else if ((potValue > threshold1) && (potValue < threshold2)){ // the two objects to compare are within the (( )) values
Serial.println("The sun is too bright for eyes"); // line 2
} else {
Serial.println("Shoes on way too tight"); // line 3
}
//Serial.print("The Pot Value is = ");
//Serial.println(potValue);
delay(500); // standard is 10000 milliseconds equal to 1 second
}
// 1023 is the high and 0 is the low
// If lower than a thrshold, write the frist line of the Hiaku
// If other one than the second one...
// try random and see how the group of 5, 7, 5 syllable sentences, within context of a threshold, state a new sentence...