Hi westfw,
Thanks for the helpful advice. I'm still unsure of how the code for reading, joining the values into 789x65123x and reading the values into
pin : 123456789A
result: 789x65123x
Also not all the combinations have so many connections, some have just for example 2-6 only (pin 2 connected to pin 6), all these combinations are unique to each class so each class would have its on unique connections. Also, some classes have a 3way connection eg 1-2,3-5-9 and some have 5-6,6-8,7-10. Would this method still work?
For your example code, is it placed in voidsetup or above it?
Also what does this mean?:
typedef struct _cst {
char connectionString[11];
} connectionString_type;
Hi Slumpert,
There are exactly 61 classes with its own unique connection combinations however some are add-ons to the previous eg class 10: 1-2 and class 11: 1-2,3-4. How do I turn the individual readings into the string?
So far my code before your reply(incomplete,still figuring stuff out):
#include <LiquidCrystal.h>
const int rs=13,en=12,d4=11,d5=10,d6=9,d7=8;
LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
int pinArray[] = {54,55,56,57,58,59,60,61,41,40};
int classArray[][2]= {{1,2634710},{2,2635710},{3,263468710},{4,56710},{5,710},{6,5668710},{7,2634},{8,2635},{9,26},{10,56}};
int i=1;
int count=0;
void setup()
{
lcd.begin(16,2);
lcd.print("=== PWC(SEA) ===");
lcd.setCursor(0, 1);
lcd.print("Plug Identifier");
delay(2000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("STARTING UP...");
delay(300);
lcd.clear();
for (count=0;count<10;count++)
{
pinMode(pinArray[count], OUTPUT);
}
}
void loop()
{
int a;
int pincombi ="";
int b;
for (count=0;count<10;count++)
{
digitalWrite(pinArray[count], HIGH);
while(a<10)
a=count+1;
if(digitalRead(a) ==HIGH)
{
lcd.print(a);
b= pincombi & a;
lcd.print(b);
}
}
}