Few troubles with ardublock

Hello everyone, i’m a student and i must build a project for my A-level.

It is about a skylight window which can be opened and closed according to the weather, as an example, when it’s raining, the window will close, or when the inner room temperature is too high, it will open.

We will use an arduino board to control the system, and the ardublock software to compute the board. But i’ve got a question : how can i include a priority function ? is there a special block ?

and the ardublock software to compute the board

What software are you talking about?

can i include a priority function ?

What do you mean by “a priority function”?

i'm using the software ardublock, it is tool of the arduino original computing sofware.
It is supposed to be easier to compute.
by priority function, i mean that when it's raining, the window should close itself and don't open because of the warm until it's raining. it's a main function.
sorry for my bad english, i'm a french student but there is absolutely no way to ask that kind of question on a french forum because these technologies are almost unknow.

it is tool of the arduino original computing sofware.

I’ve been using Arduinos for a while now. I’ve never heard of this software. If you won’t provide a link to it, good luck using it.

Since there appears to some requirement that you use the software, your questions should be addressed to whoever is mandating it’s use. I’d have the software written by now not using ardublock. From a software point of view, what you need to do is nearly trivial.

here is a link about the software : http://blog.ardublock.com/

I can understand that these task can be trivial for some people, but i never compute anything, so this is totally new for me. i can't rely on a professor to explain me, because no one of them know these software.

because no one of them know these software.

Then they should not be requiring you to use them.

Seems like a good starting point for you. You have events - it started raining, it got cold, it got hot, etc.

Pseudo code :

if ( too_cold || its_raining )   // if temperature drops below a desired temperature OR it's raining close the window
{
close_window;
}

if ( too_hot &&  ! its_raining)   // if temperature is too high AND it's NOT raining open the window 
{
open_window;
}

Pseudo code :

Which fails to address the issue of how to do that with Ardublock, which is a requirement that OP has. A stupid one, in my opinion, unless the purpose of the project is to force OP to learn about Ardublock rather than to actually open or close a window based on environmental factors.

Hi,

Despite what some of the other posters have said, these building block style programs can be a good way to get started in programming so don’t get put off.

There are several ways to achieve what you’re after, but the following should work.

  1. Create a first if block that asks if it’s dry outside as it’s condition.

  2. Within the then portion of the first if block, create a second if block.

  3. This second block should ask if it’s too hot, and then take appropriate action - in your case open a window.

The way the code works, if the first if block is false (i.e. it’s raining) it will reach the second.

Hope that helps!

I took Ardublock as CodeBlocks.... :blush: I've never used Ardublock but i believe simple IF statements can be implemented..

PaulS:

Pseudo code :

Which fails to address the issue of how to do that with Ardublock, which is a requirement that OP has. A stupid one, in my opinion, unless the purpose of the project is to force OP to learn about Ardublock rather than to actually open or close a window based on environmental factors.

Not sure you're grasping that the poster appears to just starting out in programming, I'm not sure lambasting him for doing what his highschool teacher has told him to do is particularly constructive.

But each to their own

I’m not sure lambasting him for doing what his highschool teacher has told him to do is particularly constructive.

I’m not attacking OP for wanting/needing to use Ardublock. All I was saying is that if the high school (or college) teacher says “You WILL use this tool”, then the teacher is the one who should be answering the how-to questions.