• 0

a C++ project


Question

How hard would this project be to design?

I have limited knowledge of C++ from uni as part of my Elect Eng degree, and to be honest only really the C, in C++ syntax.

Anyway my mate?s dad has a small sunbed business, as in he makes them!! He?s recently started making those spray tan booths too. He needs a control process implemented into the spray booths which will allow the shop owner to set up a the correct spray booth settings for the user, and also a button for which the user can press once they are in the booth to begin the process.

Basically all it does is spray your face, your body, and your legs, but the shop keeper must be able to pick how long you want each part of your body to be sprayed for.

Face = anything from 5-15s

Body = anything from 5-15s

Legs = anything from 5-15s

He?s already went out and bought some hard wear, 16 I/O card for the computer etc, and input interfacing hardware for the booths.

I told him I could have done it for him no probs using a PLC, but anyway, how hard would it be to design a program to drive it,

Bearing in mind I have only compiled C programs and ran them in DOS!!

Should I tell him to find someone else! It would be nice to help him though

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

This is hard. You arent writing just a program, you are gonna have to tell the tanning spray thinggies what to do too. I cant help because I quit C++ and went to C#.

Link to comment
Share on other sites

  • 0

The fact that you admit you hardly know anything, based on your humbleness, also the risk factors involved if something goes wrong... I would tell you to find someone else.

A good rule of thumb is that if you don't think you can do it OR you know you need help, then step-down... especially if it's a serious situation... as this is.

As someone has already stated, this isn't a easy program... You're essentially designing firmware. And like most firmware, it's done on the hardware using a combination of Assembly & C++. The concept is easy, but the actual work is a little complex. You will have to interface with the hardware and actually tell it what to do, then allow it to take control, let it do its thing, then have it place control back into your hands.

Edited by HeartsOfWar
Link to comment
Share on other sites

  • 0

cheers guys, see thats what i was thinking anyway. i told him that although the problem looks easy, its actually not the simple at all.

its a shame becuase if he had spoke to me earlier i could have advised him on using a PLC control system (thats my Forte!!!!)

ach aw well. i feel a bit sorry for him as he has to get these spray booths to the client by mon. hahaha

Link to comment
Share on other sites

  • 0

First of all ignore all of them.

If you're touching hardware do it in c/c++.

The interface is just a minimal part of the program.

This problem will require you to do a fair amount of reading. Haven't you taken any courses on designing computer hardware or embedded systems? If not you might not be comfortable with computer architecture. If you can't tell me where you would even begin you would probably need to take a long time to figure this out.

Link to comment
Share on other sites

  • 0
First of all ignore all of them.

If you're touching hardware do it in c/c++.

The interface is just a minimal part of the program.

This problem will require you to do a fair amount of reading. Haven't you taken any courses on designing computer hardware or embedded systems? If not you might not be comfortable with computer architecture. If you can't tell me where you would even begin you would probably need to take a long time to figure this out.

Engineering computing was in my syllabus last semester. We looked at computer architecture based on the Jon von Neumann concepts and also coding in C++. We will get taught more next year on C++

Link to comment
Share on other sites

  • 0
So you have a vague idea how it all works, but doesn't sound like you've had very much experience with it yet.

No, not a great deal. Its electronics i study, just finished 2nd yr. we studied C++ for the 1st time last semester (4 months worth) it?s really hard. I can?t confess to being a fan of C!!! But i suppose we will have to learn embedded C for Micro's in 3rd year.

Link to comment
Share on other sites

  • 0

Here's what I'd do. THough I don't know what kind of controlers you got.

Basically you just need 2 pins per spray I guess.

power: spray, no power: don't spray.

so even the parrallel port (LPT) coul do. just wire up some LPT connector.

with 3x2 sets of cable. connect those to relays ( you need to switch power-circles, as the power from lpt will be too weak ).

Now we have a second problem: you want REALTIME! and there are not a lot of RTOS out there. But I guess Linux/windows would do it's 5 secounds + a few millisecounds - so what?

Now you could dig up some `how do I control my roboter over LTP1` or so tutorial and see how those lpt-pins are set on fire.

Well you are done. basically.

Now just have some file with 3 values (head,body,legs), read in the values. and fork off a thread for every part with the given parameters ( spray channel to use, duration ).

Now that doesn't sound too hard? does it?

if you take a webinterface( php, w\e ) just to set the 'spray' values. you are good to go.

if you don't know when the button is pushed ( you have no idea how to get a tool invoked by that ).

read up the robotic tutorial again. connect 2 more pins and listen on them for a connection. ( button pushed )

Have a state machine wich keeps in mind that you are already spraying - so the button won't do anything while you are spraying.

Well, at least that's how I understood your problem.

I'd stay in C though. I guess any langauge that will be able to control the pins on the LPT1 will do.

kindest regards,

Moritz "neofeed" Angermann.

Link to comment
Share on other sites

  • 0

Why don't you have a one shot 555 timer setup that is controlled by a button and a rheostat. The button is used to initiated the timer and the rheostat is used to control the time length by varying the resitance in the circuit. You can label the rheostat with the different time settings - 5s, 10s, 15s.

Link to comment
Share on other sites

  • 0
Here's what I'd do. THough I don't know what kind of controlers you got.

Basically you just need 2 pins per spray I guess.

power: spray, no power: don't spray.

so even the parrallel port (LPT) coul do. just wire up some LPT connector.

with 3x2 sets of cable. connect those to relays ( you need to switch power-circles, as the power from lpt will be too weak ).

Now we have a second problem: you want REALTIME! and there are not a lot of RTOS out there. But I guess Linux/windows would do it's 5 secounds + a few millisecounds - so what?

Now you could dig up some `how do I control my roboter over LTP1` or so tutorial and see how those lpt-pins are set on fire.

Well you are done. basically.

Now just have some file with 3 values (head,body,legs), read in the values. and fork off a thread for every part with the given parameters ( spray channel to use, duration ).

Now that doesn't sound too hard? does it?

if you take a webinterface( php, w\e ) just to set the 'spray' values. you are good to go.

if you don't know when the button is pushed ( you have no idea how to get a tool invoked by that ).

read up the robotic tutorial again. connect 2 more pins and listen on them for a connection. ( button pushed )

Have a state machine wich keeps in mind that you are already spraying - so the button won't do anything while you are spraying.

Well, at least that's how I understood your problem.

I'd stay in C though. I guess any langauge that will be able to control the pins on the LPT1 will do.

kindest regards,

Moritz "neofeed" Angermann.

cheers mate. but i think he must have found someone to do it. i hear what your saying about sticking in with C, i shall do so. thanks again. RAM

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.