04-16-2015 02:23 PM - edited 04-16-2015 02:28 PM
Hi I need to create a program that serves naturally " imagine " is used to create a machine that creates candy candy 10g +/- 2g and after there is a balance that weighs and those between 9:11 preserves while other discards , those taken should be stored in a bag 1kg and just arrived to fill the bag on a display must indicate the candy in the bag and the discard .
I am attaching what I managed to do so far
Salve devo creare un programma che serve naturalmente "immaginiamo" serve per creare una macchina di caramelle che crea caramelle di 10g +/- 2g e dopo ci sia una bilancia che le pesa e quelle comprese tra 9 e 11 le conserva mentre le altre le scarta, quelle prese devono essere conservate in un sacchetto da 1kg e appena arrivati a riempire il sacchetto su un display bisogna indicare le caramelle nel sacchetto e quelle scartate.
Vi allego quello che sono riuscito a fare fino ad ora
04-16-2015 03:59 PM
Use consistent datatype, dont constantly mix blue and orange.
Try the "in range and coerce function" from the comparison palette.
Learn about shift registers to accumulate the counts.
04-17-2015 05:12 AM
You are almost there.
Consider using also a "not equal to zero" to +1 the number of candies.
Then with shift registers you can transport from one cycle to another the numbers!