Added reading of all inputs on the stack level by one method

master V1.0.0
Jan Beníček 2023-11-22 18:38:54 +01:00
parent 22cecc2650
commit cb0ef6a2a2
1 changed files with 20 additions and 6 deletions

View File

@ -1,6 +1,4 @@
using System; using System.Device.I2c;
using System.Device.Gpio;
using System.Device.I2c;
namespace Libs_SequentMicrosystems namespace Libs_SequentMicrosystems
@ -46,11 +44,27 @@ namespace Libs_SequentMicrosystems
return val; return val;
} }
/// <summary>
/// Get data from all inputs on stack level
/// </summary>
/// <param name="stack">Number of level in stack</param>
/// <param name="precision">Number of decimals numbers of measured resistance</param>
/// <returns>Measured resistances of all inputs</returns>
public float[] GetStack(byte stack, byte precision = 2)
{
float[] chanels = new float[8]; //initialize float array
//public float[] GetStack(byte stack) chanels[0] = (float)Math.Round(Get(stack, 1), precision); //write readed value from input to array
//{ chanels[1] = (float)Math.Round(Get(stack, 2), precision);
chanels[2] = (float)Math.Round(Get(stack, 3), precision);
chanels[3] = (float)Math.Round(Get(stack, 4), precision);
chanels[4] = (float)Math.Round(Get(stack, 5), precision);
chanels[5] = (float)Math.Round(Get(stack, 6), precision);
chanels[6] = (float)Math.Round(Get(stack, 7), precision);
chanels[7] = (float)Math.Round(Get(stack, 8), precision);
//} return chanels; //return array
}
} }