Go to advanced search

by timr
Sat Jul 06, 2013 6:56 pm
Forum: C/C++
Topic: Can someone recommend a linux C programming forum?
Replies: 3
Views: 1127

Re: Can someone recommend a linux C programming forum?

http://stackoverflow.com/ can be quite informative. Just choose an appropriate tag (RaspberryPi, C, C++, whatever) and see what people are asking
by timr
Sun Jun 30, 2013 5:24 pm
Forum: C/C++
Topic: Max31855 Thermistor - C code to convert bits to decimal
Replies: 4
Views: 1321

Re: Max31855 Thermistor - C code to convert bits to decimal

I think it will just be a binary value. If you want to print in decimal, do something like
printf("%d\n", value)
or
printf("0x%x\n", value)
for hex.
by timr
Thu May 23, 2013 10:31 am
Forum: Bare metal
Topic: RTEMS Real Time OS ported to the Pi
Replies: 21
Views: 18104

Re: RTEMS Real Time OS ported to the Pi

EPICS - Experimental Physics and Industrial Control System http://www.aps.anl.gov/epics/ is an interesting set of tools which is supported on RTEMS. (As well as VxWorks, linux, and windows) EPICS is used in lots of interesting places, and has a wide range of drivers and tools, from interfaces to st...
by timr
Tue May 14, 2013 6:34 pm
Forum: Automation, sensing and robotics
Topic: Hardware Advice Requested
Replies: 8
Views: 1138

Re: Hardware Advice Requested

I didn't do much exploration of motion other than install it (sudo apt-get install motion) and run It uses video4linux, not sure if it uses openCV too FWIW, I got this from Amazon: 1 X TeckNet® C016 USB HD Webcam, 5 MegaPixel, 5G Lens, USB Microphone & 6 LED Sold by UNICHAIN £8.98 I found that it ha...
by timr
Tue May 14, 2013 10:43 am
Forum: Automation, sensing and robotics
Topic: Bee hive control and observation
Replies: 9
Views: 6334

Re: Bee hive control and observation

There are a few articles around about hacking digital bathroom scales: There seem to be several approaches, taking the analogue signal, or even decoding the signals driving the lcd. It might make some of the mechanical aspects easier... or not. There might be issues with being outdoors, for example,...
by timr
Tue May 14, 2013 7:59 am
Forum: Automation, sensing and robotics
Topic: Hardware Advice Requested
Replies: 8
Views: 1138

Re: Hardware Advice Requested

If you want to use the approach of having a webcam comparing images, I can recommend the 'motion' package. It's superb: I used it to find out which dog was coming into our garden and leaving ... stuff. It takes images at regular intervals, compares them, keeps the ones which show changes, and even m...
by timr
Tue Apr 30, 2013 10:51 am
Forum: Bare metal
Topic: Odd Switch Wiring
Replies: 4
Views: 818

Re: Odd Switch Wiring

In principle, yes. Of course, you only need to drive the output when you are ready to read the input. You could do something like this pseudocode: int read_keys() { set_pin(7,1) set_pin(9,0) keybits = read_pins() << 3 set_pin(7,0) set_pin(9,1) keybits = keybits + read_pins() # Now keybits has a 6bit...
by timr
Mon Apr 29, 2013 3:20 pm
Forum: Bare metal
Topic: Odd Switch Wiring
Replies: 4
Views: 818

Re: Odd Switch Wiring

This looks like a simple multiplexed keyboard: It allows you to read lots of keys with only a few I/O lines The idea is that you set pins 7 and 9 as outputs, and the other pins as inputs. You drive each output high in turn, and read back the inputs for each one. So, say you drive pin 7 high: If you ...
by timr
Mon Apr 22, 2013 2:24 pm
Forum: Bare metal
Topic: FreeRTOS Sucessfully Ported
Replies: 47
Views: 52528

Re: FreeRTOS Sucessfully Ported

Hi Your EnableInterrupt() and DisableInterrupt() look like mine now! I modified them slightly to return -1 for invalid nIRQ, and I didn't OR the bits into the enable/disable registers, just wrote them straight in, but otherwise the same. I think there is an issue on interrupts.c line 70 (in the gith...
by timr
Mon Apr 22, 2013 12:01 pm
Forum: Bare metal
Topic: FreeRTOS Sucessfully Ported
Replies: 47
Views: 52528

Re: FreeRTOS Sucessfully Ported

Hi I thought I'd have a look at FreeRTOS. I managed to build it ok, though I had some issues with libc, but I hacked around those. I then looked at your question, and noticed: You call e.g. EnableInterrupt(49) but EnableInterrupt() in interrupts.c appears to do nothing for iIRQ<64. I guess the assig...
by timr
Fri Apr 05, 2013 11:41 am
Forum: C/C++
Topic: Simple question on stat/fstat
Replies: 5
Views: 1182

Re: Simple question on stat/fstat

Hi I just tried this. Since you mentioned that you use Windows, and these are network files, I guessed that these are files on a cifs mount I found that I got EOVERFLOW for remote files (of any size), but local ones are ok (BTW, perror() gives a nicer error report, if you haven't come across it) The...
by timr
Wed Apr 03, 2013 6:03 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: HMC5883L 3-Axis Compass
Replies: 14
Views: 12891

Re: HMC5883L 3-Axis Compass

And if you use unsigned char for the buffer, and int for the x,y,z field strengths, you need to handle sign extension from 16 bit (2 bytes) to 32bits.
I left the buffer as signed char, then when the msb and lsb are combined, the sign is extended properly:

x = buf[0] << 8 | (buf[1] & 0xff);
by timr
Wed Apr 03, 2013 4:45 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: HMC5883L 3-Axis Compass
Replies: 14
Views: 12891

Re: HMC5883L 3-Axis Compass

Ok, I think I have something to report. I actually have one of these (real bargain!) but I was using python, so it took a while to get the C working The read()/write() interface for I2C doesn't work like you have it, see e.g. http://www.mjmwired.net/kernel/Documentation/i2c/dev-interface So I hacked...
by timr
Wed Apr 03, 2013 2:52 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: HMC5883L 3-Axis Compass
Replies: 14
Views: 12891

Re: HMC5883L 3-Axis Compass

Just a guess... have you included <math.h> ?
by timr
Sat Jul 07, 2012 6:16 pm
Forum: Advanced users
Topic: command line music making
Replies: 22
Views: 7923

Re: command line music making

No, it's not a stupid question. I tried some synthesiser packages, but didn't have much luck. Also, many of them seemed to require X, and I don't want that. I was also concerned about whether the CPU is powerful enough to handle it (for chuck, it's not) so I wanted a solution with the lowest possibl...
by timr
Fri Jun 29, 2012 4:27 pm
Forum: Advanced users
Topic: command line music making
Replies: 22
Views: 7923

Re: command line music making

Update, in case anyone's interested I have given up on chuck, at least in the way I was using it before. Instead, I have some C code which will read note events and play pre-created samples through alsa. That seems ok, though there are some audio artifacts on the Pi which do not occur on my laptop. ...
by timr
Thu Jun 14, 2012 8:56 am
Forum: Advanced users
Topic: Please explain softfloat vs softfp vs hardfp
Replies: 11
Views: 24911

Re: Please explain softfloat vs softfp vs hardfp

Just a quick note to say that I am using the raspbian development image from http://www.raspbian.org/HexxehImages It's just what I needed. I'm using chuck from http://chuck.cs.princeton.edu/ for music synthesis http://www.raspberrypi.org/phpBB3/viewtopic.php?f=29&t=7503 . With the soft-float image, ...
by timr
Thu Jun 14, 2012 8:43 am
Forum: Advanced users
Topic: command line music making
Replies: 22
Views: 7923

Re: command line music making

I haven't tried anything more than the simple examples yet, and my final application will only require fairly simple patches. It will just be a limited number of oscillators triggered by OSC events, no filters or anything. I'm using alsa at present: I'm not very knowlegable on linux audio, so I don'...
by timr
Wed Jun 13, 2012 10:54 am
Forum: Advanced users
Topic: command line music making
Replies: 22
Views: 7923

Re: command line music making

I grabbed the image from http://raspbian.com/HexxehImages and tried the same process. I was expecting problems (packages not available, whatever) but it ws just as easy as the standard image. The audio is good (I'm using my USB headphones, I'm not going to worry about the on-board audio for now), CP...
by timr
Tue Jun 12, 2012 2:30 pm
Forum: Advanced users
Topic: command line music making
Replies: 22
Views: 7923

Re: command line music making

My Pi arrived this morning. I installed the debian6-19-04-2012 image. chuck installed easily: sudo apt-get update sudo apt-get install chuck but since I already had it running in qemu, I expected that. On-board sound I used the snd_bcm2835 module, and alsa_utils as described The audio quality from a...
by timr
Sat Jun 09, 2012 3:51 pm
Forum: Advanced users
Topic: command line music making
Replies: 22
Views: 7923

Re: command line music making

If it works well enough, chuck ( http://chuck.cs.princeton.edu/ ) will suit my needs. I have concerns about the fp performance, but I won't know until I get my real Pi. It runs under a qemu emulation with a debian image, but I get no sound. I'm not going to say whether that's a problem until I get t...
by timr
Wed May 30, 2012 10:19 am
Forum: Automation, sensing and robotics
Topic: relay schematic
Replies: 5
Views: 3036

Re: relay schematic

Or, depending on the relay and drive ca[ability of the GPIO pins, a transistor, resistor and diode may be sufficient. Though a ULN2004 gives you extra outputs, should you want them.

Go to advanced search