When i run the code i get an error saying:
invalid conversion from 'int' to 'int*' [-fpermissive]
and i also get:
note: initializing argument 1 of 'void sendCm(int*)'
void sendCm(int cm[8])
this happens when the function sendCm runs.The function is supposed to send 8 bits to an lcd that is running in 4-bit mode.
Can someone please help?
I am still learning so..... yeah
const int d[4]={2,3,4,5};
const int cleards[8]={1,0,0,0,0,0,0,0};
const int rethome[8]={0,1,0,0,0,0,0,0};
const int dispcur[8]={1,1,1,1,0,0,0,0};
const int leftcur[8]={0,1,1,0,0,0,0,0};
void sendCm(int cm[8])
{
int i=0;
for(i=0;i<4;i++)
{
if(cm[i]==1)
{
digitalWrite(d[i],HIGH);
}
else
{
digitalWrite(d[i],LOW);
}
}
digitalWrite(e,HIGH);
digitalWrite(e,LOW);
for(i=0;i<4;i++)
{
if(cm[i+4]==1)
{
digitalWrite(d[i],HIGH);
}
else if(cm[i+4]==0)
{
digitalWrite(d[i],LOW);
}
}
digitalWrite(e,HIGH);
digitalWrite(e,LOW);
}
void setup() {
iopins();
Serial.begin(9600);
pinMode(i,INPUT);
pinMode(rs,OUTPUT);
pinMode(rw,OUTPUT);
pinMode(e,OUTPUT);
digitalWrite(rs,LOW);
digitalWrite(rw,LOW);
sendCm(cleards[8]);
sendCm(rethome[8]);
sendCm(dispcur[8]);
}