computerized watch ideah. any one interested in a project?
MMISCOOL
Posts: 36
about 3 or four days agoe i thought of an ideah. Iwanted to make an interperter that could use code and do things. this code could be modifyed without using a pc and the device using it could fit in a wrist watch (a bulky wrist watch but a wrist watch). I created the code below as a comand interperter that could store programs in the stamp's eprom. I am hopeing to generate soem interest in it. is there any one interested in basicly makeing there own programing langage for that runs on the basic stamp.
the comand interperter below only uses debug statemnts so there shood be no problem. you can interface it with an lcd or a couple of butons and get rid of the debug code. if you do please post it.
look at the code cloasly you sdood be able to figure some of it out. ask me any questions you like
link smbi.tripod.com/id12.html
if you have any ideahs for the project please send them. If you wish to get in on the project please email me @ mmiscool@gmail.com
some basic things such as an organiser wood be nice for this device so i will leave all options open
Post Edited (MMISCOOL) : 11/28/2005 2:47:15 AM GMT
the comand interperter below only uses debug statemnts so there shood be no problem. you can interface it with an lcd or a couple of butons and get rid of the debug code. if you do please post it.
look at the code cloasly you sdood be able to figure some of it out. ask me any questions you like
link smbi.tripod.com/id12.html
if you have any ideahs for the project please send them. If you wish to get in on the project please email me @ mmiscool@gmail.com
some basic things such as an organiser wood be nice for this device so i will leave all options open
' {$STAMP BS2} ' {$PBASIC 2.5} '------------[noparse][[/noparse](C) 2005, MICHAEL MOLINARI , you can use it any way you like]---------------- aa VAR Byte bb VAR Byte cc VAR Byte dd VAR Byte ee VAR Byte CURENTLINE VAR Byte BLA VAR Byte A VAR Byte B VAR Byte C VAR Byte D VAR Byte E VAR Byte F VAR Byte G VAR Byte H VAR Byte I VAR Byte J VAR Byte OUT VAR Byte BLABLA VAR Nib EN VAR Byte MENUE: READ 0 , AA READ 1 , BB READ 2 , CC READ 3 , DD READ 4 , EE CURENTLINE = 0 DEBUG "(A) EDIT (B) RUN" DEBUGIN BLA IF BLA = "A" THEN GOTO EDITOR ELSE GOTO EXICUTE '-----[noparse][[/noparse]THIS IS THE EDITOR]--------------------------------------------------------------- EDITOR: DEBUG "HOW MANY LINES?" DEBUGIN EN EN = EN - 65 EDITOR_LOOP: DEBUG "[noparse][[/noparse]A] " DEBUGIN BLA WRITE BLABLA * 5 + 0, BLA DEBUG "[b] " DEBUGIN BLA WRITE BLABLA * 5 + 1, BLA DEBUG "[noparse][[/noparse]C] " DEBUGIN BLA WRITE BLABLA * 5 + 2, BLA DEBUG "[noparse][[/noparse]D] " DEBUGIN BLA WRITE BLABLA * 5 + 3, BLA DEBUG "[noparse][[/noparse]E] " DEBUGIN BLA WRITE BLABLA * 5 + 4, BLA BLABLA = BLABLA + 1 IF BLABLA > EN THEN GOTO MENUE GOTO EDITOR_LOOP '-----[noparse][[/noparse]THIS IS THE INTERPERTER]------------------------------------------------------------ EXICUTE: IF AA = "D" THEN GOSUB DISPLAY_IT IF AA = "I" THEN GOSUB INPUT_IT IF AA = "C" THEN GOSUB COMPARE_IT IF AA = "E" THEN GOSUB EDIT_IT IF AA = "M" THEN GOSUB MATH IF AA = "O" THEN GOSUB PIN_H_L IF AA = "G" THEN GOTO GOTO_IT IF CURENTLINE = EN THEN DEBUG "-DONE-":GOTO MENUE GOTO GOTO_NEXT DISPLAY_IT: IF BB = "V" THEN GOTO DISPLAY_VAR DEBUG CC RETURN DISPLAY_VAR: IF CC = "A" THEN DEBUG A IF CC = "B" THEN DEBUG B IF CC = "C" THEN DEBUG C IF CC = "D" THEN DEBUG D IF CC = "E" THEN DEBUG E IF CC = "F" THEN DEBUG F IF CC = "G" THEN DEBUG G IF CC = "H" THEN DEBUG H IF CC = "I" THEN DEBUG I IF CC = "J" THEN DEBUG J RETURN INPUT_IT: DEBUG " ? " IF BB = "A" THEN DEBUGIN A IF BB = "B" THEN DEBUGIN B IF BB = "C" THEN DEBUGIN C IF BB = "D" THEN DEBUGIN D IF BB = "E" THEN DEBUGIN E IF BB = "F" THEN DEBUGIN F IF BB = "G" THEN DEBUGIN G IF BB = "H" THEN DEBUGIN H IF BB = "I" THEN DEBUGIN I IF BB = "J" THEN DEBUGIN J RETURN GOTO_NEXT: BB = CURENTLINE + 66 GOTO_IT: BLA = BB - 65 READ BLA * 5 + 0 , AA READ BLA * 5 + 1 , BB READ BLA * 5 + 2 , CC READ BLA * 5 + 3 , DD READ BLA * 5 + 4 , EE CURENTLINE = BLA GOTO EXICUTE COMPARE_IT: IF CC = DD THEN AA = "G" RETURN EDIT_IT: IF DD = "V" THEN GOSUB EDIT_VAR WRITE BB * 5 -1 + CC, EE RETURN EDIT_VAR: IF DD = "A" THEN EE = A IF DD = "B" THEN EE = B IF DD = "C" THEN EE = C IF DD = "D" THEN EE = D IF DD = "E" THEN EE = E IF DD = "F" THEN EE = F IF DD = "G" THEN EE = G IF DD = "H" THEN EE = H IF DD = "I" THEN EE = I IF DD = "J" THEN EE = J RETURN MATH: IF BB = "+" THEN BLA = CC + DD IF BB = "-" THEN BLA = CC - DD IF BB = "*" THEN BLA = CC * DD IF BB = "/" THEN BLA = CC / DD IF EE = "A" THEN A = BLA IF EE = "B" THEN B = BLA IF EE = "C" THEN C = BLA IF EE = "D" THEN D = BLA IF EE = "E" THEN E = BLA IF EE = "F" THEN F = BLA IF EE = "G" THEN G = BLA IF EE = "H" THEN H = BLA IF EE = "I" THEN I = BLA IF EE = "J" THEN J = BLA RETURN PIN_H_L: IF BB = "H" THEN HIGH CC IF BB = "L" THEN LOW CC RETURN LED_TEXT_OUT: 'PUT CODE HERE TO CONTROAL LED DISPLAY" RETURN CHAR_IN: 'PUT CODE TO GET CHARACTER FROM USER IN THIS AIRYA RETURN[/b]
Post Edited (MMISCOOL) : 11/28/2005 2:47:15 AM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
I think you will learn alot doing this kind of project. But from my perspective, unless you outline the Commands,and Syntax of your proposed language it is tough for me to test any aspects of it as the documents on what commands are available, and how they function are not SPELLED out [noparse]:)[/noparse]
I ran your program on my BS2, but I don't have any idea what it is asking for in the DEBUG screen, You ask how many lines, but provide no line numbers, and there is no syntax checking as I can put anything on the line without any feedback from the editor that it is not understanding me.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
I understand that you are in high school and just getting started with this stuff. But when I visit your web site it does not project a professional image, and certainly not one that would lead people to shell out $395 for your PC programming tools. Maybe you are the next Bil Gates (!?!?), but you really do need to pay attention in your writing and spelling classes, and the math too, and if they are boring then think outside the box, like metron9 says.
Here is some competition for your watch:
http://www.theregister.co.uk/2005/01/06/fossil_ships_wrist_pda_2/
Remember, the BASIC Stamp is a controller chip. Define a project within its capabilities.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
about my watch ideah.
sofar i have not been able to get my hands on any reel stamp hardware since my homework board broke (radioshack for $80)
i have to buy a new one. I have been cheeting thought. I downloaded the virtual stamp works program and using one of the examples i (can't edit the circut) can chaige the source code. I am playing with that right now. The program above has been chainged quite a bit so the source atached is the curent. I also include a hook up diagram to hook up the stamp to the 3 swiches it is going to use. thease swiches alow it to scroal thrue characters for data entry. To program the watch wile it is runing you have to first get in to the edit mode.
If you run the program on on your stamp this shood be ez.
The comands i have implemented for the interperter are
d display
i input
g goto
c compare (if then)
e edit (self modifying code)
m math + - * /
the display comand is abriviated by a d
you have to get into the program mode by presing the buton conected to pin 5 on the bs2 at the first debug sequence.
you shood now se a leter going on and on and on on the screen. use the up and down buton to scroal thru the leters (butons conected to the stamp)
scroal until you select b. then hit enter (buton conected to the stamp, labled in daiagram)
selecting be set up a program with 2 lines of code.
it shood have now shown the [noparse][[/noparse]A] folowed by the last scharacter you selected. scroal thrue untill you get to d and hit enter.
it shood say folowed by the last character you had. scroal up untill you get nothing or the leter a. hit enter.
next it shood say [noparse][[/noparse]C]. scroal thrue the characters untill you get to g. hit enter.
now hold down enter to just get thrue the rest of it.
you shood now see the text you saw when you firs started the stamp. hit the buton conected to pin 6 . You shood see
"-G-[noparse][[/noparse]DONE]--(b 1 edit)(B 2 RUN)-"
the G at the begining was the leter you tolde it to display.
every thing in this language is set up with colomes and lines.
lines corispond with a leter (A-Z).
the comands are listed below. they shood be able to clairify any misunderstandings*
display - displays one character at a time
display a character - [noparse][[/noparse]A] d [noparse][[/noparse]C] charactr to be diplayed [noparse][[/noparse]D] [noparse][[/noparse]E]
the v stands for variable
- - - - - - - - - - - - - - - - - - - - - - - - - - - |
displat contents of text variable - [noparse][[/noparse]A] d v [noparse][[/noparse]C] variable leter [noparse][[/noparse]D] [noparse][[/noparse]E]
the n stands for nomber
- - - - - - - - - - - - - - - - - - - - - - - - - - |
display a nomber - [noparse][[/noparse]A] d [noparse][[/noparse]C] a [noparse][[/noparse]D] n [noparse][[/noparse]E]
a nomber is nomber asociated with a character. it does not have to be a character stored in a variable. I can be the nomber asociated with the ANSI character set (asociated with each character).
input - [noparse][[/noparse]A] i variable leter [noparse][[/noparse]C] [noparse][[/noparse]D] [noparse][[/noparse]E]
this alows you to scroal thrue the characters and select one of them. the character will be stored in a variable.
goto - [noparse][[/noparse]A] g leter of the line [noparse][[/noparse]C] [noparse][[/noparse]D] [noparse][[/noparse]E]
this is a jump in a program and jumps the program to the line corisponding with the leter.
compare - [noparse][[/noparse]A] c first character to be compare [noparse][[/noparse]C] second character to be compared [noparse][[/noparse]D] line leter to goto if b was = c [noparse][[/noparse]E]
edit character- [noparse][[/noparse]A] e line leter [noparse][[/noparse]C] colome leter [noparse][[/noparse]D] character to put there [noparse][[/noparse]E]
edit variable - [noparse][[/noparse]A] e line leter [noparse][[/noparse]C] colome leter [noparse][[/noparse]D] v [noparse][[/noparse]E] variable leter
edit chainges the material at any point in the program wile the program runs.
math - [noparse][[/noparse]A] m operation to do (+ - * /) [noparse][[/noparse]C] first nomber [noparse][[/noparse]D] second nomber [noparse][[/noparse]E] variable for answer to be stored to
Post Edited (MMISCOOL) : 11/28/2005 11:52:56 AM GMT
uses same circut above
keep it one spot. its easier to view in its the most current form this way.
thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
DTQ