Converting frequency to time (SOLVED)

The very best would be the smallest sketch that demonstrates the problem. Sometimes in writing the example you will discover the solution and not have to ask. :slight_smile:

void setup() 
{
  Serial.begin(115200);
  delay(200);

  int frequency, cycle_time;

  frequency = 400;
  cycle_time = ((1/frequency)*1000000);
  Serial.print(cycle_time);

  frequency = 1024;
  cycle_time = ((1/frequency)*1000000);
  Serial.print(cycle_time);
}

void loop() {}
2 Likes