Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Help me understand arrays?
Page 2 of 2 | |||||
Author | Message | ||||
MOBI Guru Joined: 02/12/2012 Location: AustraliaPosts: 819 |
Jeez, did you get a kit!!! Gutsy - how's your eyesight? Do you have to solder the PIC on too? Or are you just going to change the 10uF cap that's already on the board. Maybe I misunderstood. Doing a bit of that lately. David M. |
||||
Raros Regular Member Joined: 06/02/2012 Location: ItalyPosts: 55 |
Hi I also had the need to store the names of files of a directory in string variables. Considering that I could get about 200 files was impossible to dimension a variable of 200 elements. I solved whereas a file name can be up to 12 characters, storing them in a sequence of 12 characters, and added to the names of files less than 12 characters so many CHR$(0) up to 12. For each dimension, you can store 21 names of files. In addition, this program prints the names of files in the top of the screen in horizontal sequence of six char in five lines (needed to Micro MMPaint). This is simple code: '****** esempio ********** 'f$ = DIR$("*.*", FILE) 'DO WHILE f$ <> "" ' PRINT f$ ' f$ = DIR$() 'LOOP '************************* Cls t = 0:tx = t:t3 = t:TextX = 0:TextY = 0 dim tx$(10) ' tx$(10) = max 220 files ' for one dimension = 240 character. ' max name file = 8+1+3=12 ' 240 character/12 = 20 name-file fake$ = string$(8,0) ' fake$ = 8 x CHR$(0) null Input "Type file: ";A$ Line(0,0)-(480,60),0,BF f$ = Dir$("*."+A$, file) Do While f$ <> "" fnlen = 12 - Len(f$) ' for filename with less than of 12 char: filename + fake$ = 12 char tx$(tx) = tx$(tx)+f$+Left$(fake$,fnlen) t = t+1:if t > 19 then t=0:tx=tx+1 t1 = t3\20:t2 = 1+((t3-(t1*20))*12) Print @(TextX,TextY)mid$(tx$(t1),t2,12) ' print file in sequence horizzontal ' 20 files x dimension TextX = TextX + 80 If TextX > 400 Then TextX = 0:TextY = TextY + 12 If TextX = 400 And TextY = 48 Then TextX = 0:TextY = 60 If TextY > 48 Then Print CLR$(4,0) @(400,48,2)" Press Key " Do While Inkey$ = "":Loop TextY = 0 Line(0,0)-(480,60),0,BF EndIf t3 = t3+1 f$ = Dir$() Loop Print @(2,80)"Numero files = "t3 End Raros |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9307 |
The Altronics kit has the PIC32 pre-installed, so I don't have to solder it, which is nice. Oddly, they DON'T pre-install the tiny 0805 10uF ceramic cap. 0805 is smaller then I like to go - 1206 is about as small as I like to go. 0805 is so small, that they are very fiddly to handle, and you need a VERY steady hand to solder them. Also, being so small and light, if you literally breath out through your mouth, you can blow the cap off location, if you have not yet soldered it. You DEFINITELY need a magnifying glass thing for 0805 parts. I still use a magnifying glass thing(illuminated, on a stalk) for the larger 1206 and 1210 parts - just makes it easier on your eyes, at the end of the day. Odd that Altronics did not have this cap fitted at the same time as they fitted the PIC32... Smoke makes things work. When the smoke gets out, it stops! |
||||
CircuitGizmos Guru Joined: 08/09/2011 Location: United StatesPosts: 1425 |
This is why the CGCOLORMAX isn't a kit. I had hoped that the CGCOLORMAX would have made it to you first. Oh well. Micromites and Maximites! - Beginning Maximite |
||||
MOBI Guru Joined: 02/12/2012 Location: AustraliaPosts: 819 |
Hi Graeme, Have you had a read of Geoff's article on his web site re soldering smd? If not, there is a link to a clip showing how to hand solder smd and TQFP ICs. Taught me a trick or two. I now do it quite confidently. Solder wick a must have. David M. |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9307 |
Don't worry CG - it won't be far away, and I suspect I will just use yours, as I am a bit busy these days, and I have to assemble the Altronics one, whereas yours... In fact, I am kinda in favor of assembled boards when SMD is involved. That way, you can guarantee that it will work out of the box due to quality control at the factory, whereas home-brew can often blow it's bottle tops... Many people are very good at soldering SMD, but by the same token, many people are not. As I mentioned in another thread somewhere - SMD are not very forgiving at all, to the wrong way of doing it. Through-hole parts are much more resilient, and can take lots of heat, and repeated attempts to get the joint right. SMD don't like you to take more then one attempt, maybe two, then you can either have ruined the part from heat, or damaged the tiny PCB lands from heat. I am lucky that I have done some SMD, so know what is involved, but even with that in mind, I try to avoid it as much as I can! Smoke makes things work. When the smoke gets out, it stops! |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9307 |
Yep, and several vids on YouTube which are very good too. Soldering them in is not as much of a challenge as removing them - damn near impossible with the QFP type IC's such as the PIC32, so you get it right first time, or you get yourself another board and start again! Well, I am having a bit of a giggle there - it is not THAT drastic, but it is very hard to remove QFP's. There are the professional heat-guns that fire hot air right on the pins, all at the same time, making removal easy, but who has those toys in their toolbox? (rhetorical) There is also that low-heat solder stuff, that stays liquid much longer then normal solder, which can be used to allow removal of the IC, but I still think this is too much flippin' work, if you can outright replace. I guess this comes from my running a business - if it ain't a quick and easy fix, biff it and get a new one, and get on with the rest of the day. EDIT: I don't like solder wick on SMD - ANY SMD. It is just too easy to overheat the part or the pad while trying to heat the wick, and moving the wick can lift SMD pads and bend the tiny pins on QFP. Perhaps I just need more practice in this respect... Smoke makes things work. When the smoke gets out, it stops! |
||||
shoebuckle Senior Member Joined: 21/01/2012 Location: AustraliaPosts: 189 |
Just out of curiosity, I ran this small program to find out if there is a limit to the size of a numeric array. There is; when you run out of memory!! On my original MM it stopped at DIM b(21247) with "Error: Not enough memory". Do
a=a+1 Dim b(a) b(a)=10 Print a; Erase b Loop The program dynamically allocates the array b(a), puts something in it then erases it ready for the next iteration. (ERASE recovers the space previously allocated.) If I change the array to a string, it stops at b$(330). Thought you might like to know! Hugh |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9307 |
Cool - thanks. Smoke makes things work. When the smoke gets out, it stops! |
||||
MOBI Guru Joined: 02/12/2012 Location: AustraliaPosts: 819 |
I found that plenty of flux and a clean hot iron works well, but yes, you have to be quick and careful. EDIT: it becomes a problem when some mongrel uses adhesive between the IC and the PCB. > shoebuckle That is handy information - now tucked away in my list of MM programming notes. Thanks David M. |
||||
Page 2 of 2 |
Print this page |