OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Foot-operated Zaurus Counter
fleegle
post Dec 8 2005, 08:11 AM
Post #1





Group: Members
Posts: 15
Joined: 9-September 04
Member No.: 4,521



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?
Go to the top of the page
 
+Quote Post
lardman
post Dec 8 2005, 08:55 AM
Post #2





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



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

Si
Go to the top of the page
 
+Quote Post
tombraider
post Dec 8 2005, 09:12 AM
Post #3





Group: Members
Posts: 409
Joined: 23-November 04
From: Murphy, North Carolina USA
Member No.: 5,590



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(fleegle @ Dec 8 2005, 04:11 PM)
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?
*
Go to the top of the page
 
+Quote Post
fleegle
post Dec 9 2005, 02:23 AM
Post #4





Group: Members
Posts: 15
Joined: 9-September 04
Member No.: 4,521



It's a toenail interface. smile.gif

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(lardman @ Dec 8 2005, 04:55 PM)
What kind of interface do you have on your toe-switch?

Si
*
Go to the top of the page
 
+Quote Post
lardman
post Dec 9 2005, 03:36 AM
Post #5





Group: Members
Posts: 4,515
Joined: 25-October 03
From: Bath, UK
Member No.: 464



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
Go to the top of the page
 
+Quote Post
craigtyson
post Dec 9 2005, 04:11 AM
Post #6





Group: Members
Posts: 464
Joined: 15-June 04
Member No.: 3,698



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.............................
Go to the top of the page
 
+Quote Post
fleegle
post Dec 10 2005, 08:21 AM
Post #7





Group: Members
Posts: 15
Joined: 9-September 04
Member No.: 4,521



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(lardman @ Dec 9 2005, 11:36 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
*
Go to the top of the page
 
+Quote Post
jfv
post Dec 10 2005, 09:36 AM
Post #8





Group: Members
Posts: 438
Joined: 24-June 03
Member No.: 202



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
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)
Go to the top of the page
 
+Quote Post
fleegle
post Dec 11 2005, 02:38 AM
Post #9





Group: Members
Posts: 15
Joined: 9-September 04
Member No.: 4,521



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(jfv @ Dec 10 2005, 05:36 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
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)

*
Go to the top of the page
 
+Quote Post
jfv
post Dec 11 2005, 07:37 AM
Post #10





Group: Members
Posts: 438
Joined: 24-June 03
Member No.: 202



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
python qtupdown.py

on 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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 27th November 2014 - 07:07 PM