8 Replies Latest reply on Aug 28, 2015 9:53 AM by JoMe_264151

    Convert string to int in PSOC designer

      Hi everyone,


      I try to receive some parameter through UART and convert them into int, but when I try to assign the conversion value to the internal registers, there is a error message;  I guess I missed something important about the data type, can anyone give me some suggestion?  Thank you!




      char * string;


      int parameter = 0;


      while(string = UART_szGetParam()) {
                          for (j=0; j<4; j++)
                            UART_CPutString(" <");
                            UART_PutString(string); // Print each parameter
                     parameter = atoi(string);  // this is where get error message


      !E main.c(278): operands of = have illegal types `array 7 of char' and `int'
      !E main.c(278): lvalue required
      make: *** [obj/main.o] Error 1