Shop OBEX P1 Docs P2 Docs Learn Events
Capacitive Switch multibutton — Parallax Forums

Capacitive Switch multibutton

juropjurop Posts: 43
edited 2013-04-30 06:54 in Propeller 1
Hi all,

some forewords since I am new here (well, I already made a 1st post but I'll consider this one as the 'true' first post).

I am part of a small team working on a data collection and analysys project. Two months ago, while looking at the various microcontroller on the market to develop our logger, I discovered the Propeller and immediately felt in love with it due to its intrinsic multitasking capabilities. Really a great architecture and a lot of clever thinking by the designer!
I made more progresses in two months with the Prop than a whole year fighting against syncs and interrupts with AVR and ARM micros - please note I am not a professional programmer but a sport (sailing) teacher with some coding experience. Fact is that in about a month of work an HW prototype is already working and logging datas, and most important I enjoyed Propeller and learnt a lot.

While working on the prototype, i adapted the capswitch object in order to have it working with more than one button in the same COG. Fact is that the object is working for two buttons, but doesn't work with more than that. My goal was to create a well cleaned and optimized object in order to put it in the OBEX as a 'thanks' towards all the people who already made so many useful objects, but I must admit that perhaps I am not a so clever programmer to do that.
I think the problem is due to some wrong understandings about how the Prop arranges HUB memory, since I am not able to pass datas from COG and HUB memory with consistency. I already tried (and wrote) many example (working) programs, so I think I understood how wr/rdlong and pointers should work to do such a job; fact is that with two buttons my object does work, but if I try to use it with three buttons, no datas are being exchanged.

Files are attached (and as I said, for me is OK to use MIT licence for the object since the final goal is to have it published on the OBEX), is there anyone wishing to have a look at them and try to explain me what's going wrong in my code? Documentation is not final but should be enough to have a quick idea of the inner working.

Thanks in advance,
Michele

PS - sorry for the language, I am not an english native speaker!

Comments

  • T ChapT Chap Posts: 4,223
    edited 2013-04-30 06:32
    Hello jurop

    At a quick glance, it looks like your test program is only set up for 2 buttons, is there another test program with 3 buttons configured with a larger button array? If you are trying to use 3 buttons, are you setting up the button array for 3 buttons in the 2 button test program that only has an array size for 2 buttons
  • juropjurop Posts: 43
    edited 2013-04-30 06:54
    Sorry, didn't think abt that, I attached the 'working' version with two buttons I needed.
    Attached the previously 'non working' version configured for three buttons... and now it's really puzzling me because I just tested and now it is working! Anyway, test version with three buttons using debug on button #0, datas are regularly exchanged between spin and ASM part. Worst kind of bug, /me thinks
    Thank you for looking.
Sign In or Register to comment.