Presentation is loading. Please wait.

Presentation is loading. Please wait.

Aeroponic Engineering and Vertical Farming

Similar presentations


Presentation on theme: "Aeroponic Engineering and Vertical Farming"— Presentation transcript:

1 Aeroponic Engineering and Vertical Farming
Optional Programming Activity

2

3 Programming Pin 13, the built-in LED light on the Arduino
Basic layout of the board. Learn how to program Pin 13 the built-in LED light on the Arduino. Programming Pin 13, the built-in LED light on the Arduino

4 Download Arduino IDE HTTPS://WWW.ARDUINO.CC/EN/MAIN/SOFTWARE
Download and install Arduino IDE. If using a Chromebook….. Download Arduino IDE

5 File > Examples > Basics > Blink

6 Blink is the name of the sketch or program
Blink is the name of the sketch or program. This program is going to turn on an LED for one second and then off for one second. Let’s learn the basic pieces of every program.

7 This is an example of a multiple line comment
/* This is an example of a multiple line comment */ // comment Anything in between /* */ and/or behind the // is a comment. Comments are used by the programmer to remind him or her what different parts of the program are doing.

8 Every Arduino program has two functions.
void setup(){} & void loop(){} Anything in between /* */ and/or behind the // is a comment. Comments are used by the programmer to remind him or her what different parts of the program are doing.

9 void setup(){} Code that goes between the curly brackets of the setup function runs once

10 pinMode () OUTPUT pinMode is a built in function that tells the Arduino if the pin is an INPUT or OUTPUT You need to tell the Arduino if the pin is an INPUT or OUTPUT. We use a built-in “function” called pinMode() to make LED_BUILTIN a digital output. A semicolon must be used to end a statement. It will separate elements of the program.

11 void loop(){} Code that goes between the curly brackets of the loop function runs over and over until the Arduino is reset or powered off

12 digitalWrite() HIGH = output of 5 volt LOW = output of 0 volts
digitalWrite ()function A function that “writes” a value of High(on) or Low(off) to a specific digital output pin. Writing a value of “High” to LED_BUILTIN will cause PIN 13 to turn on, and also cause the connected LED to turn on.

13 delay() 1s = 1000 ms delay() function
A delay simply tells the device to wait for a specified amount of time before moving on to the next line of code. Time is measured in milliseconds (ms).

14 Verify the code Compile the code and check for errors. Do this by clicking on the “Verify” button. It looks like a checkmark.

15 Connect the microcontroller to the computer with the USB cable

16 Tools > Board > Arduino/Genuino UNO
Select the type of board you are using

17 Tools > Port > your_serial_port
Windows COM#(Arduino/Genuino (UNO) Mac /dev/cu.usbserialXXXXXXXX The power LED on the Arduino will light Which serial port is the right one? Depending on how many devices you have plugged into your computer, you may have several active serial ports. Make sure you are selecting the correct one. A simple way to determine this is to look at your list of serial ports. Unplug your RedBoard from your computer. Look at the list again. Whichever serial port has disappeared from the list is the one you want to select once you plug your board back into your computer.

18 Upload the program to the Arduino
You should see blinking lights on the Arduino board. This shows that the program is being uploaded. Upload the program to the Arduino by clicking on the “Upload” button. It is an arrow pointing to the right. After the program uploads disconnect the Arduino from the computer.

19 Add jumper wires or alligator clip with pigtails to the Arduino board
Add jumper wires or alligator clip with pigtails to the Arduino board. Connect the other end of the wire to the hen house. The wire in pin 13 will connect to the positive piece of copper tape and the wire coming out of GND (ground) or negative piece of copper tape. Add the 9v battery to the battery holder. Connect to the Arduino and watch your lights blink on and off.

20 Change the length of time the pump is on and off.
Challenge! Change the length of time the pump is on and off. Turn the pump on for 5 seconds and off for 2 minutes.

21 Create a sketch of your own. File > New
Apply what you have learned a create a program of your own. File>New opens a new sketch or program.

22 New sketch Add comments…

23 Variables Define variables. A variable is a placeholder for values that may change in your code. You must introduce, or “declare,” variables before you use them. Variable names are case-sensitive!

24 Connect the microcontroller to the computer
Upload the program – disconnect the USB Connect the hen house with a pigtail to the breadboard Add the 9v battery to the battery holder Power up the bank of lights

25 Connect the microcontroller to the computer
Upload the program – disconnect the USB Connect the hen house with a pigtail to the breadboard Add the 9v battery to the battery holder Power up the bank of lights

26 Learn more at….


Download ppt "Aeroponic Engineering and Vertical Farming"

Similar presentations


Ads by Google