File component issue (Using Bluetooth, TinyDB to control a Plant watering system)

Hi Patryk

I recieved the newDSD Tech board today and had a chance to try out your version of the clock.aia It connects to the board, I can set the different on off times, when I press START it runs through the list. Doesn't turn the relay On or Off but I think is't just because I am not sending the code to do that.

I appreciate all the help. Is it possible we could work on the version I have created. I kind of has my signature design of the way my apps look and feel. I would like to keep my design layouts the same for all the products I produce. I hope you understand. I feel that what I have programmed is pretty close to working but I am missing something. The fact that it drops through the btn_start but is turning the relay on and off without using the textbox info tells me I am on the right track.

I hope you can understand where I am coming from. Again thank you for your help

My version sends the text string ON or OFF via BLE. I don't know what your version sends, you need to customize the text sent.

Hi Patruk

My version also sends a custom string using the procedures. I can visually see and hear the relay turn on and off but the routine drops through the entire btn_Start routine ignoring the times that where entered in the text boxes. The relay is turning on and off so I know it sees that portion and send a signal to the relay board to turn the relay on and off. At the last time that is set in the routines last text box with timing information set in it, it cycles through the time that is set because I print the information in a LABEL which displays the time as it counts down. called lbl_TimeStatus.text (Lower left corner across from start button). But it only shows the count down time that is set in the last Text Box which has valid time set in it.

RelayOn and RelayOff

The other portion which I haven't shown allows the user to enter plant names and choices for "feeding", watering" and "flushing" they can enter what ever timing values needed for different plants and in the areas "feeding" "watering' or "flushing'. that information is stored in separate files for each plant and the process that is being executed i.e. "feeding", "watering" or "flushing". The two list boxes labeled "Plant Type" and "Water Mode" are combined to create the File name to save timing information..

I hope I have provided enough information for you to get a clearer understanding of what I am trying to do. If you need more Please Patryk let me know.

Thank you so much for your help.

My program uses the clock. Retrieves data from a list. Analyze my blocks to understand what the clock is doing. In your application you can also set up a sending list instead of reading it from text fields. Text boxes can only be used to edit the list.

So after starting the application, download the data from TinyDB to the list. Then from the list to the text boxes. After editing the text fields, save the data to the list and to TinyDB. After pressing start, download data from the list to form a message for BLE in the clock.

Hi Patryk

That's my problem I can not follow it's use!I DO NOT understand it,it seems simple on the surface but does NOT perform as I would expect it to. To abstract for my simple 90's brain!!!

ALSO, should I use maybe some other input for the timer setting? I mean beside a LISTBOX!.

Yeaks! this is relly dragging out way too long! I know I'm close that fact that it sees the last text box in the list and uses THAT value and actually counts it down tells me so.

Besides I understand the listbox. I understand it, i am using it for the file names and watering types but I just DO NOT want to use it for the timer values!. Please Patryk I implore you, show me what I am missing in the btn_Start routine.

Again thanks for the help.

This PastPresentFuture app's data storage design would be useful for arranging multiple future event requests in TinyDB.

It does not address the question of how to encode work requests as TinyDB values or how to interpret them when they come due.

It's all about the tags and the TinyDB storage.

Sorry Patryk PTSD kicking in from Vietnam war! Oop! That can sometimes get the better of me!

I did it like this. Be happy. There will be no next "ready" so learn from these examples.

clock (5).aia (195.5 KB)

Yeaks! Patrrk you completely wrote this from scratch. I will take me some time to digest this one.

Thank you.

Patryk I am having another issue. When I try to load the aia file my Illustrator wants to load it as a default reader. What is the default reader for the aia file and where can I find it? I am using an apple computer. Any idea?

There should be no reader for .aia files, unless you need to do surgery on them as a last resort.

Set your web browser to just save downloaded .aia files to disk without opening, then use the AI2 Project->Import facility to load the .aia file from disk as a new project.

Thanks I will do that!

Thanks ABG that worked fine!

No. I changed a bit the code I put above.

I think we are getting closer Patryk. So what is the difference if the first column the relay is on all the time and the second column the relay is off all the time? That way you don't have to tell the user to type in the fact that it's on or off. And if the first and second column just indicate how long the relay is on or off? Is that an easy modification?

Also Patryk you are reconnecting every time to the relay board using the Service UUID and Character UUID is that the way to properly contact the Relay board. Is that incase it looses connection or just redundant?

  1. I don't understand much what you mean.
    (I do not speak English very well. I use google translator for the most part. The translator sometimes translates incorrectly and can therefore cause confusion.)

  2. The BLE extension has AutoReconnect options.

Hi Patryk I see your an early Bird too!

I guess what I am trying to say is column one you are forcing the user to indicate that the relay is ON or OFF. When they are trying to set the ON and OFF TIMES for each cycle. This can get confusing for them on which cycle they are trying to tweak with a long column and where all options are not completely visible to them . I can see the listbox has a great advantage over TextBoxes as you can conceivably have an infinite number of cycles. But why eliminate the need for the user to indicate if the relay needs to be ON or OFF. and not just put the ON and OFF TIMES side by side and maybe add the index number in front of it so the user knows what cycle they are working on.

The problem I see with a listbox is this: For instance cycle 3 and cycle 6 need tweaking the first on the ON time the second on the OFF time. Can you see how scrolling to the appropriate cycle could be confusing? Comparing that to having all cycles completely visible to them on and off times side by side on the same line. We already know that the Relay is always ON, on my layout in the first column and that the relay is always OFF in the second column it just a matter of specifying how much time for each.

Does that make more sense?

So what is the first column of textboxes in your app going to do? What is it for and what is written there.

What language do you speak Patryk? Pehaps I can rephrase my sentences so they make more sense.

I understand what you mean now. But why then the first column text fields? If the first cycle is ON, the next one is OFF and so on and on, what are the fields for?

Patrykk I hope this makes for sense.

The #1 column will indicate the relay ON time. The #2 Column would indicate the OFF time

or if you can have 3 columns on the same line it would look like this:

Cycle ON OFF
1 5 15
2 10 10
3 8 12

Column #1 indicates which cycle you are working on
Column #2 indicates relay ON time
Column #3 indicates relay OFF time