Data input via serial UART
i building small project need test performance under different conditions, want able change integer value in sketch inputting value on laptop connected via uart.
i have written this;
which seems work, , holds numbers 1 - 9 ok char, need number integer integrate other calculations.
is there easy way either return integer value instead of char, or, convert char int?
i have written this;
code: [select]
char c;
void setup() {
serial.begin(9600);
}
void loop() {
if (serial.available())
{
c = serial.read();
}
serial.println(c); //for testing
delay(500); //for testing
}which seems work, , holds numbers 1 - 9 ok char, need number integer integrate other calculations.
is there easy way either return integer value instead of char, or, convert char int?
Arduino Forum > Using Arduino > Project Guidance > Data input via serial UART
arduino
Comments
Post a Comment