user5740843 user5740843 - 11 months ago 96
C Question

Arduino double command

I'm trying to find a way for my Arduino to recognize some of the commands I'm attempting to send over serial (via Raspberry Pi)

I'm come as far as to detect 2 commands, but I'm stuck at my last.

To give a little bit more detail, I have my fingerprint scanner (GT-511C3) connected, and the library installed that will make it work.

That said, with the first 2 commands consist the verifying of fingerprints to ID (which works great) and the enrolling of fingerprints to new ID's (also work great) these parts of the script are triggered by the respective ASCII code "0" and "1".

My last, and problematic command "2" to remove an ID, is where I'm seeking help with.

Here's the code I'm currently working with:

if(ser == '2'){
while(val2 == 0){
char val3 = 0;
Serial.println("Type the ID to be deleted");
val3 ==;
Serial.println("Deleted ID:");
val2 = 1;

I'm attempting to send the ASCII code "2" over Raspberry Pi through serial to the Arduino, followed by the ID that needs to be removed. It triggers after the command "2" is send, but refuses to read the ID and as such, I'm unable to finish it.

Any help or insight would really be appreciated.

Answer Source

val3 ==; should be val3 =;. You have an extra = which turns it into a useless comparison.