Using C++ To Programme a USB Relay Board (Or Other Options)

Discussion in 'Programmer's Corner' started by timpickup1, Apr 8, 2015.

  1. timpickup1

    Thread Starter New Member

    Apr 2, 2015
    Hi All,

    I plan on using this:

    To power 8 Solenoid valves in a system.

    I have no knowledge on coding and am planning on using programs made in C++. Would this be the eaisiest option and could anyone provide sample codes?

    The program, in simple terms, needs to do the following.

    Open Valve 1
    Wait 5 Seconds
    Close Valve 1
    Open Valve 2
    Wait 10 Seconds
    Close Valve 2

    Please help?!
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    You're going to need to learn some programming to do this, C++ inside windows can be tricky to get up to speed. Personally I've found VB easier to get something up and running but it's your circus and your monkeys so it's all your choice.

    What you write is a good starting flowchart for say a button press event handeler so you have a starting point. Microsoft gives away free vesions of these compilers so go get one and play around with the examples it gives.
  3. MaxHeadRoom


    Jul 18, 2013
    Duplicate subject/posting?
  4. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    I highly suggest not making that your first starting point into microcontrollers..

    I might suggest picking up an arduino uno and relay board from sain smart though and starting from there..
    Coding is much easier...plenty of tutorials,etc...

    But all in all.. You are going to have to learn to write programs in some sort or another..
  5. John P

    AAC Fanatic!

    Oct 14, 2008
    Apparently that interface board uses the FT245RL chip. When you get the drivers for that installed on your computer, it looks like a serial port as far as your software is concerned. If one is used to programming a PC (in whatever language!) then this is a pretty simple thing to control, but starting from scratch and trying to pick things up on your own will be a challenge. I use C myself, but people do say what Ernie stated above, that Visual Basic is the easiest language to get started with.