Go to advanced search

by davenull
Wed Nov 11, 2015 7:49 am
Forum: C/C++
Topic: Having Fun with threads! Very Interesting
Replies: 19
Views: 8079

Re: Having Fun with threads! Very Interesting

so you probably missed to count the "2" additionally, as it's a prime number, even if even 8-)

number of primes 0-100000 is 9592 8-)
by davenull
Tue Nov 10, 2015 5:29 pm
Forum: Deutsch
Topic: preiswerte Raspi-kompatible kabellose QWERTZ Tastatur+Maus ?
Replies: 32
Views: 5761

Re: preiswerte Raspi-kompatible kabellose QWERTZ Tastatur+Ma

wieso "Getrolle" ? meine Frage war doch, welche preiswerten nach eigener Erfahrung funktionieren. Antwort: alle funktionieren. Dann probiert und gewagt: - Eins funktioniert überhaupt nicht (Hama), - und beim anderen fehlt die <>| Taste, was definitiv nichts mit einem "alten Layout" zu tun hat, denn ...
by davenull
Tue Nov 10, 2015 5:14 pm
Forum: C/C++
Topic: Having Fun with threads! Very Interesting
Replies: 19
Views: 8079

Re: Having Fun with threads! Very Interesting

but on Windows, to show up 1 internet site by Firefox , this lasts just a couple of seconds (depending on internet traffic), while by identical WiFi stick, at the same time, simultaneously or shortly one after the other, in the same home network, by Iceweasel on the Raspi it lasts about 1 minute !!!...
by davenull
Tue Nov 10, 2015 4:37 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

ps, I'm using 50µs (!) loops or (!) wiringPi pinchange events for my attempts on Raspi, but the code basically works already by 250µs (!) loops on Arduino! OTOH, on Arduino Due, implementing a Timer IRQ is just these 3 lines in setup() / main(), that's it : #include <DueTimer.h> Timer1.attachInterru...
by davenull
Tue Nov 10, 2015 4:27 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

I have no idea how I had to implement a change callback method, I don't understand it, I'm just using libs so far, ready to use.

At least I understand the simple methods of wiringPi.
by davenull
Tue Nov 10, 2015 4:16 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

ps, this is how I started until I finally failed after finishing this muddled-up different pin numbering thing): // encoder test // pigpio, pinchange IRQs #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <math.h> #include <fcntl.h> #include <string.h> #include <sys/ioctl.h> #inclu...
by davenull
Tue Nov 10, 2015 4:03 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

thanks for your input! You are right, I'm using the code on my Arduinos by timer interrupts already by myself, nevertheless many Arduino users trigger it as well by pinchange interrupts. But I agree, IMO a timer interrupt would be better to be used for it. But how to change my existing code to make ...
by davenull
Tue Nov 10, 2015 1:35 pm
Forum: Deutsch
Topic: preiswerte Raspi-kompatible kabellose QWERTZ Tastatur+Maus ?
Replies: 32
Views: 5761

Re: preiswerte Raspi-kompatible kabellose QWERTZ Tastatur+Ma

haha, nächstes Problem:
auf der Tastatur sind die 3 Zeichen
<
>
|
nicht vorhanden!
Ist das zu fassen? Stattdessen ist da eine mit [Fn] bezeichnete Funktions-Taste (neben dem [Y] ), ohne dass die 3 betr. Zeichen irgendwo anders dann auftauchen....

ooohh neeee! :twisted:
by davenull
Tue Nov 10, 2015 12:04 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

if you could help me to implement this snippet into a quicker pigpio wrap using interrupts, that would be really a big favour! this is the wiringPi pseudo-pinchange-interrupt-handler: wiringPiISR( pinenc0A, INT_EDGE_BOTH, updateEncoders); wiringPiISR( pinenc0B, INT_EDGE_BOTH, updateEncoders); wiring...
by davenull
Tue Nov 10, 2015 11:24 am
Forum: C/C++
Topic: HDMI graphic lib: openvg syntax questions
Replies: 91
Views: 11034

Re: HDMI graphic lib: openvg syntax questions

is Go accessable by gcc C/C++ and the Geany IDE ? (as I actually understood, it wouldn't be...) Finally all my programs are coded in C and edited and compiled and built via Geany! (the display task of course is just an infinitesimal tiny part of the whole project, just in order to display all the ca...
by davenull
Tue Nov 10, 2015 10:54 am
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

the encoder maths itself is an approved algorithm to handle all the possible high/low or low/high Qab transitions which indeed works extremely quick and reliably on either platform, even on Arduino Unos. volatile long motenc[2]; volatile int8_t ISRab[2]; // 1/2 resolution int8_t enctab[16] = {0, 0,0...
by davenull
Tue Nov 10, 2015 8:17 am
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

ok, I give up. for the Raspi B+ for 2 encoder motors simultaneously I must state: - simple GPIO readings by pigpio in dedicated threads at repetitive 20-50µs loops is the same as for wiringPi : ok for very slow rotations (1 rev in 3 sec) , but faulty at ~10x regular speed = 4 rev./sec. http://www.mi...
by davenull
Mon Nov 09, 2015 11:10 am
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

a few questions... pigpio is installed, test ok. so for the encoder lib, 1st, again: how to download and how to install the lib "rotary_encoder.h" for system-wide use in either working directory? 2nd, for my setup using 2 encoder motors simultaneously: the pins are: // motor 0 #define pinenc0A 4 #de...
by davenull
Mon Nov 09, 2015 8:11 am
Forum: Deutsch
Topic: preiswerte Raspi-kompatible kabellose QWERTZ Tastatur+Maus ?
Replies: 32
Views: 5761

Re: preiswerte Raspi-kompatible kabellose QWERTZ Tastatur+Ma

@ gkreidl:
jawoll, mit den Maus-Einstellungen in cmdline.txt klappt es jetzt!
Danke für den Tipp! :)
by davenull
Mon Nov 09, 2015 7:59 am
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

thank you! encoder functions never are running alone on the Pi, there are lots of parallel tasks I have to run simultaneously. Later, at the final end, even plus 1 quick UART send/receive task ( 64 bytes at 115200 continuously, interfacing a Arduino IO Multiplexer Expansion shield) The same it's for...
by davenull
Sun Nov 08, 2015 7:07 pm
Forum: General discussion
Topic: Why some microSD cards can run raspbian while others can't?
Replies: 26
Views: 3334

Re: Why some microSD cards can run raspbian while others can

32 GB I got for EUR 9,90
8 GB I got for 4 EUR

both class 10

is that expensive or peanuts? I don't know.
by davenull
Sun Nov 08, 2015 6:43 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

sorry, FTM it's too complicated.
additionally it's not just about polling pins, but processing the calculations in real-time additionally.

I think I'll stick to Gordon Henderson's wiringPi.

Otherwise don't hezitate to port it and show me how to do it, please.
by davenull
Sun Nov 08, 2015 5:31 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

thank you, I did what I could (and what I could understand), I followed Gordon's advices, but pigpio is too weird and I don't know what to do with it. If one could port my code to pigpio instead of wiringPi, I gladly took the chance, but tbh, currently that is beyond my skills. FTM, the Raspi's enco...
by davenull
Sun Nov 08, 2015 5:22 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

I admit, my English is poor.

But you can convince me if you show me how to count all 360 degrees for fast rotations >= 4 revolutions/sec, feat. multitasking additionally for parallel running tasks.

Otherwise, the performance of the Raspi is too poor FTM.
by davenull
Sun Nov 08, 2015 5:13 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

well, for the application it actually IS too slow, because for slow rotation speed it counts all 360 for 1 revolution, and for quick rotation speed it looses 60 of 360 and counts just 300 of 360. Finally the application performance is what counts. Of course I see, that the reason is that we don't ha...
by davenull
Sun Nov 08, 2015 4:02 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

first attempt failed, 2nd attempt by pin change interrupt, 1/2 resolution, wiringPiISR() using INT_EDGE_BOTH. for very slow rotation the counting is working, now at 1 revolution == 360 counts == 360° as it should, (1 revolution in 3 sec) but again too slow for regular rotation speed , then lot of co...
by davenull
Sun Nov 08, 2015 1:55 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

yes, to do that and not get reading errors at higher speed is the point...
(the pigpio code viewtopic.php?p=662694#p662694 I don't understand, admittedly)
by davenull
Sun Nov 08, 2015 1:37 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

Python? I never use Python and don't understand a single word of that. But as I wrote above, the issue is just about getting the double resolution when using Gordon's code. Servos are no option, I need strong motors by high torque, and I already have them all. tbh, I would prefer to have the encoder...
by davenull
Sun Nov 08, 2015 1:29 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

ok, thank you, if all other approaches fail, I'll keep that in my mind. as I wrote (edited): tbh, I would prefer to have the encoder reading in simple threads in my own program, like Gordon did. in case of need In case of need, I'd take the 1/4 resolution (180 counts/rev.) by Gordon's code if there ...
by davenull
Sun Nov 08, 2015 1:24 pm
Forum: C/C++
Topic: About encoder output "jump"
Replies: 76
Views: 10791

Re: About encoder output "jump"

is this running and compatible to wiringPi and pthread and openVG and my UART messaging tasks? Note that different sensor readings have to be processed additionally, all compiled and built by Geany IDE. tbh, I would prefer to have the encoder reading in simple threads in my own program, like Gordon ...

Go to advanced search