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

Thread Starter

timpickup1

Joined Apr 2, 2015
11
Hi All,

I plan on using this:

http://www.sainsmart.com/sainsmart-...ule-controller-for-automation-robotics-1.html

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?!
 

ErnieM

Joined Apr 24, 2011
8,377
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.
 

mcgyvr

Joined Oct 15, 2009
5,394
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..
 

John P

Joined Oct 14, 2008
2,025
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.
 
Top