M

unread,
Apr 18, 2018, 11:54:41 AM4/18/18
to mitappinv...@googlegroups.com
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Abraham Getzler

unread,
Apr 18, 2018, 3:53:59 PM4/18/18
to MIT App Inventor Forum
You are asking two questions ...

How to add a middle level value:
Add extra codes to the Arduino to send for different levels, like
a,b,s,d for 4 levels, or h = half full.
Add extra IF/then/ELSEIF parts to your IF/THEN check of the code for the other code values,
using the blue mutator box on the IF block.

How to stop the sound using Button1:
There are two ways to do it:

  1.  Have the start/stop button switch the Clock1.Enabled value on/off, using the NOT block. 
Rename the button to btnStartStop,
Change its text to Start
When clicked , if button text = Start, switch to 'Stop' else switch to 'Start'
set Clock1.Enabled to not(Clock1.Enabled)

  2.  Have the button only silence the alarm sound but keep checking:
Rename the button to btnAlarmOnOff,
Change its text to 'Alarm On'
When clicked , if button text = 'Alarm On', switch to 'Alarm Off' else switch to 'Alarm On'
In Clock1.Timer, before turning on sound, check if btnAlarmOnOff.Text = 'Alarm On' before letting it play the sound.

ABG


M

unread,
Apr 19, 2018, 6:49:35 PM4/19/18
to mitappinv...@googlegroups.com
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Abraham Getzler

unread,
Apr 19, 2018, 9:32:16 PM4/19/18
to MIT App Inventor Forum
From what I see in your Arduino code,
you are sending a 
  '1' for full, 
 '2' for empty, and
 '3' for half full.

Since all your transmissions are single letters, you only
need to request 1 byte at a time (if there are bytes available.)

If you can't figure out the blocks part,
post your exported .aia file here so some one
still awake can add them for you.

ABG
P.S.  I am not a Doctor.

M

unread,
Apr 20, 2018, 6:07:41 AM4/20/18
to mitappinv...@googlegroups.com
this is my project I saved as aia and uploaded.

If you're not Dr I wish you will be : )) 

Abraham Getzler

unread,
Apr 20, 2018, 8:57:47 AM4/20/18
to mitappinv...@googlegroups.com
See attached for how I did it.

I dumped your extra label and used only one label, for simplicity.
The extra labels did not seem necessary to me, since all you were doing
was changing text and background color.
If you want to fancy this up, send the delay value and display it on a canvas bar graph.

Your 1 ms clock speed was way too fast, so I slowed it down to 100ms.

I also switched the button to a Mute/Play option,
where it displays what will happen if you push it,
and renamed it for my sanity.

It's up to you to test this.

ABG
(attachments deleted per OP request - ABG)

Abraham Getzler

unread,
Apr 20, 2018, 9:00:20 AM4/20/18
to MIT App Inventor Forum
Oh, and I switched from the Sound component to a Player component,
to get the Player block that tells me if the Player is still playing the prior request.
This avoids overlap of the sound.

ABG

Message has been deleted

Abraham Getzler

unread,
Apr 21, 2018, 6:49:03 PM4/21/18
to MIT App Inventor Forum

Abraham Getzler

unread,
Apr 21, 2018, 6:51:39 PM4/21/18
to MIT App Inventor Forum
Message has been deleted

M

unread,
Apr 22, 2018, 1:16:13 PM4/22/18
to mitappinv...@googlegroups.com
you are king, it is work good thank you very much, just one more thing I need when be Full automatic show me number of trash like T1 
and I need one more line ( very good ).

Thank you, you make me happy

Abraham Getzler

unread,
Apr 22, 2018, 2:00:37 PM4/22/18
to MIT App Inventor Forum
when be Full automatic show me number of trash like T1 

???

What kind of number is T1?

ABg
 

M

unread,
Apr 22, 2018, 2:26:45 PM4/22/18
to mitappinv...@googlegroups.com
like name or number of trash and I need one more line ( very good )  :))

Abraham Getzler

unread,
Apr 22, 2018, 6:30:22 PM4/22/18
to MIT App Inventor Forum
like name or number of trash and I need one more line ( very good )  :))

I don't understand what you want.
Can you show us a picture of what you want?
 
ABG

M

unread,
Apr 22, 2018, 7:54:13 PM4/22/18
to mitappinv...@googlegroups.com
ok, now I have empty, good, Full and I need add one more is (very good).
than I need add text when be( just) Full show me text like (T1 location in building 1) .



Message has been deleted

M

unread,
Apr 27, 2018, 1:05:56 PM4/27/18
to MIT App Inventor Forum
please delete my project.
bro thank you very much I hope all best for you

Abraham Getzler

unread,
Apr 27, 2018, 1:22:16 PM4/27/18
to MIT App Inventor Forum
please delete my project

Deleted from thread.

To delete a project from AI2, use the Project pulldown option.

ABg
 
Reply all
Reply to author
Forward
0 new messages