Show Posts
Pages: [1] 2 3 ... 82
1  Using Arduino / General Electronics / Re: Reverse mounting tactile switches on: November 17, 2013, 06:57:16 pm
Maybe try the GreaseMonkey plug-in for firefox.. and the Digikey script..??

it really helps put things at your fingertips..with pics..etc..

http://hackaday.com/2013/08/06/making-digi-key-much-much-prettier/
http://eewiki.net/display/Motley/advancedsearch+Greasemonkey+Userscript+for+Digikey.com
https://www.sparkfun.com/news/355


I have looked at reverse mounted SMD LEDS before... (but never for switches.. so I'll be curious to see what you find/come up with)..

also.. a problem "I" faced (with the reverse LEDS stuff)  was:

1.) how to make the HOLE/window/cut 'legally' with the design rules?  to mount the LED (part)?  usually need to be 'xx' away from any edge.. parts not covering/outside of the PCB outline..etc.

post back on any reverse mount switches you DO find.




2  Using Arduino / Project Guidance / Re: Fall sensor on: November 03, 2013, 10:12:16 am
first...
(and I know this isnt easy.)... I think you need to work on your English a bit.. or at least go back and re-read what you typed, its hard to decipher all the things your saying correctly.

MY suggestion is to do this in STEPS.. (small steps)..


1.) get an Arduino
2.) get your accelerometer/fall sensor of choice
3.) connect them together..
4.) keep your USB cable plugged into the computer
5.) output the accelerometer data to the serial monitor.


once you get that far.. come back.

Also be ready to post a list of the data you require:

angle
velocity
(eventually GPS coords?)


and because you want some sort of visual representation in the way of graphics...  I would look into using PROCESSING to take your streamed data and make 'graphics' for it.

however for you.. your first steps of getting Arduino hooked up correctly.. and the accelerometer connected, working and outputting values/data is crucial.


3  Using Arduino / Project Guidance / Re: Fall sensor on: November 02, 2013, 07:21:13 pm
I agree with PaulS..

I wont comment on your approach or the values/data you need...

but start simple (as suggested)...
by using the serial monitor in the Arduino IDE....  if you are getting the values/data you think...

and you 'are' in fact triggers events/functions based on those values...

then you can worry about transmitting the data OUT to other applications..

Im not familiar with GPS or any of the shields...etc.... but..   Im going to assume, that one of the 'triggers' that happens when a 'fall event' has been detected... is to grab the local GPS coords.. and send them out to the C# app?... yes?  (along with whatever other data you want to pass on..name/age/address of person who fell?)


the part I'm missing is (maybe read to fast?)...  was HOW are you connecting your/this C# app/platform to......  anything?

the 'fall sensor' product.. will need to be stand alone....yes?  *(around the neck or whatever)*  and have to power it self, have the sensor connected to do constant reads/checks., have a way to pass/communicate this data OUT of the product/project... and ONTO its final destination?  (C# app?)

how is this C# app going to get any sort if data sent to it?
some sort of Wi-Fi? RF? Bluetooth? module?... on BOTH ends?  the C3 end.. and on the Arduino/Fall product end?

explain how you see this working?






4  Using Arduino / Project Guidance / Re: Failed to pass board_qc using UNO with USB Host Shield 2.0 on: November 02, 2013, 07:07:35 pm
ditto...


at the top.. did you miss this part:

GPIO test. Connect GPIN0 to GPOUT7, GPIN1 to GPOUT6, and so on
Test failed. Value written: 00 Value read: FF
Press any key to continue...
GPIO test passed.


although I'm not clear on what test actually failed.. as the GPIO test seems to 'pass' right after it?

5  Using Arduino / Audio / Re: bit stream / bit bash low quality audio out single pin? on: November 02, 2013, 06:59:06 pm
Maybe look at the SimpleSDAudio library?


uses PWM for audio output.. reads a 'file'  (cant recall the format,.... .asf perhaps?) from the SD card... and plays it back through 1 (PWM) pin.. pin 9 I believe it is...


however that is the barebones... not sure if that will be LOUD enough for you with any sort of amp?

I used it for a very generic/minimal spiderman webshooter pcb/project.. where space was EXTREMELY limited...
worked fine.. but not very loud (although loud enough for that purpose)  smiley


6  Using Arduino / General Electronics / Re: Who can identify Chinese led color names please? on: November 02, 2013, 06:51:04 pm
fungus for the win!  smiley

nice job!
7  Using Arduino / Project Guidance / Re: Project help (MAX7219) related... (connecting/dis-connecting from main project) on: October 21, 2013, 07:27:50 pm
haha.. no worries bud!  smiley

I just figured since you were already sorta familiar with the project....  you might have spotted something quicker  smiley-wink

Thanks for the link!  I'll check it out (all the articles/posts the better)  <-- I just have a fine line between being able to use some of the advice and just 'reading it'..lol..  sometimes you need a nice foundation to use some of the advice here.. and sometimes it comes with some nice background for noobs.

When I got some free time.. I'd like to also try and try edit/alter that lib so that the initialization code is wrapped in function and much easier to call/access..

(I'm still abit confused as to why the DEFAULT scan limit of 7 works initially if the chips are connected/chained upon initial power-up...  but when (I guess) initialized by itself.. the second chip 'needed' a scanLimit of 4 for all leds to light up again and work/display correctly...  from what I understand..having a scanLimit of 7 should NOT have hindered anything even if was purposefully done......no?)

anyways... I'll shoot the latest copy.. (although outside of a few code clean-up edits (elsewhere).. they are very close..

but still I'll send it..  always open to feedback/suggestions (when I can apply/understand them!)  LOL..

I understand/agree..it is better (or would be nicer) to have a lower level access to things, and be writing my own code/libraries instead of being dependent on 'front ends' to do the same things....

Im just not really at that point yet.. (getting closer maybe?)  smiley..

and from what I gathered.. the library was doing sorta the same thing..(pre-defining registers...doing the open/close latch..send data..etc for me/us)........  (just not doing the initialization correctly from what it looks like..to make it easy to re-initialize things)

it helps beginners be able to 'do things'...  but I also understand that learning that basic SPI process IS important.. (and something I admit I dont fully get yet...a little bit.. but when I start seeing things being defined like: 0xFF..my brain shuts off a little bit each time!) 

the more time I spend around reading other posts.. and walking through my own projects.. (just submersing myself in this).. things will click and become 'common' knowledge/terminology..etc..

thanks!



8  Using Arduino / Project Guidance / Re: Project help (MAX7219) related... (connecting/dis-connecting from main project) on: October 21, 2013, 09:03:56 am
lol..

well yeah the 'begin' function is what I would have wanted to do.. and thats in fact what I have been working toward, (and posted on help working toward) smiley

** first time I had ever looked into a library.. (not even sure of the differences between the .h & .cpp file?.. or why there is 2 files to begin with?)

thanks for the link(s)!


9  Using Arduino / Project Guidance / Re: Project help (MAX7219) related... (connecting/dis-connecting from main project) on: October 20, 2013, 11:51:43 pm
hi Nick Gammon-

not it does use HARDWARE SPI pins.. you can define any you like..

I have to guess.. because I have never really written a library before.. and not experienced with all the private vs. public stuff..

however,.. I 'DID" in fact do exactly that before posting.. make the spiTransfer() public.....and go about trying to mirror the setup data being set during the constructor part..

in that end that how I stumbled upon the setScanLimit() function.. setting it back to 7 (like it does on default)...gave me the initial results of only the first group of 8 leds working/lighting up..
thinking I only had 4 'sections' of leds on the bargraph.. I set the scan limit to 4..  (things worked)..

so I removed everything.. and just set the scan limit through the LedControl library (before I wasnt..because it was set by the constructor)

so after deleting everything I had altered from the original code.. and used the LedControl function to set the scan limit to 4.. and I again was left with working code..  smiley    (sweet!)

So in the end.. all I need was to change the scanLimit to 4 on the second max chip/pcb..  smiley

Question:
Why dont you like the constructor part of the code in the library?  (just trying to learn)
10  Using Arduino / Project Guidance / Re: Project help (MAX7219) related... (connecting/dis-connecting from main project) on: October 20, 2013, 11:32:38 pm
hey gang-

wanted to update the thread..

I have 'solved' it...
and it is now working..

apparently.. I didnt need the SPI lib.. or any direct data dumps to reset anything..

I didnt need to loop through ALL (both) chips...

I didnt need to re-create/define the instance constructor..

when I was getting the first group of 8 leds to light up only...
I went back to that very first iteration of code..... where I was just doing this:

Code:
lc.setIntensity(1,15);
    lc.clearDisplay(1);
    lc.shutdown(1,false);   

when the pcb/max chip was being re-inserted to the main circuit...

after a bunch of playing around.. messing with the library..looking at its init routine..

I added one line and change its value..

Code:
lc.setScanLimit(1,4);



so now I just have this:
Code:
lc.setScanLimit(1,4);
lc.setIntensity(1,15);
lc.clearDisplay(1);
lc.shutdown(1,false);
 

and its working great so far.. rock solid...

Im not sure in the beginning I read it defaults scan limit to 7..(and it works fine)....
but I need to define it scanLimit 4 to work?  (I mean I only have 4 'sections'....but setting it to 7 should still work)....
I mean I dont set the 3-digit 7-segment display/max chip to scan limit 3? or anythign but default 7 (which means I dont set it at all..just defaults to 7 internally in the library)

anyways.. figured I'd post and share..

thanks for the time and the attention..  (not sure how this slipped by!)  smiley

setting it back to 7..(or not at all)..gives me the results of only the first group of 8 leds being turned back on)


11  Using Arduino / Project Guidance / Re: Project help (MAX7219) related... (connecting/dis-connecting from main project) on: October 20, 2013, 07:38:53 pm
as far as it using SPI..

I believe so..

link to lib in playground
http://playground.arduino.cc/Main/LedControl

but back in post #18:
http://forum.arduino.cc//index.php?topic=193834.msg1434936#msg1434936

I posted some snippets from its library.. when looking into how it creates it class instances..etc..


so lets go back and see what Im doing/did wrong in adding in Nicks snippet of code?

12  Using Arduino / Project Guidance / Re: Project help (MAX7219) related... (connecting/dis-connecting from main project) on: October 20, 2013, 07:31:13 pm
Granted that you have the right pin assignments, I think Nick is suggesting that you use your current code, but insert his initialisation code rather then attempting the re-instantiation.  You will of course need to refresh the displays immediately afterward, but the annoying "library" will not notice the extra code.


yeah..thats what Im currently trying/attempting to do.. however.. its either not working.. (or more likely....I'm not implementing it correctly?)

I have outlined above what I tried.. (using his lines of code...  still un clear on how you separate/target the individual chips though through his approach?)



also.. to be more clear.. i made a quick video:

http://youtu.be/lUDkUbdgFDY


it shows how it works.. inotially then when disconnecting/re-inserting.. you see only the initial 8 leds light back up..

then I change the line of code.... (re-doing the constructor line..even though I think we all think that should need to be done)..

and you see all the leds in the bragraph light back up upon re-inserting.. but then after a few fire button presses.. you see it free/die.

here is YT link:

http://youtu.be/lUDkUbdgFDY
13  Using Arduino / Project Guidance / Re: Project help (MAX7219) related... (connecting/dis-connecting from main project) on: October 20, 2013, 05:30:26 pm
what do you mean by independent?

like not having the LedControl libray imported/used during this 'test'..?

that was the plan..  but I have a fairly big sketch.. to trim down and add this to work with the current hardware set-up..etc.

or we you saying import the SPI library..in my current sketch/project..

and then try those lines where I need to re-initialize?  (worth a shot either way I guess) smiley

I added this to my current sketch:
Code:
#include <SPI.h>

const byte MAX7219_REG_NOOP        = 0x0;
// codes 1 to 8 are digit positions 1 to 8
const byte MAX7219_REG_DECODEMODE  = 0x9;
const byte MAX7219_REG_INTENSITY   = 0xA;
const byte MAX7219_REG_SCANLIMIT   = 0xB;
const byte MAX7219_REG_SHUTDOWN    = 0xC;
const byte MAX7219_REG_DISPLAYTEST = 0xF;

void sendByte (const byte reg, const byte data){   
  digitalWrite (SS, LOW);
  SPI.transfer (reg);
  SPI.transfer (data);
  digitalWrite (SS, HIGH);
}  // end of sendByte


and then where was initializing before.. I commented that out and added this;

Code:
sendByte (MAX7219_REG_SCANLIMIT, 4);      // show 4 digits
      sendByte (MAX7219_REG_DECODEMODE, 0xFF);  // use digits    ---> (not bit patterns) the 3-digit display with use 'digits'..but thebargraph will use bit/binary patterns?
      sendByte (MAX7219_REG_DISPLAYTEST, 0);    // no display test
      sendByte (MAX7219_REG_INTENSITY, 15);      // character intensity: range: 0 to 15
      sendByte (MAX7219_REG_SHUTDOWN, 1);       // not in shutdown mode (ie. start it up)
      /*
      delay(loadDelay);
      //LedControl lc=LedControl(3, 6, 5, 2); //scab board (2 max chips)
      //Initialize MAX7219/7221 chip(s)
      byte devices=lc.getDeviceCount();
      //we have to init all devices in a loop
      for(byte address=0;address<devices;address++) {
        //The MAX72XX is in power-saving mode on startup
        lc.shutdown(address,false);
        //Set the brightness to a medium values
        lc.setIntensity(address,15);
        //and clear the display
        //lc.clearDisplay(address);
      }
      */


however.. Im a bit confused.. as I dnt see how i am just targetting the second chip?

and if re-initializing BOTH of them.. some defaults need to be different? how to target?

3-digit display will take

I use it (using the LedControl library like so)
breaking down my current ammoCount variable.. and sending it to each 'digit' to the correct 7-segment display (its a 3 digit in one housing 7-segment display, controlled by MAX CHIP #1)
Code:
void updateDisplay(){
  //split main ammo count into separate digits
  int dig1 = ammoCount / 100 % 10;//3 on start 
  int dig2 = ammoCount / 10 % 10;//0 on start
  int dig3 = ammoCount % 10; //0 on start
  lc.setDigit(0, 0, dig1, false);
  lc.setDigit(0, 1, dig2, false);
  lc.setDigit(0, 2, dig3, false); 
};

maybe I'll just try this line:

 sendByte (MAX7219_REG_SHUTDOWN, 1);       // not in shutdown mode (ie. start it up)

how do I use the NO_OP to target the correct chip?

but I dont understand how its much different than doing the same with the library?

Im trying.  but its not doing anything to the bargraph pcb/chip..when I get the trigger its been inserted.. I do a sendByte()..to shutdown = false..  but still is all blanked out..and I cant update it?
14  Using Arduino / Project Guidance / Re: Project help (MAX7219) related... (connecting/dis-connecting from main project) on: October 20, 2013, 04:59:44 pm
I too can 'drive' both chips...

at least when I initially boot up.  (maybe that wasnt clear)..

if I power-up the project with BOTH max chips connected  (the first max chip/pc b is ALWAYS connected to be clear)..
it works... until I need to disconnected the second pcb... and the re-connect it.

(this is to simulate a magazine/clip in a sci-fi blaster..if that helps put some visual to the physical connection/events..being pulled..and re-inserted to 'reload' the bargraph)..

if I power up with BOTH connected, it works... until the 'bargaph' is depleted..and essentially needs to be pulled and re-inserted.

once that happens..
(regardless of if I initialize BOTH or just the SECOND one)...

if JUST initialize (shutdown = false, making it read to accept data, turns it on)...  only the first group of 8 work.

if I re-create the constructor it breaks.


I guess if nobody has any suggestions.. I'll and try to use SPI lib...

having my large, multidimensional BINARY array in PROGMEM helps...

and might not be too hard to pass over tot he chip using SPI..??   (right?)  lol..

but Im not sure how I can easily convert the 3-digit display function over that easily..

I guess its worth a shot.. and I can probably get better help using SPI transfers than the LedControl library?

if anyone can still save me the trouble of converting things.. (please) chime in!  lol..

otherwise... I guess I'll see about converting.. or better yet, probably trying a test.. to see if it even initializes correct using the SPI library.. being inserted/re-inserted..while the first chip never loses power..etc..
15  Using Arduino / Project Guidance / Re: Project help (MAX7219) related... (connecting/dis-connecting from main project) on: October 20, 2013, 03:20:48 pm
Quick summary:
* using the LedControl library
* 2- MAX chips (chained)  (they are actually two physical/separate pcb's)..
* the 'second' MAX chip/pcb gets (physically) removed and re-inserted back into the running circuit/code

I need to re-initialize the 'second' MAX chip again, once it is connected back into the circuit.. (more specific, since they are chained I have been re-initializing them both.  Targeting both or just the second chip, to shutdown = false; has made no difference, I have been sticking with going through both chips as that is what I initially in the sketch upon power-up)

Problem:

the second MAX chip/pcb is not behaving correctly upon re-inserting into the circuit.

I end up with 1 of two outcomes/scenarios:
a.) only the FIRST GROUP of 8 leds (DIG0 / SEGDP-G)... turns back on/displays & updates correctly (rest of the 30 leds are turned off)
b.) the bargraph does turn fully on and 'respond'..  (but sometimes immediately or after a couple of seconds,.. or few triggered events (button presses/fire) ...the project freezes, resets, audio and/or serial output stops when Im watching the code flow/execution)



-----------------------[detailed info below]-------------------------------



I can purposefully command results A or B by commenting out one line... but before that..

here is how I set up the chips when the project gets power..
Code:
LedControl lc=LedControl(3, 6, 5, 2); //scab board (2 max chips)

and then in the setup() loop...
Code:
byte devices=lc.getDeviceCount();
//we have to init all devices in a loop
for(byte address=0;address<devices;address++) {
/*The MAX72XX is in power-saving mode on startup*/
lc.shutdown(address,false);
/* Set the brightness to a medium values */
lc.setIntensity(address,15);
/* and clear the display */
lc.clearDisplay(address);
}


normal stuff.. and in no way a problem.. (just background info)..


however.. (as noted) the problem is when I take the pcb (chip) out of the rest of the circuit, and re-insert it.
I must obviously re-initialize the second chip (once it has gained power..etc).. because they start in shutdown mode..etc..

so I have stable code that tells me when the 'pcb/chip' has been re-inserted.. (because I am using another pin/switch to inform me when the pcb (connector/plug) connection has been made...(works fine.. letting you know I have a 'trigger' that tells me when to try and initialize that second chip again)


So when I get this 'trigger' letting me know I can attempt to re-initialize the second MAX chip and send it some data.....

I have tried this:

targetting ONLY the second chip by device ID (1)
Code:
lc.shutdown(1,false);
lc.setIntensity(1,15);
lc.clearDisplay(1);      

and this: (thinking maybe I needed to re-initialize BOTH chips again being as they are daisy chained together)
Code:
byte devices=lc.getDeviceCount();
//we have to init all devices in a loop
for(byte address=0;address<devices;address++) {
/*The MAX72XX is in power-saving mode on startup*/
lc.shutdown(address,false);
/* Set the brightness to a medium values */
lc.setIntensity(address,15);
/* and clear the display */
//lc.clearDisplay(address); <-- do not clear out address 0/3-digit display
}

doing EITHER of the two approaches above yields the follow results:

* the bargraph ONLY has the first 8 leds of the 30 total lit up/or displaying the correct 'amount' (as this is a counter)
* rest of the 'code/sketch' is stable.. does NOT freeze, reset, loose audio or serial output

if I pull the pcb/chip and re-insert again.... (only that first group of 8 leds is back on/responsive)
thinking maybe not enough time for power up >> sending re-initialization code attempts.. I have thrown delays in there to debunk this. (waiting seconds even to try and re-initialize and send new data to it,...again only first smiley-cool


If I add this line:

Code:
LedControl lc=LedControl(3, 6, 5, 2); //scab board (2 max chips)


as in

Code:
LedControl lc=LedControl(3, 6, 5, 2); //scab board (2 max chips)
byte devices=lc.getDeviceCount();
//we have to init all devices in a loop
for(byte address=0;address<devices;address++) {
/*The MAX72XX is in power-saving mode on startup*/
lc.shutdown(address,false);
/* Set the brightness to a medium values */
lc.setIntensity(address,15);
/* and clear the display */
//lc.clearDisplay(address); <-- do not clear out address 0/3-digit display
}

or

Code:
LedControl lc=LedControl(3, 6, 5, 2); //scab board (2 max chips)
lc.shutdown(1,false);
lc.setIntensity(1,15);
lc.clearDisplay(1);    


the bargraph DOES all light back up (fully).. or correctly display the right amount..
but then either immediately.. freezes,, or when you press a button it resets, stop audio/serial output..etc..

it makes sens that I WOULDNT have to re-create the class/instance/constructor...

but if NOT there.. then the rest of the leds are not 'working'..

adding it obviously is NOT just overwriting the old one..and leading to a RAM problem?

hope that helps explain the issue.

thanks.

Pages: [1] 2 3 ... 82