Update: I still don't know how to use PWM. I've got MomentarySingleOutput() working, BUT: subsequent dbus calls to fbd are queued up and only take place after the delay, so it seems I'll have to rethink and rewrite.
j
I'm starting the next stage of expansion for FB in linux, and need some information.
I'm planning to implement a momentary output method, so that a dbus method can trigger the output for x milliseconds and turn off, with a single dbus call. No problems anticipated there, might do that yet tonight.
But the other thing I wanted to try this weekend was to get PWM support. Just a guess based on some reading here on the forum, but am I right that where fblib.c is currently setting outputs on with '0b00000001' and off with '0b00000000' (in bytes 0,2,4 etc) that the first seven bits there are what control PWM?
Since I blew up the power regulator on my FB last night I'm not sure I can test this any time soon, do the onboard LEDs reflect the PWM state? (it still works off USB power, but outputs aren't usable without the 12v, right?)
Also, what are the odd-numbered of the first 32 bytes used for -the even ones are outputs, and the upper 32 bytes are analog inputs, but I don't know what (if anything) can be done with the other 16 bytes.
Oh, and the next step I'm interested in pursuing after those two is to try to support multiple FBs. I'm open to suggestions as to interface semantics, (use same dbus object with a field to choose different brains? Or multiple dbus interfaces?) and I wanted to ask how MDX identifies specific brains when more than one are connected. Could be irritating, humorous, or catastrophic to mix up two different brains...
j
(friggin forum software thinks it's smarter than me, keeps un-capitalizing PWM in the title...)
Update: I still don't know how to use PWM. I've got MomentarySingleOutput() working, BUT: subsequent dbus calls to fbd are queued up and only take place after the delay, so it seems I'll have to rethink and rewrite.
j
I'm not too much of a programmer, but I know a little perl.
before I go and spend the extra money on an FB, I wanted to run my thought by everyone to see if there were any immediate problems with my idea.
I'd like to write a gtk2 app in perl that makes dbus calls to fbd and turns on and off some relays. if I can make THAT work I'll think about expanding to other things.
Also if anyone has some tips on how to "integrate" my app into nGhost i'm all ears.
Something like:
could be used to turn on output 3. (silkscreened '4' on board) I can't help with the nGhost end of things though.Code:use Net::DBus; my $fb = Net::DBus->session ->get_service('org.openice.fbd') ->get_object('/org/openice/fbd') ; $fb->SetSingleOutput(3,1);
j
I got around to looking at and testing this, and realized I screwed up. It should be "my $fb = Net::DBus->system", since we're dealing with system bus instead of session bus.
j
i think there's something wrong with your program man there's no .exe file.
free bump
NOVA, MD, DC Monthly Meets Here
Ride Runner and Centrafuse 3 plugin creator
mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
Find my plugins on the MP3Car App Store!
Follow Me on Twitter or Facebook
Live mp3Car Facebook Chat
Ummm, what program are you referring to? And why are you looking for a .exe file for a linux program anyway?
j
I think he is jesting... If I remember correctly he is a linux man, he knows there arent any exe's, just giving the thread a bump.![]()
Fusion Brain Version 6 Released!
1.9in x 2.9in -- 47mm x 73mm
30 Digital Outputs -- Directly drive a relay
15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
Buy now in the MP3Car.com Store
Bookmarks