I cannot seem to find out how to setmode of blinkstick
i am relatively new to programming so don’t be to hard on me as i am sure it is a slight overlook on my behalf
here is my code and i am simply wanting to set the mode of the blinkstick to inverse or mode 1 as this is what i need for my lights to function correctly.
here is my code ------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using BlinkStickDotNet;
namespace WpfApplication2
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class MainWindow : Window
{
string yourcolor = “#000000”;
public MainWindow()
{
InitializeComponent();
BlinkStick.Hid.AbstractBlinkstickHid[] newhid = BlinkStick.Hid.BlinkstickDeviceFinder.FindDevices();
foreach (BlinkStick.Hid.AbstractBlinkstickHid found in newhid)
{
listBox1.Items.Add(found.Serial.ToString());
}
}
private void button_Click(object sender, RoutedEventArgs e)
{
changecolor(yourcolor);
}
private void changecolor(string hexcolor)
{
BlinkStick.Hid.AbstractBlinkstickHid[] newhid = BlinkStick.Hid.BlinkstickDeviceFinder.FindDevices();
foreach (BlinkStick.Hid.AbstractBlinkstickHid found in newhid)
{
found.OpenDevice();
found.SetLedColor(hexcolor);
found.CloseDevice();
}
}
private void button_Click_1(object sender, RoutedEventArgs e)
{
changecolor("#FFFFFF");//this is inverted normally this is white but in our case this is black and turns off lights
}
private void textBox_TextChanged(object sender, TextChangedEventArgs e)// text box named "inputtext"
{
yourcolor = inputtext.Text;
}
}
}
any help would be appreciated thank you .