Hey guys, I'm new here and need some help with some code as my knowledge in C++ is rusty. I need some assistance in writing a function as what I've written so far won't compile and I'm not sure how to fix the issue.
My code:
int* a;
int* b;
int* c;
int* d;
int* x;
void setup() {
pinMode(&a, OUTPUT);
pinMode(&b, OUTPUT);
pinMode(&c, OUTPUT);
pinMode(&d, OUTPUT);
}
void loop() {
void NixieOutput(&a, &b, &c, &d, &x)
{
if(&x = 0)
{
//0
digitalWrite(&a, LOW);
digitalWrite(&b, LOW);
digitalWrite(&c, LOW);
digitalWrite(&d, LOW);
}
if(&x = 1)
{
//1
digitalWrite(&a, LOW);
digitalWrite(&b, LOW);
digitalWrite(&c, LOW);
digitalWrite(&d, HIGH);
}
if(&x = 2)
{
//2
digitalWrite(&a, LOW);
digitalWrite(&b, LOW);
digitalWrite(&c, HIGH);
digitalWrite(&d, LOW);
}
if(&x = 3)
{
//3
digitalWrite(&a, LOW);
digitalWrite(&b, LOW);
digitalWrite(&c, HIGH);
digitalWrite(&d, HIGH);
}
if(&x = 4)
{
//4
digitalWrite(&a, LOW);
digitalWrite(&b, HIGH);
digitalWrite(&c, LOW);
digitalWrite(&d, LOW);
}
if(&x = 5)
{
//5
digitalWrite(&a, LOW);
digitalWrite(&b, HIGH);
digitalWrite(&c, LOW);
digitalWrite(&d, HIGH);
}
if(&x = 6)
{
//6
digitalWrite(&a, LOW);
digitalWrite(&b, HIGH);
digitalWrite(&c, HIGH);
digitalWrite(&d, LOW);
}
if(&x = 7)
{
//7
digitalWrite(&a, LOW);
digitalWrite(&b, HIGH);
digitalWrite(&c, HIGH);
digitalWrite(&d, HIGH);
}
if(&x = 8)
{
//8
digitalWrite(&a, HIGH);
digitalWrite(&b, LOW);
digitalWrite(&c, LOW);
digitalWrite(&d, LOW);
}
if(&x = 9)
{
//9
digitalWrite(&a, HIGH);
digitalWrite(&b, LOW);
digitalWrite(&c, LOW);
digitalWrite(&d, HIGH);
}
}
}
The error I keep getting is "variable or field 'NixieOutput' declared void".
The objective of the function is to control a nixie tube digitally with a BCD to decimal decoder. I had it working (I think) when I was coding the output directly in the main file but I want to make a function that I pass 4 pins to plus a decimal number and it sets the output that way the main code isn't so long and messy. Dumb dumb me had something connected wrong and thus I accidentally fried my board but it did work for a few seconds. All I had it do was change the number displayed once per second.
Anyways thanks for any help. I'm having fun getting back into programming!