hello guys,girls,
I would like to interface with the SPI bus, and I am not good in timing. i have currently 4 max31855 and they all work together at 5MHz. thats good.
so i started to copy the code in the larger code and i have the following programs in the Void loop, Void setup is straight forward.
void Setup contains:
what I would like to do is to poll or ask info from the 4 max31855 thermocouples and then send it to the screen 10 samples per second
can I write something like:
many thanks
I would like to interface with the SPI bus, and I am not good in timing. i have currently 4 max31855 and they all work together at 5MHz. thats good.
so i started to copy the code in the larger code and i have the following programs in the Void loop, Void setup is straight forward.
void Setup contains:
- defining Pins Temperature, Faults, Currents, Direction,Pump and Flow,
- PID,
- myButton
- SPI.begin()
- TFT with the SPI.beginTransaction(settingsTFT) endTransaction();
- InternalADC()= adc reads inputs from the Hbridge drivers Polulu 18V25 2x and VMH5019 2x, Flow Sensor, and some Faults generated by the Polulu and VNH5019 drivers.
- Menu1Countdown(); //featherwing 3.5" here I call all the values on screen, such as Temperature, Current, encoder Menu1-8
- Menu1Check();//encoder Menu that runs through by clicking the RGB encoder and turning the knob and setting the value
- Thermocouples1_4(); reads the thermocouples1_4();
what I would like to do is to poll or ask info from the 4 max31855 thermocouples and then send it to the screen 10 samples per second
Code:
void loop()
{
nowMillis=millis();
InternalADC();
Menu1Check();
Menu1Countdown();
Thermocouples1_4();
}
can I write something like:
Code:
if(nowMillis-previousMillis>160) //160 =32x5us SCK Max31855
{
Thermocouple1_4();
}
else
{
Menu1Countdown();
}
many thanks