Go Down

Topic: how would i code this (Read 2605 times) previous topic - next topic


Do you know the relationship well?

The look up matrix idea would require that you know the output value for pairs of inputs; alternatively if you know the output as a function of the inputs then that's a simple matter of coding something like on-time = (0.5 x pot-time) + (thermistor-value^1.3) + 24 or whatever.

On the other hand if the relationship is fuzzy, well fuzzy logic might be good and I see from this thread that there is an Arduino fuzzy logic library.
Johannesburg hams call me: ZS6JMB on Highveld rep 145.7875 (-600 & 88.5 tone)
Dr Perry Cox: "Help me to help you, help me to help you...."
Your answer may already be here: https://forum.arduino.cc/index.php?topic=384198.0


this is what i have so far. just coding for Serial feed back. it works good, now just need to get it to control and injector. but we can just use a led for testing right now.

Code: [Select]
int pot = A1; // pin for the potentiometer
int output = 10; // pin that the out put is on
int potval,tempval = 0; // variable for storing the valve from the potentiometer
int temp = A2; // pin for the 10k thermistor

void setup() {
  Serial.begin(9600);      // for debugging via the Serial Monitor

void loop() {
  potval = analogRead(pot);  // read the value from the sensor
  tempval = analogRead(temp);
  Serial.print("temp                 ");

Go Up