Chop Shop

Chop Shop (Heather Phenix, Jeremy Littler  and Mitzi Martinez) – OCAD DFI, October 2012

 

 

Cho Shop Logo

Chop Shop is a multi-player, screen-based and sensor-controlled game that speaks to the collaborative and competitive physicality of our work environment. Introducing a playful, tactile game with multi-player capabilities is a way to facilitate interaction between DFI workspace dwellers and potentially increase productivity. Single player mode is also possible. Short and frequent breaks from work are known to get ideas flowing with fresh perspective, and this is the main intention behind Chop Shop. The interaction is provided through a series of proximity sensor boards connected to a central Arduino Uno and a projector. The fluctuating proximity of players’ hands over the sensor boards is what influences the related screen-based Chop Shop icons to move towards a target – a common goal if you will. The illustrated floating body parts projected on the screen make reference to the senses involved in the human design creation process. The idea is to provide an opportunity to break free from typical static sitting positions involved in digital work flows and increase productivity by moving around having fun in a collaborative environment.

 

http://www.youtube.com/watch?v=LFFmsFx7wf8

 

Initial Concept

 

Early Wiring Test

 

 

Assembly Test: It Worked!

 

Final Testing and Development (Photographs by Mtzi)

 

Schematics:

 

No schematics for this. See picture above! Follow the individual wiring instructions at:

 

http://www.instructables.com/id/DIY-3D-Controller/

 

Coming up with a wiring system is part of the learning process!

 

We used +5V and Pins 4, 5, 6, 7, 8, 9, 10, 11, 12, 13

on Arduino.

 

 

The Arduino Code:

 

// Sensor Source Code Provided by By Kyle McDonald

/// From the instructables project at:

// http://www.instructables.com/id/DIY-3D-Controller/

 

// Modification to support more than 3 sensors added

// by Jeremy Littler for the Arduino Uno

// Addition for Text Transfer added by Jeremy Littler

 

 

#define resolution 8

#define mains 60 // 60: north america, japan; 50: most other places

#define refresh 2 * 1000000 / mains

 

 

// Used To Manage the Serial WriteFunctionality

//char* mySensors[]={“000000#”, “000000#”, “000000#”, “000000#”, “000000#”,”000000#”};/

 

// Global to Keep track of sensor value

String PreSerialString = “”;

 

// Keep Track of the Return Values

long int timeport_value = 0;

 

 

 

 

void setup() {

Serial.begin(9600);

 

// unused pins are fairly insignificant,

// but pulled low to reduce unknown variables

for(int i = 2; i < 14; i++) {

pinMode(i, OUTPUT);

digitalWrite(i, LOW);

}

 

for(int i = 2; i < 14; i++)

pinMode(i, INPUT);

 

startTimer();

}

 

void loop() {

 

// Start By Putting Dummy Data in the Strings

// This will help deal with Errant Sensors

// Instructions on Getting Data

// http://www.processing.org/discourse/beta/num_1208648159.html

// Also intersting string transfer capabilitiy

//  http://www.interactiondesign.se/wiki/courses:intro.prototyping.fall.2011.nov24

 

 

 

// for (int x=0; x <= 9; x++) {

//  mySensors[x] = “000000#”;

//  Serial.println( myStrings[x]);

//}

 

 

// Declare Empty Values

// In case the Data is missing

 

 

// This codes reads the following digital Pin Lines

// Moving to another Arduino would be very difficult!

// Research PIND etc. and prepare to loose you mind!

// Pins 4, 5, 6, 7, 8, 9, 10, 11, 12, 13

 

 

// PIN 4

timeport_value = timePortD(4, B00010000);

String PreSerialString = “04#” + String(timeport_value) + “#”;

Serial.println(PreSerialString);

 

 

// PIN 5

timeport_value =  timePortD(5, B00100000);

PreSerialString = “05#” + String(timeport_value) + “#”;

Serial.println(PreSerialString);

 

 

// PIN 6

timeport_value =  timePortD(6, B01000000);

PreSerialString = “06#” + String(timeport_value) + “#”;

Serial.println(PreSerialString);

 

 

// PIN 7

timeport_value = timePortD(7, B10000000);

PreSerialString = “07#” + String(timeport_value) + “#”;

Serial.println(PreSerialString);

 

 

// PIN 8

timeport_value = timePortB(8, B00000001);

PreSerialString = “08#” + String(timeport_value) + “#”;

Serial.println(PreSerialString);

 

 

//PIN 9

timeport_value = timePortB(9, B00000010);

PreSerialString = “09#” + String(timeport_value) + “#”;

Serial.println(PreSerialString);

 

 

// PIN 10

timeport_value = timePortB(10, B00000100);

PreSerialString = “10#” + String(timeport_value) + “#”;

Serial.println(PreSerialString);

 

 

 

// PIN 11

timeport_value = timePortB(11, B00001000);

PreSerialString = “11#” + String(timeport_value) + “#”;

Serial.println(PreSerialString);

 

 

 

// PIN 12

timeport_value = timePortB(12, B00010000);

PreSerialString = “12#” + String(timeport_value) + “#”;

Serial.println(PreSerialString);

 

 

// PIN13

timeport_value = timePortB(13, B00100000);

PreSerialString = “13#” + String(timeport_value) + “#”;

Serial.println(PreSerialString);

//Serial.end();

 

 

 

}

 

 

// Deals with the Porst 1-7

// Gets The Per Pin Value

 

long timePortD(int pin1, byte mask1) {

unsigned long count1 = 0, total1 = 0;

while(checkTimer() < refresh) {

// pinMode is about 6 times slower than assigning

// DDRB directly, but that pause is important

pinMode(pin1, OUTPUT);

PORTD = 0;

pinMode(pin1, INPUT);

while((PIND & mask1) == 0)

count1++;

total1++;

}

startTimer();

return (count1 << resolution) / total1;

}

 

// Deals with the Porst 8-13

// Gets The Per Pin Value

 

long timePortB(int pin2, byte mask2) {

unsigned long count2 = 0, total2 = 0;

while(checkTimer() < refresh) {

// pinMode is about 6 times slower than assigning

// DDRB directly, but that pause is important

pinMode(pin2, OUTPUT);

PORTB = 0;

pinMode(pin2, INPUT);

while((PINB & mask2) == 0)

count2++;

total2++;

}

startTimer();

return (count2 << resolution) / total2;

}

 

extern volatile unsigned long timer0_overflow_count;

 

void startTimer() {

timer0_overflow_count = 0;

TCNT0 = 0;

}

 

unsigned long checkTimer() {

return ((timer0_overflow_count << 8) + TCNT0) << 2;

}

 

 

 

The Processing  Code:

 

/**

* Simple Read

*  Heather Phenix, Jeremy Littler  and Mitzi Martinez

*  OCAD October, 2012 – Digital Futures Program

 

* Read data from the serial port and change the color of a rectangle

* when a switch connected to a Wiring or Arduino board is pressed and released.

* This example works with the Wiring / Arduino program that follows below.

*/

 

 

import processing.serial.*;

PrintWriter output;

Serial myPort;  // Create object from Serial class

String val =”0″;      // Data received from the serial port

Boolean ShowSensorValues = true;

Integer CurrentSensorID = 0;

Integer CurrentSensorValue = 0;

String inBuffer = “”; // Serial Port Value Received

 

// For reading and writing the peak values file;

BufferedReader reader;

String line;

 

 

//PShape mainheart;

//PShape mainheart2;

 

// Stores the Game Images

PImage heart1;

PImage heart2;

PImage heart3;

PImage heart4;

PImage heart5;

PImage heart6;

PImage heart7;

PImage heart8;

PImage heart9;

PImage heart10;

 

// Keeps track of how many of the objects have made it to the circle.

Integer madeittocircle = 0;

 

// Keeps track of whether the “heart” has fell in in the well

int[] fellincircle = new int[10];

 

// Pins 4, 5, 6, 7, 8, 9, 10, 11, 12, 13

// Keeps Track of Sensor Values incoming

Integer Sensor4 =  0;

Integer Sensor5 =  0;

Integer Sensor6 =  0;

Integer Sensor7 =  0;

Integer Sensor8 =  0;

Integer Sensor9 =  0;

Integer Sensor10 = 0;

Integer Sensor11 = 0;

Integer Sensor12 = 0;

Integer Sensor13 = 0;

 

 

// Pins 4, 5, 6, 7, 8, 9, 10, 11, 12, 13

 

 

// Compensator forTop Range (i.e. did they touch values):

// The comensator adjusts for values when a user physically touches

// the surface element

int[] touch_comps = new int[10];

 

// Used To Store the None Touch Calibration Values

// Basically the initial state of the sensors when

// They are not being touched. This is the base

// Value that determines the result ranges.

 

int[] calibration_comps = new int[10];

 

// Sensor Value Array. This is available in  either separate vars or in an array form

int[] SenValArr = new int[10];

 

// Peak of Range for Sensor

int[] PeakofSensorRange = new int[10];

 

// Convert from a range of 1-5 the incoming sensor values

int[] SensorMap = new int[10];

 

 

// Postion of the the Shapes

float[] xpositions = new float[10];

float[] ypositions = new float[10];

 

// Indicate that the ring has been touched

int centeringr =  189;

int centeringg = 38;

int centeringb = 50;

 

 

void setup()

{

 

// Heart Shapoes

 

heart1 = loadImage(“heart1.png”);

heart2 = loadImage(“heart2.png”);

heart3 = loadImage(“heart3.png”);

heart4 = loadImage(“heart4.png”);

heart5 = loadImage(“heart5.png”);

heart6 = loadImage(“heart6.png”);

heart7 = loadImage(“heart7.png”);

heart8 = loadImage(“heart8.png”);

heart9 = loadImage(“heart9.png”);

heart10 = loadImage(“heart10.png”);

 

// Load the Touch Compensators

// Pins 4, 5, 6, 7, 8, 9, 10, 11, 12, 13

touch_comps[0] = 0;

touch_comps[1] = 0;

touch_comps[2] = 0;

touch_comps[3] = 0;

touch_comps[4] = 0;

touch_comps[5] = 0;

touch_comps[6] = 0;

touch_comps[7] = 0;

touch_comps[8] = 0;

touch_comps[9] = 0;

 

// Set the Canvas Size and Set the Backcolor to Black

size(1280, 800);

frameRate(50);

// background(0);

// I know that the first port in the serial list on my mac

// is always my  FTDI adaptor, so I open Serial.list()[0].

// On Windows machines, this generally opens COM1.

// Open whatever port is the one you’re using.

println(Serial.list());

 

// Port Number May Change Depending on the Computer!!!

myPort = new Serial(this, Serial.list()[6], 9600);

myPort.bufferUntil(‘\n’);

smooth();

noStroke();

 

// Initialize the Game

 

initializegame();

 

}

 

void draw()

 

{

//

 

// Display Sensor Value

 

fill(255, 255);

rect(0, 0, width, height);

background(0);

 

// This displays the sensor value a

// and Bars

 

if (ShowSensorValues == true) {

 

 

fill(255, 255, 255);

 

text(“S4 :” + Sensor4 + ”      ”  + calibration_comps[0] + ”       ” + PeakofSensorRange[0] + ”      ” +  SensorMap[0], 10, 20);

rect(400, 10, Sensor4/50, 10);

 

text(“S5 :” + Sensor5  + ”      ” + calibration_comps[1] + ”       ” + PeakofSensorRange[1]+ ”      ” +  SensorMap[1], 10, 40);

rect(400, 30, Sensor5/50, 10);

 

text(“S6 :” + Sensor6  + ”      ” + calibration_comps[2]+ ”       ” + PeakofSensorRange[2] + ”      ” +  SensorMap[2], 10, 60);

rect(400, 50, Sensor6/50, 10);

 

text(“S7 :” + Sensor7  + ”      ” + calibration_comps[3] + ”       ” + PeakofSensorRange[3]+ ”      ” +  SensorMap[3], 10, 80);

rect(400, 70, Sensor7/50, 10);

 

text(“S8 :” + Sensor8  + ”      ” + calibration_comps[4] + ”       ” + PeakofSensorRange[4] + ”      ” +  SensorMap[4], 10, 100);

rect(400, 90, Sensor8/50, 10);

text(“S9 :” + Sensor9  + ”      ” + calibration_comps[5]+ ”       ” + PeakofSensorRange[5] + ”      ” +  SensorMap[5] , 10, 120);

rect(400, 110, Sensor9/50, 10);

 

text(“S10 :” + Sensor10  + ”      ” + calibration_comps[6] + ”       ” + PeakofSensorRange[6] + ”      ” +  SensorMap[6], 10, 140);

rect(400, 130, Sensor10/50, 10);

 

text(“S11 :” + Sensor11  + ”      ” + calibration_comps[7]+ ”       ” + PeakofSensorRange[7] + ”      ” +  SensorMap[7], 10, 160);

rect(400, 150, Sensor11/50, 10);

 

text(“S12 :” +Sensor12  + ”      ” + calibration_comps[8]+ ”       ” + PeakofSensorRange[8] + ”      ” +  SensorMap[8], 10, 180);

rect(400, 170, Sensor12/50, 10);

 

text(“S13 :” +Sensor13  + ”      ” + calibration_comps[9]+ ”       ” + PeakofSensorRange[9] + ”      ” +  SensorMap[9], 10, 200);

rect(400, 190, Sensor13/50, 10);

 

text(” a = show sensor values”, 10, 220);

text(” s = hide sensor values”, 10, 240);

text(” d = take base reading”, 10, 260);

text(” f = save peak values”, 200, 220);

text(” g = load peak values”, 200, 240);

//text(“senor peaks = 0,1,2,3,4,5,6,7,8,9,0″, 10, 280);

text(” Fell in Sensor: ” + madeittocircle , 200, 260);

 

 

fill (255,255,255);

 

 

}

 

 

 

 

// *******************************

// Start of the Display Code

// ***************************

ellipseMode(RADIUS);  // Set ellipseMode to RADIUS

fill(256, 214, 40);   // Set fill to yellow

ellipse(650, 350, 40, 40);  // Draw white ellipse using RADIUS mode

 

ellipseMode(RADIUS); // Set ellipseMode to RADIUS

fill(centeringr, centeringg, centeringb); // Set to Red

// Set fill to white

ellipse(650, 350, 20, 20);  // Draw white ellipse using RADIUS mode

 

 

// Reset Set the X Positions if that occurs

 

 

for (int i = 0; i < 10; i = i+1) {

if(xpositions[i] >= 1280) {

xpositions[i] = 0;

}

}

 

 

 

for (int i = 0; i < 10; i = i+1) {

if(xpositions[i] >= 1280) {

xpositions[i] = 0;

}

}

 

 

for (int i = 0; i < 10; i = i+1) {

if(ypositions[i] >= 800) {

ypositions[i] = 0;

}

}

 

 

 

for (int i = 0; i < 10; i = i+1) {

if(ypositions[i] <= 0) {

ypositions[i] = 800;

}

}

 

 

 

 

// The Main Code

// Manages the Movement of the Elements

 

for (int i = 0; i < 10; i = i+1) {

 

 

//

if (int(SensorMap[i]) <= 1) {

ypositions[i] = ypositions[i] -1;

xpositions[i] = xpositions[i] + 1;

 

 

}

 

//

if (SensorMap[i] >= 2 && SensorMap[i] <=3) {

ypositions[i] = ypositions[i] + 1;

xpositions[i] = xpositions[i] + 1;

}

 

 

//

if (SensorMap[i] >= 4 && SensorMap[i] <=5) {

xpositions[i] = xpositions[i] – 2;

}

 

 

//

if (SensorMap[i] >= 6 && SensorMap[i] <=10) {

xpositions[i] = xpositions[i] + 2;

ypositions[i] = ypositions[i] + 1;

}

 

 

//

if (SensorMap[i] >= 30 && SensorMap[i] <= 20000)  {

xpositions[i] = 10;

ypositions[i] = 10;

}

 

// Checks to See if a hit test occurred

 

if (fellincircle[i] == 1) {

xpositions[i] = 1200;

ypositions[i] = 20;

}

 

 

 

}

 

 

// Keep the Shapes Frozen if they have fell in the circle at some point

for (int i = 0; i < 10; i = i+1) {

 

if (fellincircle[i] == 1) {

xpositions[i] = 1200 – i * 60;

ypositions[i] = 20;

}

 

}

 

 

image(heart1, xpositions[0],  ypositions[0], 60, 60);

image(heart2, xpositions[1],  ypositions[1], 60, 60);

image(heart3, xpositions[2],  ypositions[2], 60, 60);

image(heart4, xpositions[3],  ypositions[3], 60, 60);

image(heart5, xpositions[4], ypositions[4], 60, 60);

image(heart6, xpositions[5], ypositions[5], 60, 60);

image(heart7, xpositions[6], ypositions[6], 60, 60);

image(heart8, xpositions[7], ypositions[7], 60, 60);

image(heart9, xpositions[8], ypositions[8], 60, 60);

image(heart10, xpositions[9], ypositions[9], 60, 60);

 

 

// This part of the code senses the collisions

for (int i = 0; i < 10; i = i+1) {

 

if (xpositions[i] >= 620 && xpositions[i] <= 640 && ypositions[i] >= 300) {

if (ypositions[i] <= 400) {

 

fellincircle[i] = 1;

 

// Increment the Game Counter

madeittocircle = madeittocircle +1 ;

 

println(“HIT ____________________________________________”);

ellipseMode(RADIUS); // Set ellipseMode to RADIUS

fill(centeringr+10, centeringg+20, centeringb+30); // Set to Reddgd

// Set fill to whiteg

ellipse(650, 350, 220, 220);  // Draw white ellipse using RADIUS modeh

}

}

 

}

 

 

 

// Check the Count of thoise that fell in. If it is over the limnt

// Then Restart the Game

if (madeittocircle >= 10) {

// Reset the Game Count

initializegame();

}

 

 

}

 

 

 

// ************************

// Use to Initiate the Calibration

// Or display the Test Values

// **********************

 

 

void keyPressed() {

 

if (key == ‘a’) {

 

// Then show the sensor graphs

ShowSensorValues = true;

 

 

 

}

 

if (key == ‘s’) {

 

// Then hide the sensor graphs

ShowSensorValues = false;

 

}

 

 

if (key == ‘d’) {

 

// Then take a base reading

println(“——————-“);

 

for (int i = 0; i < 10; i = i+1) {

calibration_comps[i] =  SenValArr[i];

 

}

}

 

 

// *****************************

// CALIBRATES THE UPPER RANGE OF EACH SENSOR

 

if (key == ‘1’) {

 

// Then take a base reading

println(“PEAK 1 1111111111111111”);

PeakofSensorRange[0] =  Sensor4;

println(“PEAK 2222222222222222-“);

PeakofSensorRange[1] =  Sensor5;

 

}

 

if (key == ‘3’) {

 

// Then take a base reading

println(“PEAK 3 3333333333333”);

PeakofSensorRange[2] =  Sensor6;

 

}

 

if (key == ‘4’) {

 

// Then take a base reading

println(“PEAK 4 ———“);

PeakofSensorRange[3] =  Sensor7;

 

}

 

if (key == ‘5’) {

 

// Then tqqake a base reading

println(“PEAK 5 ———“);

PeakofSensorRange[4] =  Sensor8;

 

}

 

 

if (key == ‘6’) {

 

// Then tqqake a base reading

println(“PEAK 6 ———“);

PeakofSensorRange[5] =  Sensor9;

 

}

 

if (key == ‘7’) {

 

// Then tqqake a base reading

println(“PEAK 7 ———“);

PeakofSensorRange[6] =  Sensor10;

 

}

 

if (key == ‘8’) {

 

// Then tqqake a base reading

println(“PEAK 8 ———“);

PeakofSensorRange[7] =  Sensor11;

 

}

 

if (key == ‘9’) {

 

// Then tqqake a base reading

println(“PEAK 9 ———“);

PeakofSensorRange[8] =  Sensor12;

 

}

 

 

if (key == ‘0’) {

 

// Then tqqake a base reading

 

println(“PEAK 10 ———“);

PeakofSensorRange[9] =  Sensor13;

 

}

 

 

if (key == ‘f’) {

 

//  Save the Peak Values

 

println(“SAVE PEAK ———“);

 

 

// Example from Processing Reference

output = createWriter(“peakvalues.txt”);

 

for (int i = 0; i < 10; i = i+1) {

output.println(PeakofSensorRange[i]); // Write the coordinate to the file

}

output.flush(); // Writes the remaining data to the file

output.close(); // Finishes the file

 

}

 

if (key == ‘g’) {

 

// Example from Processing Reference

//  Load the Peak Value

println(“LOAD PEAK———“);

reader = createReader(“peakvalues.txt”);

try {

for (int i = 0; i < 10; i = i+1) {

line = reader.readLine();

PeakofSensorRange[i] =  int(line);

}

} catch (IOException e) {

}

}

 

 

if (key == ‘h’) {

 

initializegame();

 

}

 

 

}

 

 

 

// *******************

// Initialize Positions

// For Players

// ******************

 

void initializegame() {

 

 

println(” INITIALIZE ———————————–“);

 

// Move shappes back to X Position

//for (int i = 0; i < 10; i = i+1) {

//xpositions[i] = 0;

// }

 

// Reset the Fell in Circle

for (int i = 0; i < 10; i = i+1) {

fellincircle[i] = 0;

}

 

 

 

// Reset the Game Count

madeittocircle = 0;

 

//Reset the Y Poistions

ypositions[0] = 200; // heart

ypositions[1] = 70; // Eye

ypositions[2] = 130; // Hand

ypositions[3] = 200; // Brain

ypositions[4] = 260; // Ear

 

ypositions[5] = 400; // Lips

ypositions[6] = 470; // Nose

ypositions[7] = 540; // Male

ypositions[8] = 500; // Torso

ypositions[9] = 400; // Female

 

//Reset the Y Poistions

xpositions[0] = 300; // heartggg

xpositions[1] = 400; //

xpositions[2] = 600;

xpositions[3] = 800;

xpositions[4] = 1000;

 

 

xpositions[5] = 200;

xpositions[6] = 400;

xpositions[7] = 600;

xpositions[8] = 800;

xpositions[9] = 1000;

 

// Reposition the Objects

image(heart1, xpositions[0], ypositions[0], 60, 60);

image(heart2, xpositions[1], ypositions[1], 80, 80);

image(heart3, xpositions[2], ypositions[2], 60, 60);

image(heart4, xpositions[3], ypositions[3], 60, 60);

image(heart5, xpositions[4], ypositions[4], 60, 60);

image(heart6, xpositions[5], ypositions[5], 60, 60);

image(heart7, xpositions[6], ypositions[6], 60, 60);

image(heart8, xpositions[7], ypositions[7], 60, 60);

image(heart9, xpositions[8], ypositions[8], 60, 60);

image(heart10, xpositions[9], ypositions[9], 60, 60);

 

 

}

 

 

 

// ***********

// Serial Event Code

//************

 

void serialEvent (Serial myPort) {

 

// This codes reads the following digital Pin Lines

// Moving to another Arduino would be very difficult!

// Research PIND etc. and prepare to loose you mind!

// Pins 4, 5, 6, 7, 8, 9, 10, 11, 12, 13

// println(“SERIAL PORT CALL ——————-“);

 

try {

inBuffer =  myPort.readStringUntil(‘\n’);

//println(inBuffer);

String[] list = split(inBuffer, ‘#’);

 

CurrentSensorID = int(list[0]);

CurrentSensorValue = int(list[1]);

//println(CurrentSensorValue);

} catch(Exception e) {

} finally {

}

 

// Assign the Current Sensor Value to the Variable

 

try {

switch (CurrentSensorID) {

case 4:

Sensor4 = CurrentSensorValue;

SenValArr[0] = CurrentSensorValue;

println(“Four: ” + Sensor4);

break;

case 5:

Sensor5 = CurrentSensorValue;

SenValArr[1] = CurrentSensorValue;

println(“Five: ” + Sensor5);

break;

 

case 6:

Sensor6 = CurrentSensorValue;

SenValArr[2] = CurrentSensorValue;

println(“Six: ” + Sensor6);

break;

 

case 7:

Sensor7 = CurrentSensorValue;

SenValArr[3] = CurrentSensorValue;

println(“Seven: ” + Sensor7);

break;

 

case 8:

Sensor8 = CurrentSensorValue;

SenValArr[4]= CurrentSensorValue;

println(“Eight: ” + Sensor8);

break;

 

case 9:

Sensor9 = CurrentSensorValue;

SenValArr[5]= CurrentSensorValue;

println(“Nine: ” + Sensor9);

break;

 

 

case 10:

Sensor10 = CurrentSensorValue;

SenValArr[6]= CurrentSensorValue;

println(“Ten: ” + Sensor10);

break;

 

 

case 11:

Sensor11 = CurrentSensorValue;

SenValArr[7]= CurrentSensorValue;

println(“Eleven: ” + Sensor11);

break;

 

case 12:

Sensor12 = CurrentSensorValue;

SenValArr[8]= CurrentSensorValue;

println(“Twelve: ” + Sensor12);

break;

 

case 13:

Sensor13 = CurrentSensorValue;

SenValArr[9]= CurrentSensorValue;

println(“Thirteen: ” + Sensor13);

break;

}

} catch(Exception e) {

} finally {

}

 

 

 

// *******************************

// Get The Current Values for All Inputs and Map Them from 1-5

// ***************************

 

for (int i = 0; i < 10; i = i+1) {

SensorMap[i] =  int(map(SenValArr[i], calibration_comps[i], PeakofSensorRange[i], 1, 10));

 

}

 

 

}

 

 

 

Comments are closed.