#avr | Logs for 2013-06-18

Back
[04:54:56] <beaky> hello
[05:05:18] <beaky> is it possible to dynamically change the clock rate of an avr?
[05:05:28] <beaky> while it is running
[05:06:37] <Roklobsta> ummm, yeah
[05:06:52] <Roklobsta> it's static, remember, you can do what you like up to 16MHz
[05:11:08] <beaky> ah :(
[05:12:48] <RikusW> beaky: look at the CLKPR register
[05:12:58] <beaky> ah I will research that tahnks
[05:13:00] <beaky> tahnks*
[05:13:03] <beaky> thanks*
[05:13:08] <RikusW> heh
[05:13:20] <RikusW> *ehe :-P
[06:00:58] <RikusW> google -> llvm c++ to javascript
[06:01:00] <RikusW> this is nuts
[06:08:28] <vectory> i heard its used in production, even
[06:16:11] <beaky> javascript is the asm of the web
[06:16:51] <beaky> now that js execution speed is approaching the speed of light thanks to v8...
[06:22:51] <vectory> yeah, not really ;)
[06:27:30] <RikusW> even full FPS games use that :-P
[06:47:49] <inflex> lo folk
[06:48:29] <beaky> hello
[07:08:27] <specing> RikusW: lua is what most FPS games use
[07:08:58] <RikusW> specing: build a lua to JS llvm then :-P
[07:09:08] <specing> what for?
[07:44:21] <braincracker> beaky <= http://www.silabs.com/Support%20Documents/TechnicalDocs/si570.pdf
[07:45:45] <beaky> wow
[07:45:47] <beaky> awesome
[07:46:03] <beaky> programmabl crystal oscillator
[07:49:17] <braincracker> http://www.silabs.com/products/clocksoscillators/pages/default.aspx
[07:49:25] <braincracker> yea they use it in radios
[07:49:46] <braincracker> also, xmega, and altera fpgas has pll too
[07:53:20] <beaky> atxmega
[07:53:29] <beaky> the worlds most advanced 8-bit uC
[07:53:51] <beaky> or am I mistaken (or watched too much atmel marketing)?
[07:55:25] <tzanger> heh
[07:55:32] <tzanger> what makes it hte world's most advanced?
[07:55:50] <tzanger> PICs have PLLs, hell ATTINY has a PLL
[07:55:57] <braincracker> http://www.silabs.com/Support%20Documents/TechnicalDocs/si510-11.pdf
[07:56:18] <braincracker> what frequencies do you overclock your atxmegas? :)
[07:56:37] <braincracker> ds says pll output should not exceed 200MHz
[07:57:17] <tzanger> overclocking is for kids. it's a neat party trick but of pretty much zero value for anything practical
[08:04:25] <theBear> tzanger, he just likes generalizing things he doesn't understand, for some reason
[08:04:35] <tzanger> theBear: not really, no
[08:04:46] <theBear> tzanger, yes, that is what beaky does
[08:05:07] <theBear> and re: 20 mins ago, every pc you've probably ever used has a programmable/adjustable oscillator
[08:05:12] <tzanger> I played that game and thoroughly enjoyed it for a while. the old BP6 hacks were awesome. taping out the multiplier bits on the celerons (slot A)... fun stuff.
[08:05:14] <theBear> you being beaky
[08:05:36] <tzanger> I never said programmable oscillators aren't useful. they're incredibly useful
[08:05:51] <tzanger> I said overclocking is a parlour trick
[08:06:15] <tzanger> it's kind of like souping up an engine. it's a LOT of fun
[08:06:27] <tzanger> pushing boundaries, trying new things, etc.
[08:06:38] <theBear> i aint talking about you !
[08:06:38] <braincracker> yo h4x0riz3d
[08:06:56] <theBear> which part of "what beaky does" and "you being beaky" didn't you understand, dammit !
[08:07:07] <tzanger> theBear: ah, I read "tzanger, he just ..." as you talking ot the room about something I said
[08:07:09] <theBear> and i never said they aren't useful
[08:07:16] * tzanger shuts the hell up and drinks more coffee
[08:07:21] <braincracker> tzanger <= i like souping up things, an electric motor does not care 3x power surge during acceleration.
[08:07:35] <theBear> tzanger, comma means i'm talking to you, see, like this :)
[08:07:49] <tzanger> braincracker: actually an electric motor *does* -- I spent 13 years in industrial power electronics design specifically for AC motors
[08:08:04] <tzanger> I designed a few soft starters and VFDs during that time
[08:08:14] <tzanger> theBear: heh
[08:08:42] <tzanger> the nice thing about electric motors is that they'll TAKE all the current you throw at them and try to accelerate the load a LOT more nicely than any engine
[08:09:16] <jvm_> hi. i may not run an atmega328 at 3.3V with more than 8mhz? i used an atmega8 at 3.3v with > 16 mhz in the past...
[08:09:19] <tzanger> but your stator windings will take a beating (thermal), as will the rotor bars, and the bearings might not like you for too long
[08:09:20] <jvm_> was it bad?
[08:09:24] <braincracker> tzanger <= why should it care? as long as winding don't fuse...
[08:09:41] <tzanger> and in the case of DC motors the brushes aren't reall happy with large currents
[08:10:01] <tzanger> braincracker: well as long as you're adequately cooling them you won't care. I loved industrial power
[08:11:06] <tzanger> my very first design was a PIC16C74A driving a power stack for a SCR-based soft starter. I started when I was 19 and the project went to market just before I turned 21. Ended up being about 60% fo the company's sales.
[08:11:15] <braincracker> nothing fancy, i was just thinking about some extra acceleration for an electric vehicle, the temperature ofc should be limited.
[08:11:23] <tzanger> it wasn't the world's awesomest thing but it worked pretty damn good if I do say so myslef
[08:11:30] <tzanger> I still have the breadboard (!) prototype around somewhere
[08:11:35] <theBear> jvm_, the datasheet tells you what will definately work, what might work, and might appear to work but screw up at random and annoying times (see murphy law) is what isn't mentioned in the datasheet
[08:12:02] <theBear> jvm_, and of course there are always manufacturing tolerances... consider that a 12mhz rated chip might just be a 20mhz that didn't pass testing
[08:12:22] <tzanger> it was nice because Microchip seemed to be in lock-step with my design needs. when I ran out of room on the 74A they introduced the 77. when I ran out of room on the 77 they came out with the F877
[08:12:52] <tzanger> that thing was written entirely in assembly, ran at 8MHz. I profiled it once, I think it went about 190 instructions before hitting an interrupt of some kind or another
[08:13:11] <tzanger> also learned a hell of a lot on that design about theoretical implementation and how you really do things
[08:13:32] <theBear> heh, how thoughtful of them
[08:13:58] <braincracker> ;/ 35C in the shade
[08:14:02] <tzanger> e.g. "the design can't do that" vs "now that I've been onsite, I understand that the design will do $x under circumstance $y, and I've worked around it."
[08:18:24] <braincracker> feeling like in the desert
[08:19:59] <tzanger> 35C is pretty fucking hot
[08:20:23] <tzanger> especially in the shade, you step out into a sunbeam and go all vampire.... instant burn
[08:20:58] <jvm_> thanks theBear, i found it
[08:23:35] <theBear> pfft ! i can swim and surf on 45c days and not get burnt, but i am special, hot country AND dark skin (for someone here anyway)
[08:23:43] <beaky> what is the difference between the ATmega series and the ATtiny series?
[08:23:52] <theBear> specifications
[08:23:54] <theBear> look them up
[08:23:59] <theBear> atmel parametric selectey table
[08:24:01] <tzanger> beaky: grab the product family brochures and compare
[08:24:05] <theBear> try reading for once !
[08:24:05] <beaky> ah
[08:24:43] <beaky> wow the ATtiny stuff seems nice
[08:25:52] <beaky> they have fewer peripherals and are mor compact
[08:25:56] <theBear> it's awesome !
[08:25:57] <braincracker> looking at google map, i like the weather in LA and San Diego now, so all the serial killers and drug dealers go to mexico?
[08:36:08] <beaky> besides avr-gcc and CodeVision avr, what other avr implementations are there
[08:36:38] <braincracker> i am fine with gcc
[08:56:15] <RikusW> http://fabiensanglard.net/prince_of_persia/index.php
[09:11:37] <theBear> they aint implementations, they are compilers... and there are a few, but avr-gcc is the only good one i seen...
[09:25:37] <specing> "avr-gcc is the only good"
[09:25:39] <specing> lol
[09:25:41] <specing> LOL
[09:25:52] <specing> "avr-gcc"
[09:25:54] <specing> "good"
[09:26:01] * specing rolls on the floor
[09:26:15] <braincracker> specing <= what do you use ?
[09:26:35] <braincracker> anythin better ?
[09:29:42] <vectory> asm, obviousky
[09:29:53] <vectory> -k+l
[09:31:05] <vectory> fabien sanglard is quite famous, i've been confronted with his blog in three different forums. shmup-dev.com <3
[09:31:20] <vectory> him or his blog
[09:36:53] <specing> braincracker: avr-gcc C for non-critical stuff and gcc inline assembly for critical sections
[09:37:08] <specing> but its built-in assembler is ugly
[09:42:00] * RikusW agrees on the ugly _asm {
[09:45:00] <beaky> ah
[09:45:19] <beaky> I wanna learn avr asm, I had a situation where it owuld help
[09:45:25] <beaky> but I can't find good tutorials :(
[09:47:15] <specing> it is arcane black magic
[09:47:33] <specing> you need to be a level 9001 wizard to have that skill
[09:48:08] <beaky> I am a lowly hedge wizard
[09:48:19] <specing> you are not a wizard at all.
[09:48:21] <beaky> who only uses arduino
[09:48:22] <beaky> ah
[09:52:30] <vectory> e.g. m8 ds is full of asm examples
[10:08:43] <braincracker> specing <= so you use shit then
[10:09:06] <braincracker> and i agree you can't use the inline asm poroperly
[10:09:38] <GuShH> specially when you can't even type "properly"
[10:09:46] <braincracker> try -masm=intel
[10:10:34] <braincracker> beaky <= http://www.atmel.com/Images/doc0856.pdf
[10:10:49] <braincracker> AVR Instruction Set
[10:11:32] <specing> braincracker: yip
[10:11:39] <specing> nothing better atm
[10:11:55] <braincracker> you still have to define clobber list, because that's how C works.
[10:11:58] <specing> though I have migrated to ARMs and I can tell you that arm-gcc kicks ass!
[10:12:29] <specing> < braincracker> try -masm=intel
[10:12:43] <specing> style is not a problem
[10:13:03] <specing> it is the GCC C <-> asm interface that sucks
[10:17:02] <braincracker> that is shit because gcc is a c compiler, and it even does optimizations
[10:17:34] <braincracker> does whatever in asm that looks best
[11:24:40] <ColdKeyboard> On ATMega8, after the ADC interrupt, which flags/register I need to clear/set to start another conversion? I've set ADC in free-run mode with ADCSRA |= (1<<ADFR); and in interrupt I do ADCSRA |= (1<<ADSC); after every interrupt (from inside the interrupt)
[11:33:06] <ColdKeyboard> I've adde a line that lights up LED or shuts it down when ADC is higher than 10. When I connect ADC0 to VCC the LED lights UP and stays UP even if I connect it to GND. I have to reset the MCU and it seems like ADC goes only once and then stops...
[11:35:25] <ColdKeyboard> Anyone has idea why?
[11:40:56] <RikusW> braincracker: its 15C indoors here
[11:41:40] <RikusW> and my CPU is idling at 17C :-D
[11:41:52] <RikusW> its max today was 25C
[11:41:58] <RikusW> Intel G2020
[11:46:12] <ColdKeyboard> Can anyone help me with my problem? :\
[14:01:41] <cart_man> Hey Guys...how do you convert INTS to Strings in Atmel STudio 6?
[14:12:16] <cart_man> RikusW: Hi. How do you usually convert String to Int in C/AS6 compiler ?
[14:12:35] <RikusW> itoa
[14:12:38] <RikusW> snprintf
[14:12:50] <RikusW> err
[14:12:53] <RikusW> atoi
[14:13:03] <RikusW> sscanf
[14:13:03] <cart_man> I thought snprintf was for printing on the PC only?
[14:13:06] <cart_man> whow O.o
[14:13:07] <cart_man> ok
[14:13:24] <RikusW> my fault, read it wrong way round ;)
[14:13:37] <abcminiuser> printf outputs to the standard output stream
[14:13:40] <abcminiuser> sprintf outputs to a buffer
[14:13:54] <RikusW> use sn no s...
[14:14:00] <RikusW> s is unsafe...
[14:14:00] <abcminiuser> Indeed
[14:14:08] <abcminiuser> But all options will be larger than atoi
[14:14:15] <abcminiuser> itoa rather
[14:14:21] <RikusW> atoi
[14:14:27] <RikusW> he wants string to int
[14:14:58] <RikusW> cart_man: it seems you asked both ways ? you're confusing us :-P
[14:15:20] <cart_man> haha sorry Yea just saw :S I meant from an Integer to a String .
[14:15:46] <cart_man> I use strtol for string to Int and now I have to take it back after calculation
[14:15:51] <RikusW> snprintf(buf,size,"%i",int);
[14:15:58] <RikusW> or just atoi
[14:16:35] <RikusW> ltostr ? does that even exist ? ...
[14:17:18] <RikusW> just got hold of www.reyax.com/Module/GPS/UP501/LOCUS_Manual.pdf‎
[14:17:31] <RikusW> seems its applicable to the PA6H GPS too :)
[14:17:36] <cart_man> Well actually im not even really sure if that works because I havent seen an output of it yet
[14:17:37] <RikusW> same MT3339 chip
[14:45:49] <cart_man> Turns out I was Disconnected all this time :(
[14:46:05] <cart_man> II came to the conclusion that strtol does indeed not work :(
[14:46:45] <RikusW> atoi
[14:46:48] <cart_man> IntVar = atoi( CharVar[0] + CharVar[1] ) would that work?
[14:46:56] <RikusW> read atoi docs
[14:47:08] <cart_man> hmmm ok
[14:47:25] <RikusW> seems it will
[14:47:41] <RikusW> atoi wants a char *
[14:48:00] <cart_man> Ohh ok I see
[14:48:32] <RikusW> megal0maniac: got the package yet ?
[14:49:12] <cart_man> Ill just do them separately and then multiply with 10
[14:49:31] <RikusW> you only want 2 chars ?
[14:49:59] <RikusW> i = ((c1-'0') * 10) + c0-'0';
[14:50:08] <RikusW> the quick dirty way :-P
[14:58:19] <megal0maniac> RikusW: Nah, still at the hub
[14:58:34] <RikusW> wonder whats taking them so long
[14:58:38] <megal0maniac> Looks like the Arduino Uno can't handle dwen either :P
[14:58:47] <megal0maniac> Luckily it's a DIP chip in a socket
[14:58:53] <RikusW> did you enable it again ?
[14:59:09] <RikusW> its the capacitor on the reset line that disables the signal
[14:59:24] <megal0maniac> I did. But I knew I could take it out
[14:59:44] <RikusW> remove the cap and it will work, but will break bootloading
[14:59:45] <megal0maniac> Yeah. Annoying that you can't debug an Arduino. But I guess you're not supposed to.
[15:00:08] <RikusW> dtr-> cap -> rst
[15:01:05] <cart_man> RikusW: Dude What the hell?? WHy does your code always work O.o .. now what does the -'0' do to the String?
[15:01:06] <RikusW> megal0maniac: the U2S works nicely for turning off DWEN :)
[15:01:36] <RikusW> cart_man: its simple
[15:01:47] <RikusW> '0' = 0x30 ascii
[15:01:49] <megal0maniac> I know :)
[15:01:56] <megal0maniac> I see what you did now
[15:01:58] <RikusW> so 0x30 - 0x30 = 0
[15:02:07] <RikusW> 0x31 = '1'
[15:02:12] <RikusW> 0x39 = '9'
[15:02:17] <HappyPonyLand> hey, I managed to get a PCD8544 working
[15:02:20] <HappyPonyLand> without blowing it up
[15:02:41] <RikusW> cart_man: if you do pass a string containing letters it will blow up :-P
[15:02:44] <megal0maniac> It's just a serial string you send to the reset line which temporarily turns it off
[15:02:51] <RikusW> and give a way wrong number
[15:02:58] <cart_man> Ohh ok I see that way mkaing the compiler convert it for you by - a 0x30 whhich does nothingg?
[15:03:14] <RikusW> megal0maniac: actually just 0x06
[15:03:30] <RikusW> getting the right baud is the tricky part
[15:03:48] <cart_man> any other usefull fast dirty ways of going the other way?
[15:03:50] <RikusW> after reset goes low to high 0x55 is sent from the avr
[15:04:11] <RikusW> atoi if it exists
[15:04:18] <RikusW> on your system that is
[15:04:41] <megal0maniac> I'm amazed that more people haven't dug into this
[15:04:54] <RikusW> itoa...
[15:05:06] <RikusW> itoa(buffer,number,10);
[15:05:29] <RikusW> or was it itoa(number,buffer,10); ?...
[15:05:47] <twnqx> ... itoa?
[15:05:52] <cart_man> ok so let me quickly get this traight... 0x06 is the INTEGER 6 AND 0x36 is the ASCII 6 ? - by 0x030 gives 0x06
[15:05:53] <twnqx> not even in glibc :S
[15:05:58] <RikusW> it exists in windows code
[15:06:15] <braincracker> b
[15:06:28] <RikusW> cart_man: yes
[15:06:40] <cart_man> Hahahah thats awesome !
[15:06:46] <RikusW> look up the ascii table
[15:06:51] <cart_man> why would I ever do it any other way O.o
[15:06:58] <RikusW> 0x41 = A and 0x61 = a
[15:07:41] <RikusW> you'll probably want to convert it in a loop and check that the char is '0' to '9'
[15:07:45] <megal0maniac> Hmmm... If you set a pin as an input and enable the pull-up, you can power an LED (dimly) without using a resistor
[15:07:56] <megal0maniac> But I'm probably going to get slapped for doing that :P
[15:08:16] <RikusW> just don't set DDR=1.....
[15:08:32] <RikusW> then it will be __bright__
[15:08:36] <RikusW> for a while...
[15:08:54] <megal0maniac> :D
[15:09:01] <megal0maniac> But with DDR=0 it will be dim
[15:09:02] <RikusW> megal0maniac: so I repaired the telkom line myself :-P
[15:09:04] <megal0maniac> forever
[15:09:16] <megal0maniac> There was a fault on your side?
[15:09:23] <RikusW> yes
[15:09:28] <megal0maniac> I thought Telkom just didn't have their shit together
[15:09:35] <megal0maniac> We've had issues too
[15:09:35] <RikusW> well, on the actual telkom wires
[15:09:44] <RikusW> outside the apartment
[15:10:12] <RikusW> our line goes through a temporary wire, its been 18 months now...
[15:10:26] <RikusW> temp of > a year :-P
[15:10:28] <RikusW> *for
[15:10:37] <megal0maniac> Sounds about right
[15:10:46] <RikusW> I shorted the other end and got 8k
[15:11:07] <RikusW> the line was so noisy you couldn't even talk on the phone
[15:11:07] <megal0maniac> Is it naughty to abuse the internal pull-up like this?
[15:11:13] <RikusW> I guess not
[15:11:26] <RikusW> but its naughty to mess with telkom lines :-P
[15:11:42] <RikusW> so there was two pairs in the temp wires
[15:11:54] <RikusW> turned out the other pair was unused
[15:12:07] <RikusW> but.... one of its wires was broken too
[15:12:21] <RikusW> fortunately for me 2 of the 4 wires was still ok
[15:12:33] <RikusW> measures 13 Ohm now :)
[15:12:34] <cart_man> Oh Telkom
[15:12:46] <RikusW> and ADSL working fine again :) :)
[15:12:55] <cart_man> My lines been intermittent for roughly 9 months now
[15:13:20] <RikusW> the fun part is I sent a notice to Telkom before I got the idea to have a look for myself...
[15:13:20] <megal0maniac> So no wonder ADSL didn't want to sync
[15:13:31] <megal0maniac> Haha :)
[15:13:32] <RikusW> so the tech got here this morning..... :-P
[15:13:41] <RikusW> had to tell him I repaired it :-D
[15:13:57] <RikusW> back in the old days I'd have gotten a TALK...
[15:14:49] <RikusW> cart_man: if you pick up the phone can you hear noise ?
[15:16:29] <megal0maniac> Mine is lovely and clear
[15:16:37] <megal0maniac> But every now and then sync disappears
[15:16:44] <cart_man> RikusW: No I dont think its a noise issue its been like this ever since the tree fell onto my car
[15:16:56] <megal0maniac> The other day we got a phone call and the caller ID showed our number :/
[15:17:10] <cart_man> if the wind goes just a little the Unsyncing is immediate
[15:17:26] <RikusW> cart_man: my guess, metal fatigue on the lines
[15:17:36] <RikusW> its above ground to the pole ?
[15:17:52] <cart_man> RikusW: Yip
[15:18:09] <cart_man> megal0maniac: Lol Id get out ...that place is haunted
[15:18:14] <RikusW> telkom should replace that part of the line....
[15:19:19] <RikusW> char *_itoa( int value, char *string, int radix ); //in MSVC++
[15:19:22] <cart_man> RikusW: Ahh well about 3 months ago I had a huge fight with them and the day after they phoned me back and told me that they tested the line and the test concluded that it was fine and theres no noise...I told her Well NO SHIT theres no noises on the lyne because thats not the problem.
[15:19:43] <cart_man> Then she just told me that if theres no noise then its not her problem...her job is to get a dial tone
[15:19:44] <RikusW> part of <stdlib.h>
[15:19:46] <cart_man> >.<
[15:22:47] <cart_man> line`
[15:22:47] <RikusW> out problems started about 2 months ago
[15:22:47] <RikusW> it became intermittent
[15:22:47] <RikusW> when the tech came he found nothing wrong
[15:22:47] <RikusW> later that day the problem appeared again :S
[15:22:47] <megal0maniac> Because Telkom techs aren't techs again
[15:22:47] <megal0maniac> *aren't techs at all
[15:22:47] <RikusW> seems the cold got something to do with it
[15:22:47] <RikusW> its worse in the evenings
[15:22:47] <megal0maniac> Temperature affects conductivity
[15:22:47] <RikusW> I guess we'll do a better job than most of them, if given the docs...
[15:22:47] <braincracker> RikusW <= :P where are you? arctic?
[15:22:47] <RikusW> also, cold cause stuff to shrink, opening cracks in the wire
[15:22:47] <RikusW> braincracker: South African
[15:22:47] <RikusW> 15C in my room now...
[15:22:47] <RikusW> pretty much 15C all day
[15:22:51] <megal0maniac> A Telkom "tech" diagnosed an ADSL router as faulty because the one he used to test worked fine on the same line. All that had happened was some kid had pushed the reset button and restored factory defaults
[15:23:23] <cart_man> Ahh no way !
[15:23:23] <megal0maniac> I'd sold the router to the people so they called me in. Wasn't exactly difficult to find the actual problem
[15:23:42] <RikusW> heh
[15:23:56] <megal0maniac> braincracker: I'm also in ZA. And it's pretty nice weather here :)
[15:24:00] <cart_man> I have the problem of DCing when downloading anything above 40Kbps
[15:24:08] <cart_man> I can hear the routers relay go off
[15:24:11] <megal0maniac> Oh lol
[15:24:20] <megal0maniac> Your router has a relay. You need a new router
[15:24:28] <megal0maniac> Transistors are the way forward
[15:24:35] <cart_man> hahaha yea Its an old ADSL 1 Mweb router
[15:24:54] <braincracker> RikusW <= lol, isn't there even hotter in africa?
[15:25:04] <cart_man> sometimes
[15:25:05] <braincracker> i saw 36-42C on google maps
[15:25:08] <megal0maniac> braincracker: Africa is a continent...
[15:25:12] <RikusW> braincracker: it get -10C in winter where I live
[15:25:49] <cart_man> RikusW: Yea Standerton use to get -4
[15:25:49] <megal0maniac> And it never goes below 0C here, and I'm in the same country
[15:25:49] <RikusW> very close to Lesotho
[15:25:57] <cart_man> Well Belarus gets -40 !
[15:26:10] <RikusW> megal0maniac: temperature is better down in the Cape, but the wind is not :-P
[15:26:22] <cart_man> Everyday they have people going by all the older peoples homes to check if theyre still ok
[15:26:23] <megal0maniac> The wind was kuk today
[15:26:41] <cart_man> Just to clarify Belarus is near Russia
[15:26:57] <RikusW> in 1988 the wind lifted an entire roof off a house in Bredasdorp
[15:27:09] <RikusW> I saw it lying in the street
[15:27:13] <RikusW> it also blew over a brick wall
[15:27:14] <megal0maniac> That probably happened today
[15:27:30] <megal0maniac> Shacks are houses too
[15:27:38] <RikusW> megal0maniac: s/u/a :-P
[15:28:28] <RikusW> megal0maniac: last year there was a tornado close to where I live (like 30km)
[15:28:38] <RikusW> it destroyed a house
[15:29:58] <megal0maniac> I'm English. Whatever :)
[15:30:07] <cart_man> Is it possible for a function to return 2 values separately ?
[15:30:15] <RikusW> not really
[15:30:21] <RikusW> but you can cheat and use pointers
[15:30:28] <RikusW> or references
[15:30:39] <cart_man> the very word pointers strike fear into me :(
[15:30:41] <RikusW> func(int *p, int &ref)
[15:30:49] <Tom_itx> they're quite common here
[15:30:51] <RikusW> easy to use actually
[15:31:20] <megal0maniac> Difficult to grasp
[15:31:25] <RikusW> func(&value,value2) { *value = 5; value2 = 1; }
[15:31:28] <megal0maniac> Or more difficult than other concepts
[15:31:36] <RikusW> not really
[15:31:45] <RikusW> depends on who explains it to you
[15:32:00] <RikusW> a pointer is just an address to a memory location
[15:32:38] <RikusW> very useful once you get used to them
[15:33:30] <megal0maniac> So I've heard. But nobody I've spoken to seems to get it :P
[15:33:34] <megal0maniac> Me included
[15:33:50] <megal0maniac> Note how cart_man has run away
[15:34:11] <cart_man> Lol no im here :)
[15:35:00] <cart_man> ive tried to explain them to myself in C++ using Cout and it confused me really bad.
[15:35:12] <RikusW> &variable gives you the pointer (address of) to the memory location
[15:35:16] <twnqx> > cout
[15:35:19] <twnqx> > pointers
[15:35:22] <twnqx> wtf?
[15:35:27] <cart_man> Although in my test I knew how to use them but didnt program for a long long time
[15:35:30] <RikusW> *pointer gives out the value stored at that location
[15:36:32] <RikusW> cart_man: you could use a pointer to access IO port on the AVR if you wanted to :-P
[15:37:00] <cart_man> Hmmm im interested already
[15:37:12] <megal0maniac> And why would you use a pointer instead of referencing the actual variable
[15:37:26] <twnqx> size.
[15:37:39] <twnqx> especially if you have structs or the like
[15:37:40] <RikusW> megal0maniac: PORTB is a pointer actually :-P
[15:37:54] <megal0maniac> Don't confuse my tiny brain
[15:37:59] <twnqx> or pass a variable to a function, and allow the function to modify it
[15:38:09] <twnqx> instead of just returning a value
[15:40:20] <cart_man> RikusW: And everyone else....heres my little Int <= 99 to char converter function http://pastebin.com/iApqDh1z
[15:41:07] <cart_man> havent tested it yet but I do believe the +'0' will hold true as -'0' one does
[15:42:00] <cart_man> Well im going to have to study C indepth anyway this semester cause I really want to be able to code it. So im going to have to face my fears.
[15:45:18] <cart_man> Lol it seems my code only works for multiples of 11 >.<
[15:49:08] <cart_man> Did I single handedly kill this conversation?
[15:49:55] <RikusW> no
[15:50:08] <megal0maniac> yes
[15:50:13] <megal0maniac> congratulations
[15:50:32] <twnqx> step one: look for a fast /10 algorithm
[15:50:46] <twnqx> step two: use your +'0' approach
[15:55:10] <RikusW> cart_man: char Buf[2]; !! 2 !!
[15:55:10] <twnqx> ugh lol
[15:55:10] <twnqx> no terminating 0?
[15:55:11] <cart_man> Wouldnt I only need 2 spaces Buf[0] and Buf[1] ?
[15:55:11] <twnqx> strings in C are 0_terminated (binary 0)
[15:55:11] <twnqx> you always need another byte for that
[15:55:11] <Tom_itx> 0_0
[15:55:12] <RikusW> buf[3] then :-D
[15:55:12] <twnqx> and writing the 0
[15:55:12] <RikusW> cart_man: char buf[2] allows -> buf[0] buf[1] buf[2]
[15:55:17] <RikusW> err
[15:55:30] <RikusW> char buf [3]
[15:55:57] <RikusW> remember you start counting at 0 and the char buf[3] has 3 chars
[15:56:13] <RikusW> (off by one mistake :-P )
[15:56:47] <RikusW> and you do want buf[2] = 0;
[15:57:02] <RikusW> and returning buf is BAD !!!
[15:57:10] <cart_man> :(
[15:57:29] <RikusW> after returning, calling another function will overwrite that ram...
[15:57:44] <RikusW> since returning "frees" buf...
[15:58:04] <RikusW> this is not javascript :-P
[15:58:12] <cart_man> Should I rather return buf[1]
[15:58:29] <RikusW> the actual char will be better yes
[15:58:50] <cart_man> and in make another function to return buf[2]
[15:59:55] <cart_man> Ok soo 0 in buf[0] is a must haveand also buf[2] = 0 is a bad idea ...
[16:03:08] <cart_man> One of them seems to be working fine now :)
[16:09:32] <cart_man> YAAAAY its working flawlessly !
[16:19:45] <RikusW> http://www.gpsbabel.org/
[16:21:11] <RikusW> http://www.gtop-tech.com/en/product/MT3339_GPS_Module_04.html
[16:40:07] <Essobi> WEEEEEE.
[16:56:27] <Essobi> whatup
[17:06:53] <RikusW> the sky ;)
[17:25:13] <cart_man> RikusW: Good night
[17:25:19] <cart_man> megal0maniac: Good night
[17:25:20] <RikusW> good night
[17:25:24] <cart_man> Thanks for all the help :)
[17:25:28] <RikusW> good morning rather ?
[17:25:34] <RikusW> pleasure
[17:25:38] <cart_man> lol yea
[17:26:15] <Essobi> RikusW: How you been?
[17:26:21] <megal0maniac> Bye!
[17:26:42] <RikusW> busy developing gps tracker code
[17:26:49] <RikusW> still busy actually
[17:28:01] <RikusW> Messed around with Google Earth lately.
[17:28:57] <RikusW> Essobi: and I've got ADSL now :)
[17:29:05] <Essobi> Nice!
[17:29:09] <RikusW> 4MBit
[17:29:55] <Essobi> Woooo
[17:30:41] <RikusW> line was flaky lately
[17:30:54] <RikusW> telco techs couldn't find the fault...
[17:31:00] <RikusW> so I did :-P
[17:32:02] <RikusW> Essobi: so you've not been around much on IRC lately ?
[17:32:17] <Essobi> No sir.
[17:32:23] <Essobi> Been overcommited lately.
[17:32:36] <Essobi> Trying to get my hustle up in the infosec industry.
[17:32:44] <Essobi> Been hitting the CTF challenges hard.
[17:32:46] <RikusW> infosec ?
[17:32:52] <Essobi> Information Security
[17:33:15] <RikusW> CTF ?
[17:33:43] <Essobi> http://captf.com/practice-ctf/
[17:33:49] <Essobi> hacker Capture the flag.
[17:36:01] <RikusW> nice site !
[17:45:01] <megal0maniac> I blame Telkom!
[17:45:04] <megal0maniac> Goodnight all
[18:56:21] <Horologium> company I work for is looking for 2 copier techs in iowa.