Notifications
Clear all

I fell in love with the LED & KEY board

120 Posts
7 Users
19 Reactions
38.7 K Views
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1038
 

@robo-pi

I got that down pat back in 75 with the Altair and all those switches and lights.

When I used to do interviews as part of our technical department's hiring process, I used to give a prospective employee a 2 digit HEX number and then ask them what was the decimal equivalent.  If they couldn't give me an answer in just a few seconds they got a big red X from me when the hiring committee got back together to compare notes on whether the candidate was to be hired.

Another question I'd ask of prospects that wanted a job in our networking group was, how many bits are there in a subnet mask for a subnet with 64 addresses?  Sometimes I changed the number to 8, or 16, or 32, or 128 if there were several lined up in the hall waiting their turn, just to keep them from sharing answers in the hallway.

My fellow employees used to give me the devil for doing that, but I found it quite amusing.

SteveG


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @joelyddon

Sorry if I caused so much trouble...  I always thought if one didn't know something or had questions, the only way to learn was to ASK.

It's always good to ask questions.  That's never a bad thing.

What tends to get people confused is when you ask a question, they answer it, and then you come back with something like.

"I already know that.  I've been programming longer than you've been alive."

It's that kind of reply to answered questions that causes people to wonder what the heck is going on?

I'm more than willing to help anyone who isn't understanding something.  But it's a bit disturbing to offer them an answer to the question only to have them toss the quote above back at me.

What does that cause me to want to say?

Well, my first instinct is to reply,...

"In that case Mr. Know-it-all figure it out for yourself."

I mean really.  What else should I say at that point?  I actually offered to try to better gasp exactly what it was you were trying to ask, wondering to myself all along, "If this guy has been programming longer than I have been alive then why in the world is he asking me programming questions?'

Isn't that a reasonable thing for me to be thinking at that point?

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @joelyddon

@robo-pi

Thank you for straightening me out... I just wish I hadn't opened this can of worms.

 

I fully understand. I do similar things all the time. I was just trying to explain how things appeared from our perspective.

Life will go on, and the sun will shine tomorrow.  ? 

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
JoeLyddon
(@joelyddon)
Member
Joined: 5 years ago
Posts: 157
 

@robo-pi

Yes, I guess that first response was a little heavy and uncalled for...  Sorry.

Have Fun,
Joe Lyddon

www.woodworkstuff.net


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  

@joelyddon

You have been fully forgiven by the angels of the cyber world.   All traces of the incident have been erased from the matrix.  Anyone caught with any remnants of the memory shall be executed like a bootstrap loader on an obsolete PC.

DroneBot Workshop Robotics Engineer
James


   
JoeLyddon reacted
ReplyQuote
JoeLyddon
(@joelyddon)
Member
Joined: 5 years ago
Posts: 157
 

@robo-pi

Thank you very much...

Don't forget this question...

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

I have a question for Y'all...

Given 4 bytes,  change the sequence of the data... 

ie:  4321  to 2143...  or ...  DCBA to BADC

What are the least amount of IBM Assembly Language instructions  that can be used to make the swap and what are they?

How long should I wait for possible answers before giving the Best answer possible?

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

 

Have Fun,
Joe Lyddon

www.woodworkstuff.net


   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

I have made some slight changes to this code.

1. In the sketch, I have added a limitation on the number input to 8 digits including the decimal point.

2. Changed the variable names in the library and header files, to match the standard library naming conventions.

Best to lead by example!

I am getting bored with this board, but I was just using it as a springboard. Sorry, just couldn't resist.

The purpose of this exercise for me was to learn how to create my own libraries.

I have found that there are three issues that should be noted.

1. The semicolon after the class declaration in the .h file is essential, otherwise, the compiler goes wild.

2. Using the naming convention in the .h and .cpp files save confusing the compiler if you happen to use the same variable names in the sketch.

3. If, when declaring the object in the sketch and the object has no parameters, the parentheses are omitted otherwise the sketch will not compile.


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  

@pugwash

Seems to work ok.  However I was getting some extra garbage on two segment displays following the end of the number.  I see that in the code you aren't accounting for the two extra bytes at the of the string that represent the end of the string.   So I subtracted 2 from tLen on line 34 and that removed the extra two calls to the shownum() method.  That cleaned it up.

        tString.toCharArray(tChar, tLen + 1); // convert string to character array
        for(int i = 0; i < tLen-2; i++){ // <---- subtracted 2 from tLen here
          if (i + 1 == decIdx){
          keyLed.showNum(i, (int(tChar[i]) - 48), true);
          } else {
          keyLed.showNum(i, int(tChar[i]) - 48);
          }
        }

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

@robo-pi

However I was getting some extra garbage on two segment displays following the end of the number.  I see that in the code you aren't accounting for the two extra bytes at the of the string that represent the end of the string. 

That is odd, I am not getting any garbage on the segments and if I change tLen to tLen - 2, I lose the last two digits. Just tried it!

I'll post the files again in case you are out of sync with the versions I am using:


   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

@robo-pi

Yer tis!

This is what is running on my Arduino at this very moment!


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @pugwash

I'll post the files again in case you are out of sync with the versions I am using:

Your zip files aren't working for me the way they are.   I had to change the name of your  *.ino file to the same name of the folder it's in to get it to run.   Then I had to change your include statement to quotes instead of brackets.

I also don't understand why your zip files contain an extra folder called _MACOSX  with what appears to be redundant files in it?

In fact, that probably explains everything right there.  Apparently you are doing this on a Mac OS?  And I'm running Windows 10.  That will no doubt cause some compatibility issues.

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

@robo-pi

In fact, that probably explains everything right there.  Apparently you are doing this on a Mac OS?  And I'm running Windows 10.  That will no doubt cause some compatibility issues.

It shouldn't make a blind bit of difference which operating system was used to create the .ino, .h or .cpp files, they are just pure text files.

I also don't understand why your zip files contain an extra folder called _MACOSX  with what appears to be redundant files in it?

The _MACOSX folder and files are an operating system thing, this folder is usually invisible to me and it holds information about the files e.g. the program needed to open the file etc., whereas Windows uses a central registry for this info.

Your zip files aren't working for me the way they are.   I had to change the name of your  *.ino file to the same name of the folder it's in to get it to run.   Then I had to change your include statement to quotes instead of brackets.

Sorry, I forgot about that! I have just been dropping the .ino file into the library folder and compressing them for convenience. I should have known better and changed the brackets to quotes as the library files were no longer in the <includepath>.


   
ReplyQuote
(@pugwash)
Sorcerers' Apprentice
Joined: 5 years ago
Posts: 923
 

@robo-pi

I am now going to work on the right justification problem, I just can't decide which route to go!

1. To pad out the segments with the appropriate number of zeros (0x00) before writing _segValues[].

2. Or calculate the insertion point in the register and then only manipulate the remaining segments.

Both ways, I will have to calculate the decIdx variable.

What are your thoughts?


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @pugwash

What are your thoughts?

In my first project I'm going to be using the first 4 segments to display temperature.   I'll probably leave the fourth position as "F" for Fahrenheit since that's what I use here in the USA.   So this leaves me with just 3 digits for the temp.  I won't need the decimal point for this as I'll just be displaying temp as a  2 digit or 3 digit whole number.   I simply don't need to know tenths of a degree.     In fact, the main thing I need to know is that it never dropped below 100 F and never goes much above 180 .     This is measuring the temperature of the water in my outdoor "boiler".   Although this water is actually in an open system and must never boil.

In any case, that's how I'll be using the first 4 digits.   The second 4 digits will be a humidity reading that I'll be taking simply because I can.   It will be quite similar.  The last segment will display an "H" for humidly and the 3 digits will be the humidity reading.   I forget how that reads.  I might want to use a decimal point there.

In any case, that's how I'll be using the 7-seg displays.

I'll be using some of the LEDs above the displays to show various conditions.   I'll probably have all 8 of them flash on and off if the stove ever goes above 180 F since that's an emergency situation.  It means that something went wrong as the system is not supposed to allow the temp to go above 180 F.

Similarly I might have them flash in a different way  when the temp goes below maybe 140 F to let me know that I better go put some more wood in the stove.

I also have it monitor the water level, so I'll probably have it flashing for that as well.  Don't want the water level to get too low. ? 

This display will be in my bedroom so I can see at a glance what the stove is doing at night.  I'll also have audible alarms for extreme conditions too in case something goes wrong with the stove while I'm sleeping.

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
JoeLyddon
(@joelyddon)
Member
Joined: 5 years ago
Posts: 157
 

Is your name James?

My, it must get REALLY COLD in the New York area! 

We never leave our heat ON over night...  If it's cold in the morning, we just turn it on...  What kind of stove do you have??  Wood burning?   Have to keep 'feeding' it to stay at a certain temp. range?

I'm about to tackle a simple WX station...

Planning on using an OLED display...  All readings will be 3 digits... (we NEVER get to below zero F) showing Day Hi/Lows... (Inside/Outside)...   n Day Aves.,   Selectable F/C temps...  Also, beings we do not A/C, in the summer when the Inside temp gets higher that 92-93 area, sound off an Alarm telling us to Turn Off all computers...  and Sound-OFF  when it's OK to turn them back on!  Hope to have an OLED display large enough for everything...  If not, will probably auto switch from 1-2 screens.

Gathering all of the parts now...  Remote wireless outside point for  Temp. &  Humidity only...  being collected every n seconds...  Master Inside point will collect the Remote data when it's ready and attach Master  time to data.  Sound-OFF alarm when Remote unit stops sending data...  requiring Battery attention. 

Questions:

1.  Is there a simple way to determine Battery status and Alert Battery changes BEFORE it goes dead?)

2.  Is there a way to Input data from keyboard as each char. is being typed WITHOUT having to WAIT for a Return Key?   Like the Basic instruction:  A$=INKEY$.  If the K/B is pressed, it automatically is recognized and input WITHOUT stopping the computer waiting for more data and a Return key.

For Example:

I want to just push "F",  "f", "C", or "c" and get it when pushed to control Temp display in F or C.

I've been playing with this  without any success...

To change system settings like:

#days for Averages...  F/C select... Read cycle seconds... etc. etc.

I want to recognize ESC (27), Return (13), etc. to take various actions.

Thank you in advance...

ps:

Is there Avatar Max. size where if exceeded, nothing happens? If so, what is it?

This post was modified 5 years ago by JoeLyddon

Have Fun,
Joe Lyddon

www.woodworkstuff.net


   
ReplyQuote
Page 6 / 8