Posts

Showing posts with the label logic

Shakespeare?

Image
2B | !2B

Sous vide (in progress)

Image
Remark: Logic for a sous vide system Set lo w_temperature Set high_temperature Set start_time Set end_time Turn on heat Turn on led if end_time < start_time then stop. loop until time > end_time.     Get temperature     if temperature > high_temperature then turn off heat and turn off led     if temperature < low_temperature then turn on heat and turn on led     get time loop turn led off end The more I thought about this , it came to me you could use the same idea for an air conditioning system controller. of course the logic would have to be a bit different. Set lo w_temperature Set high_temperature Set mid temp range Set low temperature Set start_time Set end_time Turn off Heater and AC Turn on led if end_time < start_time then stop. loop until time > end_time.     Get temperature     if temperature > high_temperature then tur...

!Shakesspeare

Image

A bit of logic to code.

Image
Every program should have at least these two points: start and stop. A program is like a todo list. You could use English, Spanish, or a host of other languages to use your todo list. More on logic steps later. So with computer languages you can do the same thing.  Examples: in C #include <stdio.h> main() { } or In basic: rem start rem stop In Bash: #!/bin/bash # start # stop Of course that does not really do anything in that sequence. Now let's go to the beginner's hello world example and see how things change. Yes we are adding a step here in the sequence. Let's just use english for now. Examples: in C #include <stdio.h> main() {         printf("Hello, world.\n"); } In Basic rem start print "Hello, world." rem stop end Bash #!/bin/bash # start echo Hello, world. # stop You can not get any simpler than that for a start, In some ways you are an architect putting rooms together for a house such as a bedroom, bathroom, kitchen, den, l...

A bit of logic to code.

Image
Every program should have at least these two points: start and stop. A program is like a todo list. You could use English, Spanish, or a host of other languages to use your todo list. More on logic steps later. So with computer languages you can do the same thing.  Examples: in C #include <stdio.h> main() { } or In basic: rem start rem stop In Bash: #!/bin/bash # start # stop Of course that does not really do anything in that sequence. Now let's go to the beginner's hello world example and see how things change. Yes we are adding a step here in the sequence. Let's just use english for now. Examples: in C #include <stdio.h> main() {         printf("Hello, world.\n"); } In Basic rem start print "Hello, world." rem stop end Bash #!/bin/bash # start echo Hello, world. # stop You can not get any simpler than that for a start, In some ways you are an architect putt...