Go Down

Topic: Paying $30 for someone to write me a fairly simple mega 2560 program (Read 6055 times) previous topic - next topic

almstsobur

You guys are out of control...   This is not rocket science. I will do it myself if no one wants the $30 by this weekend. I figured something like this; a high school kid could get a case of beer, a box of rubbers and a joint for the weekend. I didn't expect to hire a professional, it's really not a difficult program.

chucktodd, I have the answers to all your questions; but I was waiting for someone to say they are interested. The schematic shows the display, it is a 7 segment LED that is already tied in automatically, it will show the digits as they are selected, no issues. It has a control IC and amplifier, the Arduino does not need to supply any measurable power.  I have tested all the digits,numbers and switching across all 7 selectors already with the 4 - 8421 wires and putting them by hand to the common pin. This unit is from the early 90's very well built, but also very hard to find parts for. I rebuilt the whole thing pretty much, minus the transformer, non-critical tolerance resistors and the reference Zener. It took about 30 0.01% resistors alone. The switches are shot, I did it the right way and opened them up to clean them. The gold coating on the rotary disc has been completely etched away. You don't spend $300 in precision parts just to squirt piss in the switches and hope for the best. This is a 3 parts per million precision calibrator and I intend to have for the rest of my life when I finish it. Replacement of the switches would cost $27/Each, and really have no benefit over it being digitally controlled.  The unit is slow, 200ms refresh time reading changed inputs. In fact it takes 24hrs just to warm up before it can reach it's 3ppm spec. It is controlling voltage up to 1000V, but the amperage isn't enough to electrocute a common house fly. It will be used exclusively in my home lab to calibrate my test equipment; except when taken to the calibrators to verify spec. I re-built this unit from the ground up, I would hardly blame the programmer of the $30 toy that runs the switching if there was a problem. Like I said, It is fully functional now, I just have to hand jumper the wires.

Now, on to the simplicity of the programming, it's just this easy.... 1 common per switch, four 5V  hot per switch. 0-9 per switch up, down in the opposite order, 1 number per push. 4 hots to common is zero, all hot to common except lead 1 is the number 1. all hot to common except lead 2 is the number 2. 8 & 4 hot, 2 and 1 not is the number 3, and so on. same for all 7 places/switches. Not difficult at all, I just know absolutely nothing about the Arduino programming language. So obviously it would be a learning curve for me. I'm assuming I will need to either install, or program for a pull up/down resistor for stability.

jurs

Are you kidding? Its the same script on 7 switches with 1 or 2 wires hot at a time to make 10 digits.
Make 10 digits from just 7 single-digit BCD encoder switches? How that?

YOU ARE KIDDING!

I will do it myself if no one wants the $30 by this weekend.
Good luck!

almstsobur

Make 10 digits from just 7 single-digit BCD encoder switches? How that?

YOU ARE KIDDING!
You lost me?? It's 7 individual "BCD rotary coded switches" each capable of 10 single digits. 0,1,2,3,4,5,6,7,8,9 using the 8421 BCD format. It requires 5 wires per "switch" 4 5V hot, 1 common, thus why I got the Mega.   

OldSteve

@almstsobur, if you know nothing about C++ programming for an Arduino, how could you know just how easy (or hard) it is?

You've heard the general consensus - $30 is an insult.

This describes the wiring, not the code:-
Quote
Now, on to the simplicity of the programming, it's just this easy.... 1 common per switch, four 5V  hot per switch. 0-9 per switch up, down in the opposite order, 1 number per push. 4 hots to common is zero, all hot to common except lead 1 is the number 1. all hot to common except lead 2 is the number 2. 8 & 4 hot, 2 and 1 not is the number 3, and so on. same for all 7 places/switches.
And this doesn't even make sense:-
Quote
8 & 4 hot, 2 and 1 not is the number 3, and so on.
Good luck writing your own code.
Please do not PM me for help. I am not a personal consultant.
And others will benefit as well if you post your question publicly on the forums.

6v6gt

#19
Jul 06, 2016, 01:39 pm Last Edit: Jul 06, 2016, 02:22 pm by 6v6gt Reason: typo
That's an ancient piece of equipment you've got.
To get you started, here is how you could replace the MSD switch as an example
Remove the switch and connect the 5 wires to the selected Adruino pins via 1K resistors.
Wire your 2 new buttons between ground and the selected Adruino pins via 1K resistors.
See comments in the sample sketch for the pin numbers.
Power your Arduino from the 5V supply of the control board on ensure the grounds are common.

Disclaimer. This is a hobby activity without any guarantees.
The example sketch does not scale up very well as it is currently written.
You should use tricks with the analog pins to have multiple buttons on one pin.
You have to retain the diodes between the bus and the Arduino pins in this example.
You may want to store the values of your buttons in EEprom.
The button debounce part need to be written. Don't use delays or you may interfere with the strobe cycle.
And don't PM me about it.

Code: [Select]

// See disclamer

const int msd_button_up = 4 ;
const int msd_button_down = 5 ;
const int msd_strobe = 10 ;   // marked C

const int bus_8 = 6 ;  // retain the diodes
const int bus_4 = 7 ;
const int bus_2 = 8 ;
const int bus_1 = 9 ;

unsigned int msd_value = 0 ;  // 0..9


void setup() {
  
    pinMode ( msd_button_up , INPUT_PULLUP ) ;
    pinMode ( msd_button_down , INPUT_PULLUP ) ;
    pinMode ( msd_strobe , INPUT_PULLUP ) ;
    pinMode ( bus_8 , OUTPUT ) ;
    pinMode ( bus_4 , OUTPUT ) ;    
    pinMode ( bus_2 , OUTPUT ) ;
    pinMode ( bus_1 , OUTPUT ) ;
}

void loop() {
   // no delays tolerated.
   if ( debounced( msd_button_up ) ) {
       if (msd_value < 9 ) { msd_value ++ ; }
       else { msd_value = 0 ; }
   }
   if ( debounced( msd_button_down ) ) {
       if (msd_value > 0 ) { msd_value -- ; }
       else { msd_value = 9 ; }
   }
   if ( msd_strobe == LOW ) {
       digitalWrite( bus_8 , ! bitRead( msd_value, 3 ) ) ;
       digitalWrite( bus_4 , ! bitRead( msd_value, 2 ) ) ;
       digitalWrite( bus_2 , ! bitRead( msd_value, 1 ) ) ;
       digitalWrite( bus_1 , ! bitRead( msd_value, 0 ) ) ;
   }
   else {
       digitalWrite( bus_8 , HIGH ) ;
       digitalWrite( bus_4 , HIGH ) ;
       digitalWrite( bus_2 , HIGH ) ;
       digitalWrite( bus_1 , HIGH ) ;
   }

}

almstsobur

@almstsobur, if you know nothing about C++ programming for an Arduino, how could you know just how easy (or hard) it is?

You've heard the general consensus - $30 is an insult.

This describes the wiring, not the code:-
And this doesn't even make sense:-
Good luck writing your own code.
I agree, I know very little about programming an Arduino. I assume it would be easy because it is four 5V wires and 1 common wire per switch, then repeated 7 times with only the Arduino output and the SPST momentary selection switch pin locations changing.

8 & 4 hot 1 & 2 not makes the number 3 in BCD. If you know what Binary Coded decimal is https://en.wikipedia.org/wiki/Binary-coded_decimal it makes perfect sense. This particular unit uses 8421 (a very standard format of BCD) so, that means you take the "8" pin (call it wire 4 if you want, doesn't matter) and the 4 pin (call it wire 3 if you want) and tie them both to the common pin of that switch (link all 3 of those wires together, leave the other 2 wires out) and the on-board BCD encoder/decoder creates the number "3" for you. 3 will show up on the seven segment LCD and 3 will be the voltage digit on that switches placement. I've already wired out the 8421, see the attached picture. In this case 8 is blue, 2 is green, 4 is orange, 1 is brown and white is common. Those the the digits in BCD terms. but feel free to call them wire 1,2,3,4 and common. They all match across all 7.

I understand now that it appears I have caught the wine and cheese Arduino crowd. My $30 will not open the laptop lids, I have been told. You guys should really buy cheaper wine. I program PLC's, SCADA systems and industrial networking equipment for a living and I repair test equipment as a hobby. I'm sure I will figure out the mighty Arduino and get it to connect the 4 wires of my choosing to the common wire in a uniform up/down order. As hard as that sounds, I am a believer! I have faith in the mighty Arduino. I'll drop a little free code up here when I finish, that way you can help the next poor bastard with no time on his hands. If he happens to be needed BCD switch coding.


almstsobur

Thank You for the start 6v6gt. Ahh yes, it is ancient. That's how i like them, they don't make stuff like this anymore. The Best DC load tester I have ever owned was built by Fujitsu Denso in 1979. It will load test 120 amps without breaking a sweat and works as well today as the day it was born. it's 5 AM here. off to get some sleep. Thanks for that chat everyone.

cedarlakeinstruments

Quote
Replacement of the switches would cost $27/Each
This does not really jibe with the "this is a $30 job" statement. It's clearly worth far more to you. I'd suggest you consider someone with more experience than a high school kid to do it if it's really that important that it work right. Seriously, I can barely get the oil in my car changed for $30 and that's a well-bounded task that I can do start to finish in 15 minutes by myself.

You're right, it's not a difficult job. But pay attention to the people saying that $30 doesn't move the needle. They're being realistic, not snobs. I'd suggest that in the future you present it as "hey, I need x job done. Can someone email me an estimate." When you start out by saying "I'll pay $30 for x," you are already presenting the attitude that it's not very important to you. Like it or not, price sends a signal and many of us have minimum charges for a reason.
Electronics and firmware/software design and assistance. No project too small

almstsobur

This does not really jibe with the "this is a $30 job" statement. It's clearly worth far more to you.
That's the thing, no it is not. I thought it was considerate to put my asking price in the title, I didn't do it to offend; I did it so people opening the thread new this was a $30 beer money job to me and that i was not looking for $$$$ programming services. if $30 doesn't even open your laptop lid, then why open the thread? I was just trying to avoid wasting peoples time, particularly any professionals that don't work for beer money. If this were ladder logic, or an Allen Bradley PLC, this is what I would consider a 10 minute job and I would take an individuals $30 buy a couple of Ribeyes for the BBQ with a side of cold beer and be happy we both came out good; me and the person needing a little help.

No worries, not a big deal. Sorry if I offended you all. I should get some time this weekend to take a look at this little gizmo and I think I will get it worked out.

cedarlakeinstruments

#24
Jul 07, 2016, 03:28 am Last Edit: Jul 07, 2016, 03:33 am by cedarlakeinstruments
almstsobur,

I think the reason people are responding is because we're used to being asked to do things for peanuts.

You're not wasting anyone's time. I try to use posts like this as learning opportunities. Am I priced too high? Are my clients expecting too much? Should I adjust my rates to reflect the global market? You may only want a quick $30 job, but it is valuable to someone who wants professional work to understand that it costs more than $30.

Over time I realized that if I wanted to take on the small jobs I prefer to specialize in, I have to aggressively trim my costs and watch my overhead closely.

I do lots of little $150 jobs and occasional free work for people that I have worked with in the past. Not everything has to be a $500 minimum, but count me among those for whom $30 won't move the needle. I'd rather just knock out a quick free sample and let you know that it's not tested and may not work than do "real" work for $30.

Electronics and firmware/software design and assistance. No project too small

almstsobur

Understandable, and for $30 I wouldn't expect perfection, nor ask for any changes if something wasn't quite right. I'm sure I can do some code tweaking based on what I see happening. It's more about not knowing the conventions of the program language, the details particular to this project that need tweaking should be easy to recognize I would think.

PaulMurrayCbr

Quote
I have 15 push button momentary contact switches, one for up one for down for each of the 7 rotary dials and 1 for all zero. I am willing to pay $30 (Paypal) for someone to write the Arduino code to make this work. 0-9 up 9-0 down for each of the 7u/7d switches and a single 15th switch to zero them all.
So, two input pins, four output pins, for each of seven digits, and a zero button.

That's a hell of a lot of pins you have there, but whatever. Here ya go.

Code: [Select]

const int DIALS = 7;

struct Button {
  const byte pin;
  int state;
  Button(byte pin) : pin(pin) {}

  void setup() {
    pinMode(pin, INPUT_PULLUP);
    state = digitalRead(pin);
  }

  boolean readPush() {
    int stateWas = state;
    state = digitalRead(pin);
    return  stateWas == HIGH && state == LOW;
  }
};


struct Dial {
  Button up;
  Button down;
  const byte outPin[4];
  int value;

  Dial(byte upPin,
       byte downPin,
       byte out8, byte out4, byte out2, byte out1) :
    up(upPin),
    down(downPin),
    outPin{out1, out2, out4, out8},
    value(0) {
  }

  void setup() {
    up.setup();
    down.setup();
    for (int i = 0; i < 4; i++) {
      pinMode(outPin[i], OUTPUT);
    }
    writeState();
  }

  void loop() {
    if (up.readPush()) {
      value = (value + 1) % 10;
      writeState();
    }

    if (down.readPush()) {
      value = (value + 9) % 10;
      writeState();
    }
  }

  void zero() {
    value = 0;
    writeState();
  }

  void writeState() {
    for (int i = 0; i < 4; i++) {
      digitalWrite(outPin[i], value & (1 << i) ? HIGH : LOW);
    }
  }
};

///////////////////////////
// PINOUT

Dial dial[DIALS] = {
  Dial(11, 12, 13, 14, 15, 16),
  Dial(21, 22, 23, 24, 25, 26),
  Dial(31, 32, 33, 34, 35, 36),
  Dial(41, 42, 43, 44, 45, 46),
  Dial(51, 52, 53, 54, 55, 56),
  Dial(61, 62, 63, 64, 65, 66),
  Dial(71, 72, 73, 74, 75, 76)
};

Button zeroButton = Button(99);

void setup() {
  for (int i = 0; i < DIALS; i++) dial[i].setup();
  zeroButton.setup();
}

void loop() {
  for (int i = 0; i < DIALS; i++) dial[i].loop();
  if (zeroButton.readPush()) {
    for (int i = 0; i < DIALS; i++) dial[i].zero();
  }
}


Maybe I have misunderstood - maybe you don't need four output pins for each dial, maybe you have four outputs to go to a 7SD decoder, three or four outputs to select which 7SD you want to output to, maybe a strobe and you want to multiplex them.

If so, you'll need to remove the output gear (the array of output pins, writestate, the initailizers and setup), and add a thingy that does the multiplexing (look at micros, if its time, then pull strobe down, move to next output, write selector and data pins, strobe up, increment lastUpdatedAtUs).

All doable, of course.
http://paulmurraycbr.github.io/ArduinoTheOOWay.html

ChrisTenone

Ding, ding ding!  I think you just won yourself thirty bucks Paul!

even if it doesn't work, right?
What, I need to say something else too?

patduino

Too late. Already written and sent.  Drinking my $30 beer right now!
There are 10 types of people in the world, those who understand binary, and those that don't.

ChrisTenone

#29
Jul 07, 2016, 06:56 am Last Edit: Jul 07, 2016, 06:58 am by ChrisTenone Reason: tri too spel IPA rite
Too late. Already written and sent.  Drinking my $30 beer right now!
It's bitter IPA tho, right?
What, I need to say something else too?

Go Up