#robotics Logs

Feb 11 2013

#robotics Calendar


00:07 GargantuaSauce and if so can you tell me if it is useful or a bag of dicks or both
00:07 rue_shop2 Yet Another ??
00:07 GargantuaSauce robot platform
00:07 rue_shop2 ah
00:08 rue_shop2 what are you looking for?
00:09 GargantuaSauce was just perusing the robot-related packages provided by my package manager and saw it and read the presentation and it looks interesting
00:10 rue_shop2 no idea
00:10 rue_shop2 I have problms with generic libraries
00:15 GargantuaSauce its design seems to abhor the concept of embedded computing...guess it's not what i'm looking for
00:19 RifRaf ah they your gnome friends rue?
00:22 rue_shop2 :) I'm sorry rifraf, you know of this we differ
00:22 rue_shop2 MY EXPERIANCE is that to get somone elses code to work properly takes me just as long as making my own, and at the end of making my own, i have less bugs than with other peopels code
00:25 RifRaf only because you live in the 90's computer wise rue
00:25 RifRaf there is this new program called windows that just seems to work
00:27 Jak_o_Shadows You're stupid if you don't consder library's, but rue's right some of the time.
00:27 RifRaf took me matter of seconds to download install start using it
00:27 Jak_o_Shadows also, screw most linuxes. Or, more accurately, screw broadcom with a hammer.
00:27 RifRaf Jak_o_Shadows i know, i intent to learn the hard stuff
00:28 RifRaf but will give up before then if i don't make stuff along the way
00:41 GargantuaSauce i think windows is pretty painful to develop in
00:42 Jak_o_Shadows1 it is.
00:43 Jak_o_Shadows1 Except when the toolchain isn't provided for linux, but it is for windows
00:44 rue_shop2 gee, I' havn't even been up 12 hours today and I'm tired
00:44 GargantuaSauce wellll the exception to that exception is the existence of a foss alternative toolchain
00:45 rue_shop2 RifRaf, what was your solution to get around the memory problem, larger chip or other?
00:45 GargantuaSauce i mean the mcu i'm developing for lately has no vendor support for development outside windows
00:45 GargantuaSauce but gcc-arm works fine
00:46 Jak_o_Shadows1 GargantuaSauce, I can program in linux, but only reliably connect via software uart in windows with the official toolchain.
00:46 Jak_o_Shadows1 Given that i like rapid iterations, it's not so much fun.
00:46 GargantuaSauce tried openocd?
00:47 GargantuaSauce it seems to have pretty damn broad support
00:49 RifRaf rue_shop2 to stay under 16k for now, and upgrade to nano 328p when it arrives
00:50 RifRaf looks like i'll get to go home before i thought, maybe an hour
00:55 RifRaf i have no issues yet in win, used to have more dramas in loonix, i still use linux though, it has a strong place still in my systems
00:55 RifRaf but for a pc i work on 10 hours a day windows 7 suits me fine
00:56 Jak_o_Shadows1 windows 7 is reasonably nice, it's a pity you can't shift+right-click to get powershell open, instead of command window
00:56 GargantuaSauce personally, nothing made me hate windows more than developing for it as well as in it
00:58 GargantuaSauce i made a thing that had image data pass from directshow to directx and save to disk in realtime
00:58 GargantuaSauce and it made me angry :V
00:59 rue_house windows, is ok if you reinstall it every year
00:59 rue_house and its only what, $100 per seat?
00:59 GargantuaSauce for a gimped version
00:59 rue_house $50/year for an os isn't too bad I suppose
01:00 GargantuaSauce all in all i feel the worst part is not being in control
01:00 rue_house the viruses and the ads bother me most
01:01 rue_house I dont like living in paranoia of clicking on the wrong link, or having a slow computer for 10 hours while a program checks every nook and cranny for something that installed itself without me knowing
01:02 Jak_o_Shadows1 The lack of support on some basic things bother me.
01:02 Jak_o_Shadows1 dual screen
01:02 rue_house windows dosn't do dual screen?
01:03 rue_house I'm finding that dual isn't enough for me
01:03 Jak_o_Shadows1 oh, it does dual screen, but taskbars and stuff
01:03 rue_house I need to get my other pci slot clear and go to tripple head
01:03 GargantuaSauce don't bother with a pci gpu
01:03 rue_house I'm not gaming
01:04 rue_house I need the extra desktop space
01:04 GargantuaSauce but you have desktop compositing on
01:04 rue_house ?
01:04 GargantuaSauce hardware UI acceleration
01:07 rue_house hmm, dont remember how I cnfigured it
01:08 GargantuaSauce if your shit is windows7-shiny you have it on
01:08 GargantuaSauce and it kind of sucks with it off
01:08 rue_house Im using linux
01:09 GargantuaSauce oh hurr
01:09 rue_house I dont use windows
01:09 rue_house I hate it
01:09 rue_house tooo many ads
01:09 GargantuaSauce i have no idea how x handles multiple gpus
01:09 rue_house I dont like the os always second-guessing me
01:09 rue_house linux does what I ask it to, even when I'm wrong
01:10 GargantuaSauce ya every time something breaks it's because i broke it
01:10 GargantuaSauce well...most times :)
01:10 rue_house the wood I put into the boiler all turned into coals at once, this will be scarry
01:14 Jak_o_Shadows1 Through with linux, why did most distros decide that package managers like synaptic were suddenly bad?
01:15 joga hm?
01:15 Jak_o_Shadows1 Ubuntu includes ubuntu software centre as default, sabayon has rigo, which are both equally useless.
01:16 Jak_o_Shadows1 Synaptic, or yumex, are good, simplified stuff is bad.
01:16 joga I guess they're just trying to make it seem friendlier for some or so. but of course you don't have to use them and they'll be just apt-getting stuff in the background anyway
01:16 GargantuaSauce i am not even going to try and comment on canonical's choices
01:17 GargantuaSauce ubuntu is going in the wrong direction if you ask me
01:17 Jak_o_Shadows1 They are simpler to use, but you can't even search properly.
01:18 Jak_o_Shadows1 Yes, i agree, it's just a pity they still have good compatibility. I'd never run anything from them but a LTS though
01:18 GargantuaSauce I use arch and I think it's a good balance
01:19 Jak_o_Shadows1 I would've liked arch, but didn't boot on my laptop. Tried sabayon, didn't lke my graphics on my laptop. Tried opensuse, and I had trouble with wifi (which i had in all, only solvable by official drivers).
01:19 joga on "desktop use" machines I run ubuntu mostly but I don't ever use the default bloaty desktop and assorted programs
01:19 Jak_o_Shadows1 I tend to xfce. I have enlightenment 17 on my netbook for showing off to windows friends
01:19 joga apt-get install lxdm notion uzbl mupdf wicd and a laptop from 2004 works lightning fast
01:19 rue_house I do almost everything command line anyhow
01:19 rue_house apt-get
01:19 joga me too
01:20 GargantuaSauce the only situation i've had significant hardware compatibility issues was when i stuck arch on an imac
01:20 GargantuaSauce that was a little bit....masochistic
01:22 GargantuaSauce oh and i put a freebsd-based router distro on a cheap pc i built to use it as a NAT and the damn thing didn't come with a compiler
01:22 GargantuaSauce who the hell builds a distribution with no build environment?!
01:26 rue_house who radomly changes the name of the program their developing
01:26 rue_house I'm f****** gonna call it gqview, nomatter whta it is
01:27 rue_house qcad is now called librecad
01:28 Jak_o_Shadows1 nothing wrong with the name qcad
01:28 rue_house I should start a program to help people track the names of their fav apps
01:28 GargantuaSauce probably because naming something after the ui toolkit is kind of dumb
01:29 GargantuaSauce unless it's under the same project umbrella
01:29 Jak_o_Shadows1 Yeah, but qcad is a traditionally stupid CAD name. It fits perfectly.
01:30 Jak_o_Shadows1 On the topic of CAD, freecad looks promising, but it needs tutorials like hell.
01:33 GargantuaSauce the ui of every cad package i've seen makes me want to jump out a window
01:33 Jak_o_Shadows1 Haha, ever used blender?
01:34 GargantuaSauce in that context i must revise that statement to describe a considerably more painful situation
01:35 Jak_o_Shadows1 I'd like to say they've made it better, but the main thing they've done is make it unusuable on non-widescreen monitors
01:36 GargantuaSauce oh yeah it has improved a bit
01:43 RifRaf yay am done, not to go home and work out the schedular
02:02 Ademan Is it likely that a 4-6v servo will "understand" 3v PWM on its control pin?
02:14 rue_house prolly
02:23 GargantuaSauce i am using 3v logic to drive mine
02:24 GargantuaSauce towerpro ones do work at least, havent tried other brands
02:37 Ademan GargantuaSauce: that's great to hear, thanks
02:40 GargantuaSauce make sure you use a separate power supply for the servos from that of the mcu and add filters/decoupling to its supply line
02:41 GargantuaSauce and/or i mean
02:41 GargantuaSauce because they produce pretty nasty amounts of electrical noise
02:42 RifRaf GargantuaSauce are you in AU too or just up late?
02:42 RifRaf !thislog
02:42 tobbor This one: http://rueshouse.dyndns.org:82/~ircjunk/irclogs/html/%23robotics-2013-02-11.html
02:42 GargantuaSauce i am in atlantic canada and it is 4:30am
02:42 RifRaf wow
02:42 GargantuaSauce and probably should have gone to bed hours ago
02:43 RifRaf just 7.30pm here
02:43 RifRaf and get to goto work late cause had to work back
02:48 RifRaf hrm so wats this codeacademy?
02:49 rue_house I was wondering, the program jester is taking sounds alot like yours
02:49 RifRaf rue_mohr the course i am doing is just reading and working the examples from 'The C Programming Language'
02:49 rue_house they almost stop the cource at if statements
02:49 rue_house book or online?
02:50 RifRaf by dennis richie
02:50 RifRaf pdf
02:50 RifRaf the dude
02:50 rue_house ok
02:50 rue_house so what has your preplexed on if statements
02:50 RifRaf rue shall i send you a copy so you know what page i am on etc
02:50 rue_house sure
02:50 RifRaf i got an if statement working
02:50 rue_house good show
02:51 RifRaf if(SWITCH_pressed(&button0)){ gaitRunnerPlay(&gait, 0, 5000, 30, 2); gaitRunnerProcess(&gait); }
02:51 rue_house ah
02:51 RifRaf now in the background i need to run a schelud task every 250ms that checks the sonar
02:52 rue_house :)
02:52 RifRaf that command plays the specified animation when i press button0
02:52 rue_house yup
02:52 rue_house the library prolly has a way to set up a timer to call a function for you
02:53 RifRaf yes wasa big step, but as soon as i get one thing done the next one is waiting
02:53 rue_house you start it at the program start and then every time it goes off you set it up again
02:53 RifRaf it has very cool ways apparently
02:53 RifRaf handles the timers well so is still easy to change your avr
02:54 RifRaf has its own timer.h thats already being included, so will not add much code
02:54 RifRaf size to the code
02:54 Trick tears his hair
02:55 MrTrick Okay... so many people here are C-ish?
02:55 RifRaf me :)
02:55 rue_house :)
02:55 rue_house ask
02:55 GargantuaSauce if you cut me, pointers spew forth from my arteries
02:55 MrTrick GargantuaSauce: segmentation fault
02:55 MrTrick I've built a little program that interrogates a serially connected heart monitor, and pushes the heart rate to a Phidgets webservice.
02:56 rue_house you forgot to set your pointer to NULL after the free()
02:56 rue_house ?
02:56 GargantuaSauce or about a dozen other things
02:56 MrTrick It runs on a little phidgets SBC
02:56 rue_house that was my last error
02:56 MrTrick it's *meant* to be a set-and-forget service.
02:56 rue_house k
02:56 MrTrick However... *foreshadowing*
02:56 rue_house its mallocing someting?
02:57 MrTrick no, the segfault reference was to GargantuaSauce's comment about his arteries.
02:57 rue_house ah
02:57 GargantuaSauce ok good because i wasnt looking forward to proxy debugging
02:57 MrTrick For some reason, it can't *use* the serial port unless I've opened it first in minicom!
02:57 rue_house baud rate
02:57 rue_house handshaking
02:57 MrTrick the settings reported by `stty -F /dev/ttyUSB0` are the same before and after.
02:58 rue_house want my super-simple-serial library for linux?
02:58 MrTrick if it's bulletproof, yes please.
02:58 rue_house as long as its not a usb serial device, its ok
02:58 Trick looks up 3 lines
02:58 rue_house want to give it a try?
02:58 rue_house oh, heh, hmm
02:58 MrTrick What's the USB caveat?
02:59 rue_house nonstandard baud rates
02:59 MrTrick The thing is, I'm sure this is a solved problem.
02:59 rue_house like "115200"
02:59 rue_house serial under linux is EVIL
02:59 rue_house I dont know why
02:59 RifRaf thats standard is it not, am using it on these mega168's
02:59 MrTrick Send $IN to serial. Read back line. Pass to user function. Pause. Repeat.
03:00 rue_house RifRaf, linux has stupidity in the predefined rates
03:00 MrTrick I need it to be bulletproof - resume automatically if someone unplugs and replugs the device, or if the machine is rebooted.
03:00 rue_house remember how old-dos used to go up to 9600?
03:00 RifRaf yes i remeber having to use like 960o all the time
03:00 RifRaf heh how did that o get there
03:01 MrTrick (and yes, it is set up as a service, but it doesn't work too well if it doesn't function til you ssh in, run minicom, and restart the service)
03:01 rue_house hmm
03:01 rue_house 1 min...
03:01 rue_house I didn't put a test main() in the library
03:02 rue_house I dont know if this will make sense
03:03 rue_house http://eds.dyndns.org/~ircjunk/programming/c/ssls2.c
03:03 rue_house http://eds.dyndns.org/~ircjunk/programming/c/ssls2.h
03:03 rue_house the last change was that the custom baud rate didn't work with usb devices
03:03 rue_house but the only way to get higher than 9600 is to use custom...
03:04 rue_house oh you need
03:04 rue_house http://eds.dyndns.org/~ircjunk/programming/c/returnValues.h
03:04 rue_house with that
03:04 rue_house personal dependency
03:04 rue_house all my code uses return values from that file
03:06 MrTrick cool, interesting
03:06 MrTrick what's the notifier thread do?
03:06 rue_house you look at it and ask me questions
03:06 rue_house the idea is that it spawns a monitor thread and does a callback when data arrives
03:07 rue_house er, its not done yet
03:08 MrTrick heh, okay.
03:08 rue_house but it looks like the system that sets it up will work
03:09 rue_house SerStartNotifier(SSLS_t *this, void (*charHandler)(char*)) ;
03:09 rue_house er no
03:09 rue_house huh
03:09 RifRaf damn i been reading the c++ directions, maybe thats me prob
03:10 rue_house I'll find you an example of libary use
03:10 MrTrick okay
03:10 Trick has to disembark, back in a
03:11 rue_house SSLS_t serial;
03:11 rue_house SerInit(&serial);
03:11 rue_house if (SerOpen(&serial, "/dev/ttyUSB0", 9600) != OK) {
03:11 rue_house printf("ERROR OPENING SERIAL\n");
03:11 rue_house return 1;
03:11 rue_house }
03:12 rue_house exchange(&serial, &data, &count, 12000);
03:12 rue_house SerFini(&serial);
03:13 rue_house funny enough, prolly looks familar to your lib eh RifRaf ?
03:14 RifRaf well i am not so familiar with all the included files yet, cause they do just seem to work
03:15 RifRaf rue so this seems simple enough, there is only one command for the scheduler
03:15 RifRaf but where would i stick the example code? just in the main loop somewhere?
03:16 RifRaf http://webbot.org.uk/WebbotLibDocs/27187.html
03:22 RifRaf it does not compile becase of the * in, MyData * data
03:44 Tom_itx that's a pointer
03:46 RifRaf so it needs some other value right?
03:47 RifRaf am trying to find examples but so hard
03:47 Tom_itx i'm not real good on pointers yet
03:47 Tom_itx and there are more than one command in the scheduler
03:47 RifRaf callback - The function to be called at a later date. This method must have the following parameters (void * data, TICK_COUNT lasttime, TICK_COUNT overflow).
03:48 Tom_itx passing thru i noticed at least 2
03:48 RifRaf yeah i know but all the commands are so simple once you get the syntax correct
03:49 Tom_itx look in your c book about pointers but it may be that to pass to *data you may use &data but i'm really not sure
03:49 RifRaf like i used to think the gaitRunnerPlay was so weird, but now it simple numbers and a name i understand
03:50 RifRaf gaitRunnerPlay(&gait, 0, 5000, 30, 2);
03:50 Tom_itx may i get the pdf?
03:50 Tom_itx i have the K&R book
03:50 Tom_itx 2nd edition
03:50 rue_house RifRaf, there is a thing called a function prototype
03:50 rue_house its not the same as how you call a function
03:50 Tom_itx rue_house, tell us about pointers
03:50 Tom_itx pls
03:51 rue_house when you prototype a functon, you specify the type for each variable
03:51 rue_house but when you call a function, you just specify what variable your sending to it
03:51 rue_house RifRaf, have devc++ ready?
03:52 Tom_itx rue_house, is *data a pointer?
03:52 Tom_itx how would i access that?
03:52 rue_house is it in a prototype or call :)
03:52 Tom_itx prototype
03:52 Tom_itx &data?
03:52 rue_house then you send it a pointer
03:52 Tom_itx see i get real confused on pointers
03:52 rue_house that is the address of the variable data
03:52 Tom_itx &data is address?
03:53 RifRaf rue_house yep is open
03:53 rue_house I get confused with pointers to pointers to arrays
03:53 Tom_itx and *data is data?
03:53 rue_house RifRaf, do this program, tell me if you think you need corrections
03:53 RifRaf ok
03:53 rue_house #include <stdio.h> int main(void) { printf("Hello world"); return 0; }
03:54 rue_house see that compies, get back to me right away
03:54 rue_house we will modify it once it works
03:54 Jak_o_Shadows2 I don't want to be annoying, but that looks fine. Horribly indented, but fine.
03:54 RifRaf 1:22 C:\Code\Dev-Cpp\junk\testing.cpp [Warning] extra tokens at end of #include directive
03:55 rue_house yup, you need to do a new line after the >
03:55 RifRaf you have an extra ) atthe end?
03:55 RifRaf oh
03:55 Tom_itx nice to have the same book on disk now
03:56 rue_house http://paste.debian.net/233285/
03:56 rue_house might look something like that
03:56 RifRaf compiles now
03:56 rue_house ok runs ok?
03:56 rue_house http://paste.debian.net/233286/ <-- that is a more readable form
03:57 rue_house you might have to run it from a dos widow so you can see the output
03:57 rue_house oh dear god, its 1:44am!
03:57 RifRaf Hello world
03:57 rue_house yup, ok
03:57 RifRaf rue ah you sure you are in canadia?
03:57 rue_house so, now we will create data with pointers!
03:58 RifRaf its also 5am there, must be big
03:58 Tom_itx int x = 1, y = 2, z[10];
03:58 Tom_itx int *ip; /* ip is a pointer to int */
03:58 rue_house http://paste.debian.net/233287/
03:58 Tom_itx ip = &x; /* ip now points to x */
03:58 Tom_itx y = *ip; /* y is now 1 */
03:58 Tom_itx *ip = 0; /* x is now 0 */
03:58 Tom_itx ip = &z[0]; /* ip now points to z[0] */
03:58 rue_house wow, hey tom?
03:58 Tom_itx you wouldn't answer me so i looked it up
03:58 rue_house rifraf, see what I added to that code
03:58 rue_house no fair, I'm making supper
03:59 rue_house I was gonna say its reasonable I'm dizzy cause it was 10 hours since I ate, but its not, its almost 14
03:59 rue_house RifRaf, tell me about what I added
03:59 RifRaf both look the same
03:59 RifRaf your paste and what you typed right?
03:59 rue_house http://paste.debian.net/233287/
04:00 RifRaf oh brb, thinking hat on
04:00 rue_house see the char * string; ?
04:00 RifRaf yes
04:01 RifRaf the output is the same, so what magis have you done?
04:01 RifRaf magic*
04:01 rue_house sorry, I'm going to change directions a bit, tom inadvertantly has a good point
04:01 RifRaf ok
04:01 rue_house I just created a variable, didn't even use it yet
04:02 rue_house I'm gonna change this
04:02 RifRaf ah, with a * i notice
04:02 rue_house http://paste.debian.net/233288/
04:02 rue_house ok, do this program, tell me if you understand it ok
04:02 RifRaf ok
04:03 rue_house it runs ok?
04:03 RifRaf you are printing an integer to the default output
04:03 Tom_itx how do you format %d?
04:03 RifRaf yes
04:03 Tom_itx for x.xx
04:03 RifRaf %d is int tom
04:03 Tom_itx i know
04:03 rue_house ok, and I'm using 42 as the number
04:03 RifRaf you want float
04:04 RifRaf &f2.2
04:04 Tom_itx why?
04:04 RifRaf to get a decimal point
04:04 rue_house %2.2f
04:04 rue_house :) but clse
04:04 rue_house ^ o
04:04 Tom_itx notice how big the hex gets when you use printf too
04:04 Tom_itx especially with float
04:04 RifRaf :)
04:04 rue_house ok, lets kinda stay on track
04:05 RifRaf yep rue that eg was clear
04:05 m_itx plops his arse in a recliner for a w
04:05 rue_house http://paste.debian.net/233289/
04:05 rue_house created a variable, it can be seen from anywhere because its not in a function
04:05 rue_house should still compile and run ok
04:05 Tom_itx oh and rue_house, does your mom know where you are? it's past your kerfew
04:06 RifRaf yes number is unused but works fine
04:06 rue_house ok
04:06 RifRaf 42 is still the answer
04:06 e_house whispers to RifRaf, I think tom has been in the sauce tonigh
04:06 RifRaf lol
04:06 Tom_itx not me
04:07 rue_house RifRaf, your turn, set the number to 42 in main
04:07 RifRaf ok
04:07 rue_house I'll let you paste the answer :)
04:07 rue_house I'm gonna go deal with supper cause I think its burning
04:07 Tom_itx let me know when the lesson on pointers arrives
04:08 rue_house your close
04:08 RifRaf yeah mine has been heating 3 times so far
04:08 rue_house heehhe
04:08 RifRaf http://paste.debian.net/233290/
04:09 rue_house not like that, set the variable IN the main function for me
04:09 RifRaf :(
04:09 rue_house that code creates it from the start with the value of 42
04:09 RifRaf ok
04:10 Tom_itx int number would be global too
04:10 Tom_itx not always desireable
04:10 rue_house yea, were gonna localize everything later
04:11 RifRaf http://paste.debian.net/233291/
04:11 rue_house yes and no
04:11 RifRaf hopefully thats what you meant
04:11 Tom_itx int number;
04:11 RifRaf yeah knew there was more to it
04:11 rue_house when you say int number; it creates the variable
04:11 Tom_itx number = 42'
04:11 Tom_itx ;
04:11 rue_house when you say number = 42; it will set the value of the number
04:11 rue_house you can set the value when you create it, but its not what I'm after this time
04:12 rue_house http://paste.debian.net/233292/
04:12 rue_house when you assign it, you dont have to specify what type it is
04:12 Tom_itx int number; allocates space in memory for the type int
04:12 RifRaf it does not like it if i take away the int bit tom
04:12 rue_house RifRaf, ^^
04:12 rue_house line 3 creates the variable
04:13 rue_house line 6 sets the value
04:13 RifRaf ok yep that works and can see how yo did it, just not why, will read on
04:14 rue_house its always good practise to create your variables at the start of your code and work with them later down, c++ makes everything a mess by creating variables and things all over
04:14 rue_house RifRaf, its like that beacuse of where I'm going with it :)
04:14 RifRaf yep i normally put em all up the top
04:14 Tom_itx then you gotta hunt to find em
04:14 rue_house ok, RifRaf modify the code, so that the printf prints the value of number, instead of just 42
04:14 RifRaf Tom_itx you just use simple i and stuff as variable in little loops i think
04:15 RifRaf didn't i do that?
04:15 RifRaf ok let me see
04:15 rue_house ah you had :)
04:15 RifRaf http://paste.debian.net/233294/
04:16 Tom_itx and he did it locally
04:16 Tom_itx instead of global
04:16 RifRaf did it both ways
04:16 RifRaf the first time was global
04:16 rue_house yes, ok
04:16 rue_house its global now, cause its created outside of main
04:16 RifRaf yep
04:17 rue_house now
04:17 rue_house http://paste.debian.net/233296/
04:17 rue_house tell me about my change
04:18 Tom_itx #define fourtytwo 42
04:18 Tom_itx :)
04:18 RifRaf you made othernumber that is not used yet, 3
04:18 rue_house right
04:19 rue_house now were gonna create a pointer
04:19 RifRaf oh cool :)
04:19 RifRaf Tom_itx wake up!
04:19 Tom_itx make it quick or i'll not wait up
04:19 rue_house http://paste.debian.net/233297/
04:19 rue_house ok, tell me what you know about line 5
04:20 Tom_itx who?
04:20 rue_house the one who is least likley to know
04:20 RifRaf hrm you made an unused pointed called * ?
04:20 RifRaf pointer*
04:21 Tom_itx and the number stored at pointer's address will be an integer
04:21 RifRaf that must be an int we tell it somehow?
04:21 rue_house see, all pointers are the same, they hold a memory location
04:21 RifRaf how would that be different though'
04:22 RifRaf so more than just a number?
04:22 rue_house the compiler needs to know what type of information is AT the memory location to keep the code straight
04:22 Tom_itx pointer becomes a placeholder address
04:22 Tom_itx and int tells it how big the house is
04:22 rue_house it holds a number, but hte number is the memory location, not a value
04:23 rue_house think of memory like an array of lockers
04:23 RifRaf and it chooses it somehow automatically?
04:23 rue_house we named three lockers
04:23 rue_house we nade a locker called number, big as an int
04:23 Jak_o_Shadows2 your not using it yet.
04:23 rue_house we made a locker called othernumber, big as an int
04:24 RifRaf k
04:24 rue_house and we made a locker called pointer, that is big enough to hold the locker NUMBER of an int
04:24 RifRaf yep ok, am with you
04:24 rue_house otherwise we havn't cared what locker numbers were using, cause we named them
04:25 rue_house when you create a pointer, it usually defaults to memory address 000000
04:25 RifRaf k
04:25 rue_house which your not allowed to read, cause its out of range of the memory the programs allowed to read
04:26 RifRaf this is where it gets scary
04:26 rue_house (thats where segfaults come from)
04:26 rue_house ok, what were gonna do, it make the pointer point to number
04:27 RifRaf an d iguess pointer == number; will not be enought?
04:28 rue_house in C there are two prefixes you can use that are used for specifying pointer stuff, if you want the memory location of a variable, you put a & infront of it
04:28 RifRaf ah like &gait
04:29 rue_house &number is the memory location of the variable
04:29 rue_house because pointer is a memory location, thats what we need to fill it with
04:29 RifRaf yep knew we had to somehow
04:29 rue_house so, we can say pointer = &number; this will put the memory location of number into pointer
04:29 RifRaf ah ok
04:29 Tom_itx pointer = &memory; ?
04:30 Tom_itx err number
04:30 rue_house put that after the variable assignments, see that it still compiles ok
04:30 RifRaf no tom, pointer = &number;
04:30 RifRaf k
04:30 Tom_itx typo
04:30 RifRaf nope rue
04:30 rue_house lets see what you have
04:31 RifRaf i just need an ; or something it says
04:31 rue_house :)
04:31 RifRaf http://paste.debian.net/233300/
04:31 Tom_itx k, i'm out
04:31 rue_house gnight tom
04:31 RifRaf oh wait
04:31 RifRaf yeah nite tom
04:32 rue_house RifRaf, that is a command thats not in the executable part of the program
04:32 rue_house try again :)
04:32 Tom_itx printf("%d \n", *pointer );
04:32 Tom_itx ?
04:32 RifRaf all good
04:32 RifRaf 42 is the answer as it should be
04:32 rue_house RifRaf, lets see what you have
04:33 RifRaf http://paste.debian.net/233302/
04:33 rue_house yup
04:33 rue_house now, the other prefix is when you have a pointer
04:34 rue_house * is used to specify the value, a pointer is pointing at, instead of the memory address it holds
04:34 rue_house so, pointer is pointing to number
04:34 rue_house number is holding 42
04:34 rue_house *pointer will have a value of 42
04:34 RifRaf yes
04:34 rue_house so
04:35 rue_house http://paste.debian.net/233303/
04:35 rue_house try that out
04:35 RifRaf all good
04:36 rue_house now modify the code so pointer points to othernumber instead
04:36 RifRaf so *pointer is like what you call when you want *pointer?
04:36 RifRaf k, brb
04:37 RifRaf http://paste.debian.net/233304/ prints number 3
04:37 rue_house excellent
04:38 RifRaf yay
04:38 rue_house ok! now, I want you to create a function called add :)
04:39 rue_house RifRaf, is the book frustrating cause they go slow?
04:39 rue_house and too fast all at the same time?
04:39 RifRaf no way, i just struggle to read
04:40 RifRaf i think the book is very good
04:40 RifRaf but if you skip a few pages you regret it
04:40 RifRaf you have to keep looking back, i do think it makes you think, alot
04:40 RifRaf well me anyway, different thinking than i am used to
04:41 rue_house if your shakey on making the funcction take a guess
04:41 Jak_o_Shadows2 That last one will print the number in the variable othernumber, aka 3
04:41 RifRaf have been :)
04:42 rue_house RifRaf, I didn't tell you much about what to create, so we have to tune anyhow
04:43 RifRaf ok i am stuck, is this the right direction? http://paste.debian.net/233305/
04:43 rue_house heh, not what I'm thinking
04:43 RifRaf it hates my line 11
04:43 rue_house yup
04:44 rue_house so main() is a function thats pre-defined by the compiler
04:44 rue_house its where the program execution starts
04:44 RifRaf yep ok
04:44 RifRaf the loop
04:45 rue_house every other function needs to be prototyped like a variable is created, and then defined, like main is
04:45 rue_house so,
04:45 rue_house were gonna make our own function called add,
04:45 rue_house just like a variable we have to say what it evaluates to (like a variable)
04:45 rue_house if you dont return a number, you can say 'void'
04:46 RifRaf ah ok, and add = (number + othernumber)?
04:46 rue_house lets make the function, then fill it
04:46 RifRaf oh the void thing, thats like another little main you can call when needed?
04:47 RifRaf i'll watch and learn
04:47 RifRaf i get too hung up in trying to do the wrong thing
04:47 rue_house http://paste.debian.net/233306/
04:47 rue_house ok, see whats new?
04:47 RifRaf looking
04:47 rue_house hah oops
04:47 rue_house http://paste.debian.net/233307/
04:47 rue_house :)
04:48 RifRaf i think you used some of my code rue
04:48 RifRaf and moved it into main
04:48 rue_house ofcourse, your doing some of the work here
04:48 RifRaf i don't get the add thing yet, let me look a bit longer
04:49 RifRaf you didn't use add yet right?
04:49 rue_house correct
04:49 RifRaf its just there?
04:49 rue_house correct
04:49 RifRaf yay
04:49 rue_house so, line 7 i the protoype for it
04:50 rue_house and 18-20 define what it does
04:50 RifRaf not alot?
04:50 rue_house its empty :)
04:50 RifRaf yep
04:50 rue_house so, ignore pointer, modify add so that it returns number + othernumber
04:51 RifRaf k will have a go
04:58 rue_house remmeber I'm usually an easy answer guy :)
04:58 RifRaf sorry got lost again, is it just the one line like this http://paste.debian.net/233308/
04:58 rue_house ah
04:58 rue_house right now add always returns 0
04:59 rue_house return 0; can also be written return(0);
04:59 rue_house does that help?
05:00 rue_house we want it to return number + othernumber
05:02 rue_house RifRaf, shall I wait a bit?
05:02 RifRaf http://paste.debian.net/233309/
05:02 rue_house not quite
05:02 rue_house but your closer
05:02 rue_house you just made it too complex is all
05:03 RifRaf heh, it compiled at leats finally
05:03 rue_house http://paste.debian.net/233310/
05:03 RifRaf and sorry had to get dinner from the microwave this time
05:03 rue_house ok
05:03 rue_house see the diff?
05:04 RifRaf you included it in the return value, the formula, i tryed similar things
05:04 rue_house yup
05:05 rue_house ok eating or ready for another challange?
05:05 RifRaf eatin just now but can still think on it
05:06 rue_house ok, the function can be used in place of a value
05:06 rue_house when the function is run, it returns with a number (int)
05:07 rue_house that return value can be used as a number, or ignored
05:07 RifRaf ok
05:07 rue_house when you call printf() you ignore the return value
05:07 rue_house everyone alwyas does :)
05:08 rue_house what were gonna do, is use add() in the printf command
05:08 rue_house works like this
05:08 rue_house http://paste.debian.net/233312/
05:09 rue_house the program runs add() before printf, to work out the value for printf
05:09 rue_house tell me when you have givn it a try
05:09 rue_house its 3am, I'm gonna go shut down the shop
05:09 rue_house biab
05:11 RifRaf okay, sounds like a good time to shut shop
05:12 rue_house tell me if the code works ok
05:12 RifRaf k i understand that code but pointer does not appear to be used
05:13 RifRaf yep answer is now 45
05:13 rue_house right, were not using pointer
05:13 rue_house ok
05:14 rue_house now, do you know how to add arguments into the function we made
05:14 rue_house want to add 2 arguments
05:14 RifRaf will have a go, i think i do
05:15 rue_house k
05:15 rue_house two int arguments :)
05:15 RifRaf into the add function or main?
05:15 rue_house into the add function
05:16 RifRaf k have an int x; and int y;
05:16 rue_house ok
05:17 rue_house I get to see right?
05:17 RifRaf yep, just a sec
05:18 RifRaf http://paste.debian.net/233314/
05:18 rue_house kinda
05:18 rue_house if we want to be able to put the numbers in when we call add, we do this
05:18 RifRaf lol see i am pretty useless rue
05:19 RifRaf but i would have put the port away earlier if i knew you were online
05:19 RifRaf i reckon we gor somewhere though
05:19 RifRaf got*
05:19 RifRaf did not get this scheduler going but feel like i learnt more instead
05:19 rue_house its ok
05:20 rue_house http://paste.debian.net/233315/
05:20 rue_house ok take a look at that
05:20 rue_house it wont compile
05:20 RifRaf hrm, too few arguments
05:20 rue_house so, we made a function called add, it evaluates to an int, it requires two paramiters, both integers
05:20 RifRaf need a + maybe?
05:20 rue_house ^^^^
05:21 rue_house see from line 7?
05:21 RifRaf yep
05:21 rue_house when you execute the code, the two numbers you give the add function, get named x and y, these only exist IN the add function
05:21 RifRaf so it needs be be after mian?
05:22 RifRaf main
05:22 rue_house nope
05:22 rue_house so when the add function is called it returns the value of number + othernumber
05:22 rue_house x and y are unused
05:22 rue_house sound ok so far?
05:23 RifRaf oh because we need to make em global?
05:23 rue_house nope
05:23 RifRaf omg sorry
05:23 rue_house when add it called, it needs to be given two numbers
05:24 rue_house :) can you solve the error?
05:24 rue_house called/used
05:24 RifRaf oh ok, let me see now
05:26 rue_house it dosn't use the numbers its given, I'm not worried about that yet
05:27 RifRaf ok rue its too late for me, but will solve this puzzle in mornin before work ok
05:27 rue_house :) ok
05:27 rue_house 3am here anyhow
05:27 rue_house :)
05:27 RifRaf i am awake but its time for stuff like soldering on this 40pin socket to me avr dragon
05:28 rue_house you hav a dragon too eh?
05:28 RifRaf i know you are way later, i been gettin up at about 4.30am instead to get stuff done before work
05:28 rue_house I should ask kat how she got hers
05:28 RifRaf i found it the other day, but just got the ZIF socket in mail today
05:28 rue_house cool
05:28 RifRaf so it can do 28pin and 40pin, and smaller
05:29 RifRaf might try revive this collection of 'dead' mega 32's
05:32 RifRaf got some fresh coffee, gonna try a big hit
05:48 RifRaf pin one would goto the handle of the ZIF socket?
05:55 RifRaf well thats where it lives now
05:59 RifRaf small mod to cardboard case with blade and fits nicely
09:21 axiom92 Hello. I want to drive a motor using a micontroller. The motor will rotate a plate sort of a structure above which I plan to place a webcam
09:21 axiom92 I have never held a solder iron
09:22 axiom92 thanks!
09:42 joga axiom92, do you want to also tilt the camera up/down, and how accurate and wide do you want the movement to be?
09:43 axiom92 the movement should be 180 degrees wide. There is no requirement of moving the camera up and down
09:43 axiom92 amigojapan, answered quite a lot of my queries on ##programming though. But I would appreciate any help
09:45 joga do you already have some parts?
09:45 axiom92 no. have to start from scratch
09:46 axiom92 frankly I don't know what to buy.
09:46 axiom92 discussion with amigojapan helped me in zeroing out the requirements to an Arduino and a servo motor
09:47 amigojapan sorry axiom92 I did nt notice your messages here
09:47 joga that's one way to do it at least
09:47 amigojapan <axiom92> the movement should be 180 degrees wide. There is no requirement of moving the camera up and down all you need is one servo
09:47 axiom92 amigojapan, you helped a lot!
09:48 amigojapan no problem axiom92
09:52 joga the only thing that comes to mind is that you should either make sure to get a servo that turns at least 180 degrees or mod a one that doesn't, other than that it should be pretty simple to do
09:53 axiom92 joga, thanks a lot :)
11:12 GuShH_Lap theBear: aww how come I missed it https://www.google.com/doodles/robert-moogs-78th-birthday
11:16 GuShH_Lap then again that doodle wasn't for everyone, someone just said to me "aww look at the tiny piano with the equalizer on it" nearly made me want to grab a gun and chase them down.
11:27 Kryczek aww look at the tiny piano with the equalizer on it
11:52 theBear heh
14:46 RifRaf http://pastebin.com/LEFNSRT0 i keep getting gaitc.c:42: undefined reference to `schedul
14:46 RifRaf eJob'
14:47 rue_house you get that if the function schedulejob isn't defined anywhere
14:47 RifRaf like the scheduler.h is not included, but it is by timer.h automatically apparently, adding an #include <scheduler.h> does not help, i see it defined in there
14:48 rue_house there may be a .c file that needs to be added to the project
14:48 RifRaf hrm, thae docs have not mentioned one
14:48 RifRaf http://webbot.org.uk/WebbotLibDocs/27187.html#obj_27348
14:48 rue_house the .h files just have the function prototypes in them, not the function code itself, the code itself its added in the compiler arguments
14:49 rue_house I dont know
14:49 rue_house didn't write it :)
14:49 RifRaf :P
14:49 rue_house search all the libraries for the function, see where it is
14:50 RifRaf in scheduler.h
14:50 rue_house NO
14:50 RifRaf void scheduleJob(SchedulerCallback callback, SchedulerData data, TICK_COUNT start, TICK_COUNT delay);
14:50 rue_house the PROTOTYPE of the function is in the .h file
14:50 rue_house not the DEFINITION
14:50 RifRaf oh
14:51 rue_house a definition looks like int add(int x, int y) { some code here }
14:51 rue_house not int add(int x, int y);
14:51 RifRaf well that sucks cause there is no scheduler.c
14:51 rue_house maybe thats the problem
14:51 RifRaf surely they did not leave it out or forget to write it
14:52 rue_house could have, and dont call me Shirly
14:56 RifRaf it seems an integral part, will ask in the forum after trying a bit more
14:57 RifRaf Provides a scheduler mechanism whereby code can be queued up to be called at a later date. This is currently used to flash the status LED when an error occurs.
14:57 RifRaf so its already in use somewhere
15:04 rue_house there is acommand line program called grep you can use to search for text in multiple files
15:07 RifRaf i have searched the lot
15:07 RifRaf found 57 times
15:07 rue_house hmm
15:07 rue_house side question, are you sure you got the case right on the function name when you called it?
15:08 RifRaf yes
15:08 RifRaf quad checked and rechecked
15:08 rue_house k
15:08 RifRaf the file in segled folder called marqueeSendByte.c seems to use it
15:09 rue_house the reason I dont know the answer is because there are multiple ways they could include the function in the system
15:09 rue_house see if you can get ideas from their use of it
15:09 RifRaf oh and the errors.c file, lets look at that, should have the led flashing
15:10 RifRaf the errors.c file includes schedular.h as well
15:10 RifRaf scheduler.h*
15:11 RifRaf http://pastebin.com/MMNMsdnq thats errors.c
15:11 RifRaf and all the scheduleJob stuff is commented out :/
15:12 rue_house Your paste has triggered our automatic SPAM detection filter
15:12 RifRaf lol
15:21 RifRaf well i am concerned now, will have to ask the author
15:26 rue_house RifRaf, the animation playing should have a working implementation of it
15:28 Tom_itx rue_house, no work today?
15:29 rue_house nope, new holiday
15:29 rue_house its not even commercialized yet
15:29 Tom_itx what causes no pic on skype?
15:29 rue_house firewall?
15:29 Tom_itx i got dev cc installed again
15:29 Tom_itx no firewall
15:29 Tom_itx it worked once
15:29 Tom_itx but trial conference calling caused it to fail
15:30 rue_house windows right?
15:30 Tom_itx 7 i think
15:30 Tom_itx on one of the lappys
15:30 rue_house peer to peer or conference?
15:30 Tom_itx conference
15:30 Tom_itx 3 way
15:30 rue_house confrence dosn't work on widnows, you have to have someone running something else start it and bring the windows people in
15:31 Tom_itx i know
15:31 Tom_itx they can hear but not see
15:31 Tom_itx they can see this pc
15:31 Tom_itx but we can't see them
15:31 Tom_itx voice is ok
15:31 rue_house confrence dosn't work on widnows, you have to have someone running something else start it and bring the windows people in
15:31 rue_house confrence dosn't work on widnows, you have to have someone running something else start it and bring the windows people in
15:31 Tom_itx does it work in linux?
15:32 rue_house I'm part of a museum group working on something, I have to start the confrence for them
15:32 Tom_itx do you know why it doesn't work?
15:32 rue_house or no video
15:32 rue_house I'v heard a lot of reports about it
15:33 Tom_itx i may try ubuntu
15:34 rue_house prolly even knoppix, then you dont have to install anyrthing
15:35 Tom_itx so
15:35 Tom_itx i see your student did ok
15:36 Tom_itx i got a better idea on pointers now i think
15:36 Tom_itx how do you make a com file to run and test the samples?
15:37 Tom_L [Linker error] undefined reference to `__cpu_features_init'
15:39 Rif student failed when it started getting tricky
15:39 Rif but do have some idea about it now
15:39 Tom_L int add(int x, int y){return (x+y);}
15:40 Rif have to leave, darn work :/ will see if i get a reply to my plee for help
15:41 Rif Tom_itx did you get a project made yesterday?
15:41 Tom_itx how did you make yours executable?
15:41 Rif with project designer
15:41 Rif no
15:41 Tom_itx in dev cc
15:41 Rif i compile in a dos prompt, type make
15:42 Rif and upload with avrdude from dos prompt as well, and edit in editplus
15:42 Tom_itx the test rue did...
15:42 Rif the produced example code should compile
15:42 Tom_itx not avr c
15:42 Rif oh yes sorry
15:42 Rif i was in dev c++ as well
15:43 Rif but set to do .c
15:43 Tom_itx where do you set that/
15:43 Tom_itx ?
15:43 Tom_itx usually the file extension is enough
15:44 Rif select it when you save the file
15:44 Rif indeed
15:45 Rif must run
15:54 rue_house yay! the backup is done
15:57 Tom_itx it's working now
15:57 Tom_itx ok now how do i get a com or exe from the c?
15:57 Tom_itx so i can test these results
15:57 rue_house I suppose I should make rues guide to C programming?
15:58 rue_house making a .com file is trickey, mind sticking with exe's?
15:58 Tom_L i've done it before but it's been ages
15:58 Tom_L need a dos utility for com
15:58 Tom_L bin2exe or something
15:58 rue_house its a change to the way its compiled
15:58 Tom_L it's been ages
15:58 Tom_L so i need the dev c++ to produce an executable
15:58 Tom_L how?
15:59 Tom_L i get an error right now
15:59 rue_house if you start a new project it frames out a simple rogram for you
15:59 Tom_L [Linker error] undefined reference to `__cpu_features_init'
15:59 rue_house then go to compile
15:59 rue_house in the default frame?
15:59 Tom_L no
15:59 Tom_L i deleted that one
15:59 Tom_L cause it was c++
15:59 rue_house start with the default frame and make sure the program works
15:59 Tom_L how do you set it for c only?
16:00 rue_house save the file as .c
16:00 Tom_L new project?
16:00 Tom_L or jus new file?
16:00 rue_house yes
16:00 rue_house new c console project
16:00 rue_house yay, backup is finished
16:01 Tom_L ok i got the argc argv stuff now
16:01 Tom_L what was the 3rd parameter.. i forget now
16:02 Tom_L do i remove the system("Pause") line?
16:02 rue_house no just compile and run it as its given to ya
16:03 rue_house see that the program works
16:03 rue_house then go from there
16:03 Tom_L i added in your sample stuff already
16:03 rue_house your not getting it
16:03 Tom_L does it need to be called main?
16:03 rue_house you dont know the prgram itself works
16:03 Tom_L i've used it before
16:03 rue_house program execution starts with main
16:04 Tom_L same error
16:04 Tom_L new project with just their template
16:04 Tom_L [Linker error] undefined reference to `__cpu_features_init'
16:06 Tom_L also installed a inpout32_source_and_bins.zip file
16:06 Tom_L i had in the same directory
16:06 Tom_L but after the error not before
16:07 rue_house ok see, it disn't install right somehow
16:07 Tom_L i'll uninstall it and try again
16:07 rue_house remove all, try reinstalling, dont get fancy
16:08 Tom_L wonder if i should reboot after removing
16:09 Tom_itx i will just as a precaution
16:10 Tom_itx i've got ms C5 and C6 on that system too but i forgot how to use them
16:16 Tom_itx still getting the same error
16:18 Tom_itx i will try it on this on
16:18 Tom_itx e
16:21 Tom_itx i don't get errors on this one
16:23 Tom_itx mmm wonder what the issue is on the other one
16:30 Tom_itx rue_house
16:30 Tom_itx the pointer part isn't working right
16:30 Tom_itx i get 420848 returned
16:32 Tom_itx ok i got that fixed
16:38 Tom_L ok add() works now
16:40 Tom_itx http://paste.debian.net/233416/
16:54 rue_shop2 heh, we didn't finish add
16:55 rue_shop2 Tom_itx, reinstall worked then?
17:02 Tom_itx no
17:02 Tom_itx switched pc
17:02 Tom_itx i finished add()
17:02 Tom_itx ^^
17:03 Tom_itx it doesn't work on the other pc
17:03 Tom_itx dunno why
17:05 rue_shop2 well show me the code
17:05 rue_shop2 its got a mess of stuff in it, you need to be following from the beggining
17:07 Tom_itx http://paste.debian.net/233416/
17:08 rue_shop2 we hsould set up a paste server of our own, I'm sure we could make one that responded faster
17:08 rue_shop2 and whats not working?.
17:09 rue_shop2 printf("%d \n", *pointer,"\n");
17:09 rue_shop2 you cant do that
17:09 rue_shop2 the first string has to specify everything
17:09 rue_shop2 then any variables that were specified in the format string, are expected after it
17:09 rue_shop2 so the %d is filled with *pointer, and the 3rdone isn't used
17:10 rue_shop2 printf(format, variables....);
17:12 Tom_itx umm it all works
17:12 Tom_itx don't say i can't do that when it works
17:13 rue_shop2 ok, well thats because its ignoring your last "\n"
17:14 rue_shop2 printf("%d \n", *pointer);
17:14 rue_shop2 printf("%d \n", add(number, othernumber));
17:14 rue_shop2 that will do the same thing
17:14 Tom_itx no it isn't it returns a line
17:14 Tom_itx afterward
17:14 Tom_itx i think
17:15 Tom_itx ok i guess the 2nd one isn't seen
17:15 Tom_itx did i do the add() right?
17:16 rue_shop2 yes
17:19 rue_shop2 Tom_itx, now change the add function to use a pointer as the first argument
17:25 Tom_itx might need a bit of help on that one
17:26 rue_shop2 RifRaf, you workin?
17:26 Tom_itx int add(int *x, int y);
17:26 Tom_itx that part right?
17:27 rue_shop2 yes
17:27 rue_shop2 then modify the function header to be the same
17:27 Tom_itx i did
17:27 rue_shop2 ok
17:27 Tom_itx the add has me wondering though
17:27 rue_shop2 show me how you would modify the call
17:28 Tom_itx i used add(*pointer, othernumber)
17:28 Tom_itx but i think it may need to be
17:28 Tom_itx i used add(&pointer, othernumber)
17:28 Tom_itx but that doesn't seem right
17:28 rue_shop2 no
17:28 rue_shop2 stick with number and othernumber
17:29 Tom_itx well pointer was working though
17:29 Tom_itx but ok
17:29 rue_shop2 no it wasn't
17:29 Tom_itx printf("%d \n", *pointer);
17:29 Tom_itx that was
17:29 rue_shop2 yes
17:29 rue_shop2 *pointer is the value at the memory location pointer
17:29 rue_shop2 er
17:29 rue_shop2 *pointer is the value at the memory location pointer is pointing to
17:30 Tom_itx ok back to x and y as the parameter list and number and othernumber as the vars
17:30 Tom_itx i'm not sure
17:31 rue_shop2 we want to work on the call next
17:31 rue_shop2 so you have printf("%d \n", add( , ));
17:31 rue_shop2 you know the second argument hasn't changed, so it can be the same
17:31 rue_shop2 so you have printf("%d \n", add( , othernumber ));
17:31 Tom_itx well i've got printf("%d \n", add( number, othernumber)); to start with
17:32 rue_shop2 right
17:32 Tom_itx but the number needs help
17:32 rue_shop2 we need to change the first argument
17:32 Tom_itx right
17:32 rue_shop2 the add fucntion is looking fora pointer, but we have a number
17:32 rue_shop2 we need to make the first paramiter the ADDRESS of number, not the value of it
17:32 rue_shop2 we do that with the & prefix
17:32 Tom_itx &
17:32 Tom_itx i think i tried that
17:33 rue_shop2 not that I'v seen
17:33 rue_shop2 do that , show me what you have
17:33 Tom_itx ok i'll paste it
17:34 Tom_itx http://paste.debian.net/233426/
17:34 Tom_itx and it works
17:34 Tom_itx but do i need the * in the return also?
17:34 rue_shop2 slow down... :)
17:34 Tom_itx but i got it to work
17:35 rue_shop2 ok, we chnaged the fuction decleration and header to make the first arguent a pointer
17:35 rue_shop2 we called it with a memory address instead of a value
17:35 Tom_itx with &
17:35 Tom_itx that was the part i was unsure of
17:35 rue_shop2 do you know what the *x does you changed in add?
17:36 Tom_itx the declared statement varies from the 'useage' statement
17:36 Tom_itx it gives the content of the address at x
17:36 rue_shop2 k
17:36 Tom_itx in int length because x is int
17:38 rue_shop2 now we modify it so that it changes the number at the pointer instead of returning it directly
17:38 rue_shop2 so, move the call to add to before the first printf, scrap the second printf
17:38 Tom_itx is the * required in the return line as well as the function call line?
17:38 rue_shop2 ignore th return value of add
17:39 rue_shop2 yes, in the definition its used to specify that its going to recieve a int pointer
17:39 Tom_itx ok, i wasn't sure once it passed thru the function call if it was needed after that
17:39 rue_shop2 in the function its used to say to use the value at the pointer instead of the memory location the pointer holds
17:40 Tom_itx ok gimme a sec and we'll start on the next step
17:40 Tom_itx brb
17:45 Tom_itx ok
17:45 Tom_itx now what?
17:46 rue_shop2 you have to show your work :)
17:46 Tom_itx start with the last paste
17:46 Tom_itx i commented out the 2nd printf
17:47 Tom_itx so i got printf("%d \n", *pointer);
17:47 Tom_itx to work with
17:47 rue_shop2 do how work
17:47 rue_shop2 do show work
17:47 RifRaf yep at work, cannot watch screen too much
17:47 rue_shop2 ok
17:48 rue_shop2 need a clear plastic jar with a screw on lid
17:48 Tom_itx k, this doesn't work but i moved what you said
17:48 Tom_itx posting
17:49 Tom_itx http://paste.debian.net/233429/
17:52 Tom_itx not sure what you're after now
17:53 RifRaf getting facy code now tom :)
17:53 RifRaf fancy*
17:54 RifRaf no reply to wether or not scheduler.h is working, hopefully by the time i knock off
17:57 rue_house its not supposed tow ork, were doing this in steps
17:58 Tom_itx ok that's where we're at now then
17:58 rue_house ok, now, change the add function so it dosn't return anything, aka, its result is void
17:58 rue_house but leave the arguments in
17:59 Tom_itx void add(int *x, int y);
17:59 Tom_itx int add(int *x, int y){return (void);
17:59 rue_house heh, you dont even need return if your function is void
18:00 Tom_itx i know
18:00 rue_house the decleration has to match the defiition too
18:00 Tom_itx but it's good practice
18:00 Tom_itx first line is the definition
18:00 rue_house if the function is void, you just do return();
18:00 Tom_itx ahh
18:00 Tom_itx void add(int *x, int y){return);
18:01 Tom_itx -) +}
18:01 Tom_itx on the end
18:01 Tom_itx and the ;
18:03 rue_house yes
18:03 rue_house ok
18:03 rue_house shall me overall what you have then
18:04 Tom_itx http://paste.debian.net/233430/
18:05 rue_house ok, now have the code set the value of x to 25
18:06 Tom_itx return x+25;
18:06 Tom_itx err
18:07 Tom_itx x isn't declared anywhere but in the function call
18:08 rue_house nope
18:08 rue_house set x to 25
18:08 rue_house x is a pointer
18:08 rue_house you know how to read a pointer, you can write to it the same way
18:08 Tom_itx inside add() ?
18:09 rue_house yes
18:10 rue_house return is a command, has to have a ;
18:10 Tom_itx but it's only declared in the parameter list
18:10 Tom_itx yes
18:10 Tom_itx forgot
18:10 rue_house yup
18:10 rue_house take a shot and show your work
18:10 Tom_itx void add(int *x, int y){
18:10 Tom_itx x = 25;
18:10 Tom_itx return;
18:11 Tom_itx *x = 25;
18:11 rue_house :)
18:11 rue_house ok, go for it
18:11 Tom_itx but you still have to pass 2 parameters
18:11 Tom_itx and you're altering one inside before it gets used?
18:12 rue_house it just ignores the second one right now, let it
18:12 Tom_itx 18 C:\Dev-Cpp\Pointer_test\main.c syntax error before "printf"
18:12 rue_house ok show al your work
18:12 Tom_itx i think i know
18:12 rue_house thats why you need to post the whole thing for me
18:13 Tom_itx was a ;
18:13 Tom_itx add returns 25
18:13 rue_house UST POST THE WHOLE THING
18:13 Tom_itx i'll just post it on my server now
18:14 Tom_itx easier probably
18:15 Tom_itx http://tom-itx.dyndns.org:81/~webpage/rue/C_tutorial/
18:15 Tom_itx we'll just use that now
18:15 Tom_itx you can 'refresh'
18:16 rue_house that dosn't work, my sytem tries to open it in an edit every time
18:17 rue_house editor
18:17 rue_house and I cant edit and post it back
18:17 rue_house http://paste.debian.net/233432/
18:18 rue_house that code works, yes?
18:19 rue_house you dont have to put your nick in, just dump the code into it
18:21 Tom_itx lemme try your paste
18:22 Tom_itx returns 25
18:23 rue_shop2 do you know why?
18:23 rue_shop2 it dosn't return, it modifies
18:24 Tom_itx yes
18:24 rue_shop2 so now make it modify x to be x + y
18:24 Tom_itx add modifies 'number' before *pointer can show it in printf
18:25 rue_shop2 yes
18:25 rue_shop2 pointer and number are at the same memory location
18:25 rue_shop2 that is, pointer reffers to the location of number
18:26 rue_shop2 so when number is modified, pointer will show its current value
18:26 rue_shop2 same memory location
18:26 Tom_itx you could have pointer show it before and after the change
18:26 rue_shop2 arg, I ahve half a circuit wried up and 400 distractions
18:26 Tom_itx wanna quit now?
18:26 rue_shop2 no,
18:27 rue_shop2 I want you to modify add so that it modifes x to be x+y
18:29 Tom_itx http://paste.debian.net/233433/
18:29 Tom_itx returns 52
18:30 Tom_itx now 94
18:31 rue_shop2 yup, ok
18:31 rue_shop2 how instead of using number in the add call, use pointer
18:32 Tom_itx by changing: *x = (*x *2)+y;
18:32 Tom_itx for fun
18:32 rue_shop2 lets stick to *x = *x + y
18:32 rue_shop2 you can also say *x+=y
18:32 rue_shop2 any time you have ___ = ___ + --- you can use ____ += ---
18:32 Tom_itx too hard to read
18:32 Tom_itx confusing
18:40 Tom_itx you waitin for me?
18:40 Tom_itx http://paste.debian.net/233435/
18:40 Tom_itx why would you take that roundabout route to get there though
18:44 Tom_itx i can sorta see where this is going
18:44 Tom_itx but it's shower time... brb
19:03 RifRaf he does the roundabout thing for a reason normally
19:06 rue_shop2 Tom_itx, unelss your used to it, expand this: byte |= bit;
19:06 rue_shop2 Tom_itx, RifRaf I'm meyandering all over the place to give you guys experiance with a few things all at once
19:07 Tom_itx byte |= 1<<bit;
19:08 rue_shop2 nope
19:08 rue_shop2 any time you have ___ = ___ + --- you can use ____ += ---
19:09 Tom_itx are we done with pointers now?
19:10 Tom_itx why won't the dev c work on my other pc?
19:10 rue_shop2 show me the last code you have
19:10 Tom_itx i did
19:11 Tom_itx <Tom_itx> http://paste.debian.net/233435/
19:12 rue_shop2 no
19:12 rue_shop2 nonon
19:12 rue_shop2 leave the funciton with x
19:12 rue_shop2 otherwise there is a name conflict
19:12 rue_shop2 http://paste.debian.net/233438/
19:13 Tom_itx it ran
19:13 rue_shop2 yes, but its messed up
19:13 rue_shop2 change the CALL so that it uses pointer
19:13 rue_shop2 not the add function
19:13 rue_shop2 add( &number, othernumber);
19:13 rue_shop2 ^^^ that is the CALL
19:13 rue_shop2 void add(int *x, int y);
19:13 rue_shop2 ^^6 that is the decleration
19:13 rue_shop2 void add(int *x, int y){
19:13 Tom_itx add(pointer, othernumber);
19:13 rue_shop2 ^^^ that is the definition
19:14 Tom_itx that is the answer
19:14 rue_shop2 yes
19:14 Tom_itx i didn't test it
19:14 rue_shop2 do test it
19:14 rue_shop2 only takes a sec
19:14 Tom_itx i'm trying to figure out why this won't work on the other pc
19:15 rue_shop2 cause4d you installed something else over it that broke it
19:15 rue_shop2 ?
19:15 Tom_itx no
19:15 Tom_itx fresh install
19:15 Tom_itx cleaned all others off first
19:15 Tom_itx rebooted
19:15 Tom_itx fresh install
19:15 Tom_itx get that __cpu error
19:15 rue_shop2 is it 64 bit?
19:15 Tom_itx no
19:16 Tom_itx i copied the same file here and installed it
19:16 rue_shop2 the os, is the os 64 bit
19:16 Tom_itx no it's xp pro
19:16 rue_shop2 hmm
19:16 Tom_itx old crap
19:16 Tom_itx same os
19:17 rue_shop2 remove reinstall?
19:17 Tom_itx http://paste.debian.net/233440/
19:17 rue_shop2 reboot?
19:17 rue_shop2 reinstall windows?
19:17 Tom_itx that's not gonna happen
19:18 rue_shop2 I have to make scrap metal trip quick
19:18 rue_shop2 and go shopping
19:18 rue_shop2 ...
19:19 rue_shop2 :( I didn't get to finish wiring my 74ls166 circuit
19:19 Tom_itx i'll run some updates while you're gone
19:33 Tom_itx mmm 149
19:33 Tom_itx had it shut off for a long time
19:33 Tom_itx got tired of it
20:04 RifRaf wats the bet he is getting scrap metal, not throwing it out
20:04 Tom_itx was there ever a doubt?
20:11 RifRaf well i read it funny and first time and was a bit shocked
20:12 RifRaf cause he has never thrown anything away
20:13 Tom_itx he did some sorting once
20:13 RifRaf wiring up leds all day here, like meditation, cause i can dream while doing it
20:13 Tom_itx about pointers?
20:14 RifRaf about thrying to make stronger servo arms for me arm
20:14 RifRaf cannot dream about code, thats more a nightmare Tom_itx
20:14 Tom_itx heh
20:15 Tom_itx rue's thing was going ok though right?
20:38 RifRaf wat thing is that?
20:42 Tom_itx the c tutorial last night
20:42 Tom_itx or this morning
20:43 RifRaf yes was compiling fine this i stopped
20:43 RifRaf till*
20:44 RifRaf you cannot get things compiling at all?
20:45 Tom_itx on this one i did but not the other pc
20:45 RifRaf the dev c++ just worked for me out of the box, no config had to be done
20:47 Tom_itx it worked fine on this one as well and i've had it working on the other one before but not now
20:55 RifRaf tryed reinstall and wiping out the old folders?
20:56 Tom_itx yup
20:56 Tom_itx more than once
20:56 Tom_itx and rebooting etc in the process
20:57 Tom_itx keep getting some linker error having to do with some ___cpu thing
21:08 RifRaf googleing is no help for it?
21:09 Tom_itx didn't try, been running updates since
21:09 Tom_itx another 15 to go
21:09 Tom_itx of 149
21:10 Tom_itx i turned them off long ago because i was tired of them screwing everything up. i'll probably regret this
21:18 Ademan The MG996 servos I received doesn't seem to really have a spec sheet but the seller says up to 7.2v, do I need to put any resistors in series with it? I assume not, that at 7.2v its open resistance will prevent dangerous current levels from passing through it
21:21 Tom_itx 7.2 may be tops
21:33 Ademan You don't think it'll require any extra resistance?
21:37 Tom_itx no but i wouldn't exceed the recomended voltage either
21:39 piney0 any one know what those brass/metal things are called that you drill in to wood and if gives a secure spot for a machine screw? typically used in furniture i think.
21:40 piney0 looking to mount a circuit board to an old chess board and i think that would give the cleanest look screwing a standoff in it
21:40 Tom_itx t nut
21:40 Tom_itx no i know what you mean now
21:40 piney0 thats close
21:40 piney0 didn't think of those
21:40 Tom_itx threaded on both sides
21:41 Tom_itx but coarse on the outside
21:41 piney0 yea
21:41 Tom_itx i forget what they are
21:41 piney0 t nut might help me find it though. very similar applications
21:41 piney0 thanks
21:43 Tom_itx http://www.fastenal.com/web/products/detail.ex?sku=0123232&ucst=t
21:43 Tom_itx ez lock
21:44 piney0 dude, thanks a lot
21:46 Tom_itx you probably want 4-40 or 6-32 internal thread
21:47 Tom_itx http://www.fastenal.com/web/products/detail.ex?sku=0123223&ucst=t
21:48 Tom_itx http://www.fastenal.com/web/products/detail.ex?sku=0123224&ucst=t
21:52 piney0 i think i should get both sizes. they are both common standoff sizes
21:52 Tom_itx you don't need their tool to install them
21:52 Tom_itx jamb a nut against them on a screw and screw em in
21:53 piney0 yea
21:56 piney0 amazon has them too. cool
21:56 Tom_itx amazon is a broker
21:56 Tom_itx but you may find them cheaper than fastenal
21:57 Tom_itx i just knew i could find them ther
21:57 Tom_itx e
21:57 piney0 yes, but I have an amazon acct. and cheaper if i need 25
21:57 piney0 fastenal is great and all
21:57 Tom_itx they're higher probably
21:57 piney0 kinda like grainger though $$ unless you shop there a bit
21:57 Tom_itx yeah
21:58 piney0 first two links for ex lok showed fastenal and grainger
21:58 piney0 ez*
22:14 Ademan Tom_itx: I planned on only giving it 6v anyways
22:18 RifRaf Ademan the mg996 need no resistor
22:18 RifRaf just upto 7.2V for + - and the signal from avr
22:19 RifRaf have 2 working on me little arm at moment
22:19 RifRaf running from 6V nicely
22:20 Tom_itx dammit
22:20 Tom_itx found a newer version but it's 64bit
22:34 Tom_itx RifRaf, what ver are you running?
22:34 Tom_itx i can't seem to find an older version to try
22:35 RifRaf 4.9.9.2
22:36 Tom_itx same here
22:36 Tom_itx i used to have an older version that may work but can't find it on the web now
22:37 RifRaf have installed on 3 pcs, all ok, this is the oldest
22:37 RifRaf xp sp3, the others are win7
22:37 Tom_L [Linker error] undefined reference to `__cpu_features_init'
22:42 RifRaf start here i guess http://sourceforge.net/p/dev-cpp/discussion/48211/thread/d9ab0b47
22:42 RifRaf sounds klike an environment thing
22:46 Tom_itx that fixed it
22:46 Tom_itx thanks
22:56 RifRaf thats ok
22:56 RifRaf lucky i am an expert coder
23:08 Lolina8088 RifRaf, what do we do with sugarcane?
23:08 Lolina8088 theBear,
23:19 RifRaf make sugar from it
23:20 RifRaf or is it a trick question?
23:21 GargantuaSauce vodka
23:30 rue_shop2 I think she meant as entertainment in the stick form
23:34 RifRaf still lost
23:34 RifRaf but only 8minutes left :)
23:35 RifRaf rue i fixed toms error, or rather googled for him
23:42 fRaf hangs up earmuffs and runs for the