Hi!
This is my code.
#include<VirtualWire.h>
const int numRows = 4;
const int numCols = 3;
const int debounceTime = 20;
const char Keymap[numRows][numCols] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
const int rowPins [numRows] = {7,2,3,6};
const int colPins [numCols] = {5,8,4};
void setup()
{
Serial.begin(9600);
for (int row = 0; row < numRows; row++)
{
pinMode(rowPins[row],INPUT);
digitalWrite(rowPins[row],HIGH);
}
for(int column = 0; column < numCols; column++)
{
pinMode(colPins[column],OUTPUT);
digitalWrite(colPins[column],HIGH);
}
vw_setup(2000);
}
void loop()
{
char Key = getKey();
send (Key);
}
char getKey()
{
char Key = 0;
for(int column = 0; column < numCols; column++)
{
digitalWrite(colPins[column],LOW);
for(int row = 0; row < numRows; row++)
{
if(digitalRead(rowPins[row])== LOW)
{
delay(debounceTime);
while(digitalRead(rowPins[row])== LOW);
Key = Keymap[row][column];
}
}
digitalWrite(colPins[column],HIGH);
}
return Key;
}
void send (char *message)
{
vw_send((uint8_t *)message, strlen(message));
vw_wait_tx(); // Wait until the whole message is gone
}
This is the error my compiler is showing up.
remote_tx.ino: In function 'void loop()':
remote_tx:35: error: invalid conversion from 'char' to 'char*'
remote_tx:35: error: initializing argument 1 of 'void send(char*)'
What am i doing wrong?