Author Topic: Foot-operated Zaurus Counter  (Read 6566 times)

fleegle

  • Newbie
  • *
  • Posts: 15
    • View Profile
Foot-operated Zaurus Counter
« on: December 08, 2005, 11:11:49 am »
I need a simple counter program. The idea would be to have three rows of up/down counters with an up and down button for each row, plus a reset to zero button.

I, um, want to use it to count rows and increases/decreases when knitting and I don't want to stop and hit the space bar with my hand. I want to do it with my toe.

This seems like it would be really simple. I did something similar in VBA, but I am helpless in the face of Linux. Anybody out there to help me?

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Foot-operated Zaurus Counter
« Reply #1 on: December 08, 2005, 11:55:54 am »
What kind of interface do you have on your toe-switch?

Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

tombraider

  • Sr. Member
  • ****
  • Posts: 409
    • View Profile
    • http://atoah.com/zaurus/
Foot-operated Zaurus Counter
« Reply #2 on: December 08, 2005, 12:12:16 pm »
Hee, hee,  I'm a knitter also and have wanted a counter like that for stitches and rows for awhile.  Never thought of a "toe counter" though.  :-)


Quote
I need a simple counter program. The idea would be to have three rows of up/down counters with an up and down button for each row, plus a reset to zero button.

I, um, want to use it to count rows and increases/decreases when knitting and I don't want to stop and hit the space bar with my hand. I want to do it with my toe.

This seems like it would be really simple. I did something similar in VBA, but I am helpless in the face of Linux. Anybody out there to help me?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=106468\"][{POST_SNAPBACK}][/a][/div]
Learning Chinese?  Have a Mac?  Try Hanzi Master: Download for free

Tombraider's Zaurus C1000 Tips Web Site

SL-3200 from Conics.net: Sharp ROM| SL-C1000: Pdaxrom Beta 3

fleegle

  • Newbie
  • *
  • Posts: 15
    • View Profile
Foot-operated Zaurus Counter
« Reply #3 on: December 09, 2005, 05:23:00 am »
It's a toenail interface.  

There are actually a lot of knitters out there who want something like this. It's saleable! Especially if you include a simple routine for calculating even increases and decreases. I can work that out for you in, say Basic or, ah, Fortran code.

And if you coded it in a language that can be ported to to Win CE, you really would have a good product for sale. Simple, but we all want one!

Quote
What kind of interface do you have on your toe-switch?

Si
[div align=\"right\"][a href=\"index.php?act=findpost&pid=106478\"][{POST_SNAPBACK}][/a][/div]

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Foot-operated Zaurus Counter
« Reply #4 on: December 09, 2005, 06:36:47 am »
I don't want to write one but I was going to tell you how easy it would be to interface the switch hardware with the Zaurus - I imagine there are a couple of possibilities for it: serial, usb, parallel, or some other digital input via a custom card.

If you've already written something in VBA it's not going to be all that difficult to write something for the Zaurus (different languages etc., but not that hard to learn).


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

craigtyson

  • Sr. Member
  • ****
  • Posts: 462
    • View Profile
Foot-operated Zaurus Counter
« Reply #5 on: December 09, 2005, 07:11:29 am »
What you realy need is a set of bluetooth needles which can tell the Z stich count, avarage no of stiches per min, calories used, heart rate of knitter.......


I think I need some profesional help.............................
« Last Edit: December 09, 2005, 07:11:55 am by craigtyson »
Craig
SL-C1000, Angstrom GPE 2007.12r13
Ambicom WL1100C, SanDisk UltraII 1GB SD
 
Old Faithfull - SL-5500 battery out of the C750 (see below) TKC v1 (New) 1GB SD
Dead - SL-C750, Cacko 1.23 lite (Dropped, very messy!)
Ambicom WL1100C, SanDisk Dead - 1GB SD
Keep your Z on a bungee, you never know.....

fleegle

  • Newbie
  • *
  • Posts: 15
    • View Profile
Foot-operated Zaurus Counter
« Reply #6 on: December 10, 2005, 11:21:58 am »
Well, I took a look at some Zaurus development tools, and I can't get a clue. Is is possible to develop something on the PC and then having a kindhearted person convert it to whatever is needed on the Z? All I want is a simple counter....like six little buttons that go up, down, and reset. It would seem that for the Z, you have to hand-code the buttons--good grief! I haven't done that since 1970. Can you point me to the simplest way to proceed? I can get all the textbooks, as I am a compositor for a computer book company.

The bluetooth needles are a great idea! Too bad the Z doesn't have bluetooth either. sigh.

Quote
I don't want to write one but I was going to tell you how easy it would be to interface the switch hardware with the Zaurus - I imagine there are a couple of possibilities for it: serial, usb, parallel, or some other digital input via a custom card.

If you've already written something in VBA it's not going to be all that difficult to write something for the Zaurus (different languages etc., but not that hard to learn).


Si
[div align=\"right\"][a href=\"index.php?act=findpost&pid=106554\"][{POST_SNAPBACK}][/a][/div]

jfv

  • Sr. Member
  • ****
  • Posts: 437
    • View Profile
Foot-operated Zaurus Counter
« Reply #7 on: December 10, 2005, 12:36:19 pm »
I think people are confused about what you want to do. Do you mean you want the buttons on the screen so you can tap them with your toe with the Zaurus on the floor? Seems hard to believe but nothing else seems to make sense with your posts. Some of the previous replies were wandering if you had some pedal gadget that you wanted to interface with the Zaurus. By the way, which Zaurus? Which ROM? I'd suggest you look into Python, and you can Kopsis's Python setup for the Zaurus (search the forums or look in the Python section).

I'll add below some code I found on the web that implements two buttons, one up one down.
All you need to do is repeat three times, maybe.

Felipe

Example qupdown.py, module Y206 (Python)
Altering a label as a result of button presses - Python Qt

Code: [Select]
import sys
from qt import *

class MainWindow(QMainWindow):
    val = 17
    def __init__(self, *args):
        apply(QMainWindow.__init__, (self, ) + args)

        self.vlayout = QHBoxLayout(self, 10, 5)

        self.labelValue = QLabel(str(MainWindow.val), self)
        self.down = QPushButton("Lower", self)
        self.up = QPushButton("Higher", self)

        self.vlayout.addWidget(self.down)
        self.vlayout.addWidget(self.labelValue)
        self.vlayout.addWidget(self.up)

        self.connect(self.down, SIGNAL("clicked()"), self.reduce)
        self.connect(self.up, SIGNAL("clicked()"), self.increase)  
        
    def reduce(self):
        MainWindow.val -= 1
        self.setval()

    def increase(self):
        MainWindow.val += 1
        self.setval()

    def setval(self):
        self.labelValue.setText(str(MainWindow.val))

def main(args):
    app=QApplication(args)
    win=MainWindow()
    win.show()
    app.connect(app, SIGNAL("lastWindowClosed()")
                , app
                , SLOT("quit()")
                )
    app.exec_loop()

if __name__=="__main__":
        main(sys.argv)
SL 5000 D  and C860 Sharp ROM
Too many accessories...

fleegle

  • Newbie
  • *
  • Posts: 15
    • View Profile
Foot-operated Zaurus Counter
« Reply #8 on: December 11, 2005, 05:38:10 am »
Yes-- All I want are buttons in the screen that I can tap with my toe. You can see what I mean here: http://www.palmsource.com/interests/knitting/. Scroll down to the Countable program. I am tempted to buy an old Palm just to have this program, but I love my Z.

I have an 860 with the original Sharp rom and semi-English menus.

Thanks for the snippet, but I have no idea what to do with it to make it into a real program.

Quote
I think people are confused about what you want to do. Do you mean you want the buttons on the screen so you can tap them with your toe with the Zaurus on the floor? Seems hard to believe but nothing else seems to make sense with your posts. Some of the previous replies were wandering if you had some pedal gadget that you wanted to interface with the Zaurus. By the way, which Zaurus? Which ROM? I'd suggest you look into Python, and you can Kopsis's Python setup for the Zaurus (search the forums or look in the Python section).

I'll add below some code I found on the web that implements two buttons, one up one down.
All you need to do is repeat three times, maybe.

Felipe

Example qupdown.py, module Y206 (Python)
Altering a label as a result of button presses - Python Qt

Code: [Select]
import sys
from qt import *

class MainWindow(QMainWindow):
    val = 17
    def __init__(self, *args):
        apply(QMainWindow.__init__, (self, ) + args)

        self.vlayout = QHBoxLayout(self, 10, 5)

        self.labelValue = QLabel(str(MainWin


dow.val), self)
        self.down = QPushButton("Lower", self)
        self.up = QPushButton("Higher", self)

        self.vlayout.addWidget(self.down)
        self.vlayout.addWidget(self.labelValue)
        self.vlayout.addWidget(self.up)

        self.connect(self.down, SIGNAL("clicked()"), self.reduce)
        self.connect(self.up, SIGNAL("clicked()"), self.increase)  
        
    def reduce(self):
        MainWindow.val -= 1
        self.setval()

    def increase(self):
        MainWindow.val += 1
        self.setval()

    def setval(self):
        self.labelValue.setText(str(MainWindow.val))

def main(args):
    app=QApplication(args)
    win=MainWindow()
    win.show()
    app.connect(app, SIGNAL("lastWindowClosed()")
                , app
                , SLOT("quit()")
                )
    app.exec_loop()

if __name__=="__main__":
        main(sys.argv)
[div align=\"right\"][a href=\"index.php?act=findpost&pid=106688\"][{POST_SNAPBACK}][/a][/div]

jfv

  • Sr. Member
  • ****
  • Posts: 437
    • View Profile
Foot-operated Zaurus Counter
« Reply #9 on: December 11, 2005, 10:37:22 am »
It is a real, complete program. If you save the code to a file, say qtupdown.py, and you have Python installed (instructions elsewhere as in my previous post), then issuing the command
Code: [Select]
python qtupdown.pyon the command line will run the program.  As I said I found this program on a tutorial somewhere when I was trying to learn Python. I never got very far with Python, so I won't offer to get the program closer to what you wanted, but I'm sure it's not very hard. It might get time consuming adjusting the placement and size of the buttons and so on.

One warning. I noticed one unitended line break on the posted code that came from cutting and pasting. Once that is fixed the program should run as is. Python is an interpreted language so a program is just a text file. No compilation necessary.

Having said that, if a program exists for the Palm, get a cheap second-hand Palm and go for it. At least you will not be putting your Zaurus at risk.

Felipe
SL 5000 D  and C860 Sharp ROM
Too many accessories...