public void PinMode(CInterpreter state) { var pin = state.ReadArg(0).Int16Value; var mode = state.ReadArg(1).Int16Value; Pins[pin].Mode = mode; }
public void DigitalWrite(CInterpreter state) { var pin = state.ReadArg(0).Int16Value; var value = state.ReadArg(1).Int16Value; Pins[pin].DigitalValue = value; }
static void AssertBoolsAreEqual(CInterpreter state) { var expected = state.ReadArg(0); var actual = state.ReadArg(1); Assert.AreEqual((int)expected, (int)actual); }
static void AssertDoublesAreEqual(CInterpreter state) { var expected = state.ReadArg(0); var actual = state.ReadArg(1); Assert.AreEqual((double)expected, (double)actual, 1.0e-12); }
static void AssertFloatsAreEqual(CInterpreter state) { var expected = state.ReadArg(0); var actual = state.ReadArg(1); Assert.AreEqual((float)expected, (float)actual, 1.0e-6); }
static void AssertU16AreEqual(CInterpreter state) { var expected = state.ReadArg(0); var actual = state.ReadArg(1); Assert.AreEqual((ushort)expected, (ushort)actual); }
static void AssertAreEqual(CInterpreter state) { var expected = state.ReadArg(0).Int16Value; var actual = state.ReadArg(1).Int16Value; if (expected != actual) { Console.WriteLine($"{expected} != {actual}"); } //Assert.AreEqual ((short)expected, (short)actual); }
public void DigitalRead(CInterpreter state) { var pin = state.ReadArg(0).Int16Value; var value = Pins[pin].DigitalValue; state.Push(value); }
public void AnalogRead(CInterpreter state) { var pin = state.ReadArg(0).Int16Value; var value = Pins[pin].AnalogValue; state.Push(value); }
public void SerialPrintlnS(CInterpreter state) { var p = state.ReadArg(0).PointerValue; SerialOut.WriteLine(state.ReadString(p)); }
public void SerialPrintlnI(CInterpreter state) { var v = state.ReadArg(0).Int16Value; SerialOut.WriteLine(v); }
static void AssertU32AreEqual(CInterpreter state) { var expected = state.ReadArg(0); var actual = state.ReadArg(1); //Assert.AreEqual ((uint)expected, (uint)actual); }
public void SerialPrintS(CInterpreter state) { var p = state.ReadArg(0).PointerValue; SerialOut.Write(ReadString(p, state)); }