hi , ive only recently started with the arduino , seemed very easy untill i had to start using other people libraries and then this . Im trying to multiply rpm by 2 but cannot get it working its actually part of a much bigger sketch but was trying to work it out on this small simplified one first .How the sketch is this does multiply by 2 but only to the closest 514 . Any help would be appreciated
#include <Arduino.h>
#include <Wire.h>
#include <OBD.h>
COBDI2C obd;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
obd.begin();
// initiate OBD-II connection until success
while (!obd.init());
}
void loop() {
// put your main code here, to run repeatedly:
int rpm;
int rpma=(rpm*2);
if (obd.read(PID_RPM,rpm));
Serial.print(rpm);
Serial.print("\t");
Serial.println(rpma);
delay (1);
}