5 Likes
Happy New Year 2018
to Everyone
3 Likes
Also a happy new year from my ULD-grahics-display
5 Likes
Happy new year with TinyClr v0.7.0.0:
with code:
using System;
using System.Reflection;
namespace testBP_v7
{
class Program
{
private const string Message1 = "Happy New";
private const string Message2 = "Year 2018 !";
public void BrainPadSetup()
{
// Wait
BrainPad.Wait.Seconds(1);
BrainPad.Display.DrawText(0, 0, Message1);
BrainPad.Display.DrawText(0, 16, Message2);
DisplayAssemblies(24,8);
BrainPad.Display.ShowOnScreen();
}
public void BrainPadLoop()
{
BrainPad.Wait.Seconds(1);
}
void DisplayAssemblies(int i, int idxIncrement1)
{
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
foreach (var assembly in assemblies)
{
i += idxIncrement1;
// Get short name
string assemblyName = assembly.GetName().Name;
string cuttedName = "";
if (assemblyName.Length > assemblyName.LastIndexOf(".") + 1)
{
cuttedName = assemblyName.Substring(assemblyName.LastIndexOf(".") + 1);
}
BrainPad.Display.DrawSmallText(0, i, cuttedName + ": " + assembly.GetName().Version);
}
}
}
}
5 Likes
Happy New Year 2018 GHI Electronics Team with TinyCLR OS v0.7.0 on BreanPad and Stepper click. Happy New Year 2018 - YouTube
using System;
using System.Threading;
using testEasyStepperDriver;
using GTP = GHIElectronics.TinyCLR.Pins;
namespace HappyNewYear
{
class Program
{
static bool toggle = false;
UInt16 delay = 5; UInt32 nbpas = 30;
EasyStepperDriver stepper;
public void BrainPadSetup()
{
// Motor : SY57STH41-1006A (SYN=200 pas - U=5V - C=210g/cm) - Driver : STEPPER click
// STEPPER click on mikroBUS connector
stepper = new EasyStepperDriver(GTP.BrainPad.Expansion.GpioPin.Cs, GTP.BrainPad.Expansion.GpioPin.Pwm);
BrainPad.Display.DrawText(0, 10, "Happy New");
BrainPad.Display.DrawText(0, 30, "Year 2018 !");
BrainPad.Display.DrawSmallText(20, 55, "TinyCLR OS v0.7.0");
BrainPad.Display.ShowOnScreen();
BrainPad.Buttons.WhenLeftButtonPressed += Buttons_WhenLeftButtonPressed;
BrainPad.Buttons.WhenRightButtonPressed += Buttons_WhenRightButtonPressed;
}
private void Buttons_WhenRightButtonPressed()
{
toggle = false;
}
private void Buttons_WhenLeftButtonPressed()
{
toggle = true;
}
public void BrainPadLoop()
{
stepper.StepMode = EasyStepperDriver.Mode.Full; stepper.StepDirection = EasyStepperDriver.Direction.Backward;
if (toggle)
{
stepper.Turn(nbpas, EasyStepperDriver.Direction.Backward, delay);
Thread.Sleep(1000);
stepper.Turn(nbpas, EasyStepperDriver.Direction.Forward, delay);
Thread.Sleep(1000);
}
Thread.Sleep(10);
}
}
}
4 Likes