<div dir="ltr">The raspberry pi is not a real-time system, nor would the serial input automatically trigger an interrupt on the raspberry pi and the raspi digital input is unbuffered. Thus if the raspberry pi was too busy with all its multitasking it might miss the input from the bill acceptor and money would be accepted with nothing given in return. The arduino is there to provide buffered input. Right now it's not really doing that properly since it's just relaying immediately to the raspberry pi. What should happen is that it should buffer the input, then tell the raspberry pi and wait for an acknowledgement, buffering all input repeatedly telling the raspberry pi until acknowledgements are received. This also protects against raspberry pi crashes or crashes of the high level software running on it. Crashing the compiled program on the Atmega microcontroller on the other hand is much harder to do.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 22, 2018 at 3:25 PM, Thomas Levine <span dir="ltr"><<a href="mailto:_@thomaslevine.com" target="_blank">_@thomaslevine.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The vending machine now provides some more feedback after money is put in.<br>
<br>
Source code associated with my contribution is here. I haven't documented<br>
the other components of the vending machine.<br>
<a href="https://thomaslevine.com/scm/sudo-vending" rel="noreferrer" target="_blank">https://thomaslevine.com/scm/<wbr>sudo-vending</a><br>
<br>
Based on the implementation details, it appears to me that<br>
the bill acceptor is in fact plugged into one board (Arduino Leonardo)<br>
that is connected by serial to another board (Raspberry Pi). Why is<br>
the former board used at all? That is, why is the bill acceptor not<br>
plugged directly into the latter board?<br>
______________________________<wbr>_________________<br>
sudo-discuss mailing list<br>
<a href="mailto:sudo-discuss@lists.sudoroom.org">sudo-discuss@lists.sudoroom.<wbr>org</a><br>
<a href="https://sudoroom.org/lists/listinfo/sudo-discuss" rel="noreferrer" target="_blank">https://sudoroom.org/lists/<wbr>listinfo/sudo-discuss</a><br>
</blockquote></div><br></div>