Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: zero44 on April 18, 2011, 03:55:40 am

Title: CalCup : a coffee maker link to your calc ...
Post by: zero44 on April 18, 2011, 03:55:40 am
I had a crazy idea :
make a coffee maker with milk and sugars, which is link to an arduino platform.
The com pins of arduino are link to calc ...

Now I've done just the program where you can choose what you want, in french or english, and save your prefs.
I've done too the commands list for communication ( Is there milk ? / Give a sugar / It's done ! )  :crazy:

I think it's a bit incredible ...
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: Juju on April 18, 2011, 04:03:44 am
That would be doable. You just have to find such a coffee brewer. I like this lol.
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: aeTIos on April 18, 2011, 05:25:46 am
Haha lol. Seems indeed doable, but you have to change the coffee brewer, that might be hard.
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: zero44 on April 18, 2011, 07:26:52 am
I must do :
- a pump for milk > arduino
- a recipient for milk
- same for water > arduino
- same for water
- motor to open/close coffee recipient > arduino
- coffee recipient
- one or two motors to block the second sugar while make fall the first >arduino
- something to command the hot by arduino > arduino
as captors :
- is there any sugar anymore ?
- " water " ?
- " milk " ?
- " coffee " ?
> ARDUINO
and maybe :
- LEDs for progress
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: Munchor on April 18, 2011, 07:37:34 am
I must do :
- a pump for milk > arduino
- a recipient for milk
- same for water > arduino
- same for water
- motor to open/close coffee recipient > arduino
- coffee recipient
- one or two motors to block the second sugar while make fall the first >arduino
- something to command the hot by arduino > arduino
as captors :
- is there any sugar anymore ?
- " water " ?
- " milk " ?
- " coffee " ?
> ARDUINO
and maybe :
- LEDs for progress

Concerning the LEDs, multiple LEDs, like the progress:
one turned on
2 turned on
3 turned on
4 turned on
5 turned on = FINISHED

Or is it like one led which brightness goes up and up?
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: zero44 on April 18, 2011, 02:23:18 pm
.
I don't really know for the moment ...
At first, I make the first Axe version of X-8lue ( but it'll be the 0.0.3 ^.^ )
But I think the progress will be displayed on calc's screen .

AxCoffee source code, if you're interested ...
(AxeLib's code is in X-8lue's topic, in my sig)
Spoiler For Spoiler:
:.COFFEE CalCup 1.0  TIcoffee
:prgmAXELIB
:sub(6M7
:identity(FF008092BEA4A292BEA48092B68080B8B6C680FDB6C580C57F460838081007E0)
:
:[F0A8E8A8E8000000F0A8F0A8A8000000→Pic1
:[7CC6828282C67C007CFEFAD6EEFE7C00
:[7C82AA92AA827C00
:Lbl 0
:0→Θ
:"<fonct>v</fonct>Coffee"→Str9
:!If GetCalc(Str9)→Z
:.ARC
:UnArchive Str9
:If GetCalc(Str9)→Z
:1→Θ
:Else
:.CREATE 32 BYTE
:GetCalc(Str9,32)→Z→Θ
:0→{Z}
:Return!If Z
:End
:End
:
:
:ClrDrawClrDraw<sup>r</sup>
:Fix 5
:
:Text(36,29,"TI-Coffee"
:StorePic ClrDraw
:Text(35,29,"TI-Coffee"
:DispGraph<sup>r</sup><sup>r</sup>
:Repeat getKey(54):DispGraph<sup>r</sup><sup>r</sup>
:End
:0→W
:If {Z}
:Goto CF
:End
:.INITIALISATION
:Lbl INI
:ClrDraw
:Text(20,19,"Setup language:"
:rref(18,18,56,9
:Line(18,18,18,39
:Line(73,18,73,39
:Line(19,40,72,40
:Pxl-Off(18,18:Pxl-Off(73,18
:Text(28,30,"<
:Text(58,30,">
:"English"→Str7
:[00]
:"French "
:[00]
:0→C
:DispGraph
:Pause 450
:Repeat getKey(54) or W
:getKey(15)→W
:If getKey(1) or getKey(2) or getKey(3) or getKey(4):Pause 360
:C+1^2→C:End
:Text(33,30,C*9+Str7
:DispGraph
:End
:C→{Z+1}
:0→{Z+3}
:
:1→{Z}
:Lbl CF
:If W:Goto END:End
:ClrDrawClrDraw<sup>r</sup>
:0→S→L+1→T+7→E:{Z+1}→C
:If {Z+3}
:0→E:{Z+4}→S:{Z+5}→L:{Z+6}→T
:
:End
:"Settings→Str0
:[00:"Reglages
:[00:"Sugars:
:[00:"Sucres:
:[00:"Milk:  
:[00:"Lait:  
:[00:"Cups:  
:[00:"Tasses:
:[00:"Coffee !
:[00:"Cafe !  
:[00:"No !
:[00:"Non!
:[00:"Yes!
:[00:"Oui!
:[00:"Save prefs
:[00:"Enregistrer
:[00:"Reset  
:[00:"Reinit.
:[00:"Cancel  
:[00:"Annuler
:[00:"Coffee:
:[00:"Cafe:  
:[00:"Water:  
:[00:"Eau:    
:
:
:Goto A
:Lbl DRW
:Pt-On(2,2,8*C+Pic1
:Line(8,2,8,6
:Text(10,1,C*10+Str0
:rref(0,0,96,9
:Line(0,0,0,62
:Line(95,0,95,62
:Line(1,63,94,63
:Pxl-Off(0,0
:Pxl-Off(95,0
:Text(10,55,C*12+111+Str0
:Pt-On(2,55,E+16+Pic1:
:sub(BUT<sup>r</sup>,64,39,30,7,C*9+73+Str0,1
:sub(BUT<sup>r</sup>,64,55,30,7,C*9+135+Str0,1
:sub(BUT<sup>r</sup>,64,47,30,7,C*9+153+Str0,1
:Text(3,12,C*9+19+Str0
:Text(32,12,S►Dec
:sub(BUT<sup>r</sup>,30,12,7,7,0,0
:Text(3,24,C*9+37+Str0
:sub(BUT<sup>r</sup>,30,24,17,7,5*C+(10*L)+91+Str0,1
:Text(31,36,T►Dec:Text(39,36,T+1►Dec:Text(35,36,"-"
:Text(3,36,C*9+55+Str0
:sub(BUT<sup>r</sup>,30,36,14,7,0,0
:Pt-Change(88,1,Pic1+32
:ClrDraw<sup>r</sup>StorePic
:Return
:
:Lbl 2
:Pt-On(X,Y,Pic0
:Pt-Change(X,Y,Pic0
:Pt-On(X,Y,Pic0+8
:Return
:
:Lbl BUT
:If r<sub>6</sub>:Text(r<sub>1</sub>+2,r<sub>2</sub>,r<sub>5</sub>:End
:rref(r<sub>1</sub>,r<sub>2</sub>,r<sub>3</sub>,r<sub>4</sub>
:Pxl-Off(r<sub>1</sub>,r<sub>2</sub>
:Pxl-Off(r<sub>1</sub>,r<sub>2</sub>+r<sub>4</sub>-1
:Pxl-Off(r<sub>1</sub>+r<sub>3</sub>-1,r<sub>2</sub>
:Pxl-Off(r<sub>1</sub>+r<sub>3</sub>-1,r<sub>2</sub>+r<sub>4</sub>-1
:Return
:
:Lbl MOS
:1:ReturnIf (X≥r<sub>1</sub>) and (Y≥r<sub>2</sub>) and (Y<(r<sub>2</sub>+r<sub>4</sub>)) and (X<(r<sub>1</sub>+r<sub>3</sub>))
:0:Return
:
:Lbl A
:48→X:32→Y→H
:sub(DRW
:DispGraph
:Pause 450
:Repeat W or (getKey(54) and sub(MOS,66,39,27,7))
:getKey(15)→W
:If sub(MOS,88,1,7,7) and getKey(54):1→W:End
:If sub(MOS,66,47,27,7) and getKey(54):1→W:End
:If sub(MOS,66,55,27,7) and getKey(54):DelVar Str9:Goto 0:End
:sub(2
:DispGraphClrDrawRecallPic
:If Y>0 and getKey(4):Y-1→Y:End
:If X>0 and getKey(2):X-1→X:End
:If X<95 and getKey(3):X+1→X:End
:If Y<63 and getKey(1):Y+1→Y:End
:If sub(MOS,30,24,20,7) and getKey(54):1→H
:L+1^2→L:End
:If sub(MOS,30,12,7,7) and getKey(54):1→H
:S+1^5→S:End
:If sub(MOS,2,55,47,7) and getKey(54):1→H
:E+8^16→E:End
:If sub(MOS,30,36,14,7) and getKey(54):1→H
:T+1^6→T:!If T:1→T:End:End
:
:If H
:Pause 120
:ClrDraw
:sub(DRW
:0→H:End
:End
:If W:Goto END:End
:Goto B
:.CLOSER
:Lbl END
:Fix 4
:If E
:1→{Z+3}
:S→{Z+4}
:L→{Z+5}
:T→{Z+6}
:End
:If Θ
:Archive Str9
:End:Return
:
:Lbl B
:
:Goto END
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: Snake X on April 18, 2011, 04:19:22 pm
hehe this reminds me of this one coffee maker that connects to the internet, but it can get haxed to make it turn on at will XD

Nice work anyhow! Quite a unique idea you've got there. Although I hope this wont require an expensive/country-limited coffee maker.. I myself am not a coffee drinker, but my dad is a coffee addict :P

edit: also at your first line of code.. that is one erranious name you got there xD
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: Freyaday on April 18, 2011, 04:20:23 pm
There's already a web standard for that:
HTCP
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: DJ Omnimaga on April 18, 2011, 05:13:58 pm
Hmm would that even be possible? ??? If so, then I assume it would only work on a very limited set of coffee maker? :P

It would be funny if that was actually done, though.
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: Freyaday on April 18, 2011, 06:37:38 pm
The hardest part would be getting the coffee back to the server, because in theory you could program a robot with coffee-maker recognition technology to figure out what buttons to press.
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: Deep Toaster on April 18, 2011, 06:40:27 pm
Heh, I like this idea. Then you could make the coffeemaker programmable in BASIC, like the TI Robot thing.
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: willrandship on April 18, 2011, 06:42:01 pm
Umm....conveyor belt? They're fairly reliable, providing you give them a soft start to avoid spills, and they can bring multiple coffees!
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: ztrumpet on April 18, 2011, 06:43:00 pm
That sounds pretty cool!  I like the idea, but I'm not sure what advice to give, other than Good Luck!! ;D
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: FinaleTI on April 18, 2011, 06:45:03 pm
There's already a web standard for that:
HTCP
I think it's HTCPCP (http://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol).
Just hope you don't run into error 418.
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: Freyaday on April 18, 2011, 06:53:57 pm
Yeah, cause short and stout entities tend to confuse coffee-maker recognizing robots.
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: Ashbad on April 18, 2011, 07:04:58 pm
I think it would be better done in assembly, IMHO ;) unless if you include Port Input/output opcodes into your code.  Because Axe is very limited in the way it can send data through ports.  It DOES have decent control over the link port, but not pitch perfect for all circumstances -- so my advice is to make the actual sending snippets in assembly, assemble, disassemble to hex, and copy the snippets in order ;)

If you do it like that it is very helpful to put something like 5 NOPs in between snippets for you to tell them apart.

Good luck!
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: zero44 on April 19, 2011, 07:38:12 am
When I had time, in a school hour  :devil:, I made a list of commands between arduino and calc.
Correct me if I'm wrong, but :
• the calc can send a byte
• the byte goes into Arduino's port's buffer in a wait file
• Arduino read the byte
• Arduino may send a byte
• calc's Get( funtion returns Arduino's byte ...
No ?

Command list :
Spoiler For commands:
205 - is there sugar ?
208 - yes
200 - no
145 - is there milk ?
148 - yes
140 - no
035 - is there water ?
038 - yes
030 - no
065 - is there coffe ?
068 - yes
060 - no
122 - send 100mL of water !
125 - send ...
1•• - ... ••mL ...
126 - ... of water !
123 - done
222 - send 50mL of milk !
225 - send ...
2•• - ... ••mL ...
226 - ... of milk !
223 - done
207 - send a sugar !
203 - done
075 - make hot for ...
0•• - ... 20*•• ...
076 - seconds !
073 - done
*** - GENERIC - ***
008 - yes
000 - no
003 - done
001 - error
009 - repeat
Calc's questions
Calc's orders
Arduino's answers
Arduino's orders
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: jnesselr on April 19, 2011, 07:51:25 am
Not a bad protocol there.  You are using the I/O port, right?
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: zero44 on April 19, 2011, 07:55:55 am
yes ...
the Get( and Send( axe command receives or sens a bytes , doesn't it ?
The arduino function 'Serial.begin(int fast);' set the number of bits/second, but how many bit/second can support my TI 83+ ?
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: zero44 on April 20, 2011, 03:59:08 am
UP !

Now I've no arduino card, and I'll never buy one if I don't know what and how to made with !
I had a second crazy project, with the RC system of my old nikko rc car :
A prgm to pilot the car with car, and maybe a bw camera ...
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: zero44 on April 22, 2011, 07:30:55 am
Hey !

I've put all commands I said higher in the program, but if nobody goes on this topic I'll kill you maybe let this project die. With all others ...
I think I'll need help to program on arduino (I'll take arduino mini pro, make I a big error ?), cause I don't want to burn the card when I'll have it ...
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: jnesselr on April 22, 2011, 07:37:09 am
I would just get an arduino uno (Considering you can't program a mini, IIRC, unless you have an FTDI cable).  You have to realize, though, although this would be cool, many people wouldn't use it everyday.  Of course, that's not to say you shouldn't continue it, but for your own reasons, not necessarily for other users. Plus, this seems to be very coffee pot-specific, too.  I would say, continue it as a project for yourself, but not necessarily for everyone else.

Also, The Send( and Get( commands won't work, unless you have the arduino acknowledge them like another calc.  You'll have to talk to quigibo about the exact specs of that.
Title: Re: CalCup : a coffee maker link to your calc ...
Post by: DJ Omnimaga on April 22, 2011, 09:12:24 pm
What graphmastur said. I'm sure a few might find this useful, but I mean it's not gonna be as popular as Mario or Zelda, for example. I don't know about France, but in North America not a lot of students drink coffee at all. Also there's the fact it would require a specific kind of coffee pot.

It can be a nice project to experiment with stuff, though, and if you manage to do it, you should make a video and post it in this topic or in the hardware/technology board.