RPM WARNING LED GAU...
 
Notifications
Clear all

RPM WARNING LED GAUGE HELP

1 Posts
1 Users
0 Reactions
38 Views
(@cjstjddn20)
New Member
Joined: 1 week ago
Posts: 1
Topic starter  

Hello, I want to make a simple circuit using Eurotruck simulation 2 and a gauge using LEDs to make RPM alarms. I made it based on less coding together, but unfortunately it didn't work. Can anyone tell me the problem?

The link below is a picture of my circuit diagram.

removed link

#ifndef SHCUSTOMPROTOCOL_H
#define SHCUSTOMPROTOCOL_H

#include <Arduino.h>
class SHCustomProtocol {
private:

public:

void setup()
{
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
}

    
    void read()
    {
	
	
  int rpm = FlowSerialReadStringUntil('\n').toInt();
  
  
  if (rpm > 80) {
    digitalWrite(4, HIGH);
  }

  else {
    digitalWrite(4, LOW);
  }

    if (rpm > 85) {
    digitalWrite(3, HIGH);
  }

  else {
    digitalWrite(3, LOW);
  }

    if (rpm > 90) {
    digitalWrite(2, HIGH);
  }

  else {
    digitalWrite(2, LOW);
  }
  
  }


    void loop() {
    }


    void idle() {
    }
};

#endif

   
Quote
Share: