Go to advanced search

by Daniel Gessel
Fri Feb 23, 2018 5:31 pm
Forum: C/C++
Topic: negative number in C++ code is giving problems
Replies: 15
Views: 1231

Re: negative number in C++ code is giving problems

Possibly get some negative values because you are not accounting for seconds part of the tv struct here: time_difference = (gettime_now.tv_nsec - start_time) / 1000; You need to add tv_sec delta * 1,000,000 to get a proper micro second delta. For timing, I use: u64 nanoseconds() { struct timespec ts...
by Daniel Gessel
Fri Feb 23, 2018 5:25 pm
Forum: C/C++
Topic: negative number in C++ code is giving problems
Replies: 15
Views: 1231

Re: negative number in C++ code is giving problems

I thought I checked for R, C being ints in the posted code (didn’t see them defined) and OP stated they were doubles. I must not be seeing the code you found wher R & C are defined. My bad.
by Daniel Gessel
Fri Feb 23, 2018 3:08 pm
Forum: C/C++
Topic: negative number in C++ code is giving problems
Replies: 15
Views: 1231

Re: negative number in C++ code is giving problems

Try casting time_difference to double before negating. Probably, negating an unsigned produces an unsigned (which is positive - likely the two’s compliment of the original value) and then converted to a double for the division.

Using unsigned values with math requires extra care... It’s often a pain.
by Daniel Gessel
Mon Feb 05, 2018 5:42 pm
Forum: C/C++
Topic: How can I practice my code for RPI?
Replies: 12
Views: 1462

Re: How can I practice my code for RPI?

I’m going slightly off topic since the OP asked about Windows, but cosider installing a Linux distro (Raspbian itself is an option) on your desktop for increased compatibility while getting your desktop’s performance for development (I don’t find compile times an issue, but everybody has their own p...
by Daniel Gessel
Tue Jan 30, 2018 3:35 pm
Forum: C/C++
Topic: QT QHostInfo
Replies: 10
Views: 914

Re: QT QHostInfo

Then you probably need a -I<path> option on your gcc command line. Do you know where the QHostinfo file is on your system? The path to that directory is what you’d use with the -I option.
by Daniel Gessel
Mon Jan 29, 2018 7:22 pm
Forum: C/C++
Topic: QT QHostInfo
Replies: 10
Views: 914

Re: QT QHostInfo

Does #include<QHostinfo.h> (instead of #include<QHostinfo>) help?
by Daniel Gessel
Sat Jan 27, 2018 1:57 pm
Forum: Automation, sensing and robotics
Topic: Sense hat magnetometer data
Replies: 5
Views: 2269

Re: Sense hat magnetometer data

I just started looking at the datasheet for the 9 dof IMU sensor on the hat and found out there is a temperature sensor provided because the magnetometer is temperature dependent. Not sure yet if the official code tries to take this into account or not - I just started playing with the hat and diggi...
by Daniel Gessel
Wed Jan 24, 2018 3:53 pm
Forum: C/C++
Topic: wiringPi I2C libs wiringPiI2C: block read / write commands?
Replies: 3
Views: 1251

Re: wiringPi I2C libs wiringPiI2C: block read / write commands?

Any thoughts on the read/write sequence to replace the ioctl that reads a single 8 bit register? I haven’t tried to solve this with any device yet - seems like it would require more kernel calls; I’ve just been working with C and/or python examples to figure out how to make my own C device interface...
by Daniel Gessel
Tue Jan 23, 2018 8:52 pm
Forum: C/C++
Topic: wiringPi I2C libs wiringPiI2C: block read / write commands?
Replies: 3
Views: 1251

Re: wiringPi I2C libs wiringPiI2C: block read / write commands?

I haven't worked out how to read registers in block mode, but I've gotten significant speedups updating the framebuffer in an SSD1306 (found in Adafruit's PiOled) by rolling my own I2C_SMBUS_I2C_BLOCK_DATA call to ioctl. Then I got a little more switching to plain old "write" - which let me update i...
by Daniel Gessel
Thu Jan 18, 2018 3:44 pm
Forum: OpenGLES
Topic: Mouse api for console OpenGL ES program?
Replies: 2
Views: 1140

Re: Mouse api for console OpenGL ES program?

Thanks - I should’ve found that myself! But looks super helpful!
by Daniel Gessel
Wed Jan 17, 2018 7:39 pm
Forum: OpenGLES
Topic: Mouse api for console OpenGL ES program?
Replies: 2
Views: 1140

Mouse api for console OpenGL ES program?

OpenGL ES from the console is well supported, but the examples I’ve seen so far don’t use a mouse. Anybody have any tips? Thanks!
by Daniel Gessel
Mon Jan 15, 2018 3:02 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Why this GPIO-sequence and which GPIOs for Interfaces?
Replies: 7
Views: 719

Re: Why this GPIO-sequence and which GPIOs for Interfaces?

So there are two PWM channels that are brought out to up to 4 pins. Then there’s using the dma engine, If I understand correctly, which can work for all GPIO pins. Finally, there’s SW PWM, which can be implemented with busy loops, real time clock checks, even Nano sleeps if you can live with variabi...
by Daniel Gessel
Sun Jan 14, 2018 9:45 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Why this GPIO-sequence and which GPIOs for Interfaces?
Replies: 7
Views: 719

Re: Why this GPIO-sequence and which GPIOs for Interfaces?

I could only find 3 pwm pins on https://pinout.xyz, two of which are labeled PWM0. Is there a more complete, if less pretty and easy to read, reference - short of going to schematics?
by Daniel Gessel
Fri Dec 29, 2017 1:56 pm
Forum: C/C++
Topic: C opencv 3.3.1
Replies: 2
Views: 591

Re: C opencv 3.3.1

I don’t have answers, but I’m also interested in OpenCV. Can you do what you want with 2.4.9? Please keep updating us here on how it goes!
by Daniel Gessel
Mon Dec 25, 2017 11:00 pm
Forum: Bare metal, Assembly language
Topic: Drive up to 20 stepper motors (28byj-48)
Replies: 14
Views: 2031

Re: Drive up to 20 stepper motors (28byj-48)

You want something like a stack of these:
https://www.adafruit.com/product/2327
Or these:
https://www.dexterindustries.com/shop/pivotpi-board/
But for steppers, not servos, right?

These use I2C to control multiple servos....
by Daniel Gessel
Sun Dec 24, 2017 7:15 pm
Forum: Automation, sensing and robotics
Topic: RPi Zero W Lego Robotics Kit?
Replies: 4
Views: 660

Re: RPi Zero W Lego Robotics Kit?

Thanks for the feedback! Some more web surfing led me to:

https://www.dexterindustries.com/shop/p ... pberry-pi/

Which I think is going to be a great starter kit for my little project.
by Daniel Gessel
Fri Dec 22, 2017 1:06 pm
Forum: Automation, sensing and robotics
Topic: RPi Zero W Lego Robotics Kit?
Replies: 4
Views: 660

RPi Zero W Lego Robotics Kit?

I’d like a Pi robotics kit for smaller Lego Technic sets (turning e.g. vehicles into rovers); there are at least a couple of Pi kits that will work with the Pi 3, but I found nothing going for small and light weight like I think could be done with a Pi Zero W. It seems I have to build it myself! I’m...
by Daniel Gessel
Thu Dec 14, 2017 12:59 pm
Forum: General discussion
Topic: STICKY: Introduce yourself!
Replies: 3403
Views: 660823

Re: STICKY: Introduce yourself!

Hi,

I just picked up a toy programming language project I had put down a while ago and am working to make it useful (or at least interesting) for Raspberry Pi enthusiasts of all ages.

Dan
by Daniel Gessel
Sun Dec 03, 2017 3:11 pm
Forum: Graphics programming
Topic: OpenCL on the VideoCore IV!
Replies: 78
Views: 29396

Re: OpenCL on the VideoCore IV!

As far as I could find out, the rpi3 cpu runs at 500 MHz, has 4 cores and arm Neon instructions are 128-bit wide. Theoretical flops would than be 500*4*4 = 8 GFlops for the cpu, versus 24 GFlops for the GPU. Beautiful; thanks! I believe the rpi3 is closer to 1 GHz, however, making it 16 GFlops for ...
by Daniel Gessel
Sun Dec 03, 2017 1:54 am
Forum: Graphics programming
Topic: OpenCL on the VideoCore IV!
Replies: 78
Views: 29396

Re: OpenCL on the VideoCore IV!

Awesome work! What’s the reason for pocl’s poor fp performance? Does the CPU emulate floating point? Do you know the theoretical limits for GPU CPU in terms of straight instruction throughput?

Go to advanced search