[Music]
this film introduces the visual designer
for raspberry pi product with a simple
flashing LED project select the
flowchart option from the new project
wizard and then choose raspberry PI's to
family and the Pi 3 is the controller
when you complete the new project wizard
you'll find at the Raspberry Pi
component has been placed on the
schematic for you and a blank flowchart
has been created for your program our
first task now is to add the LED in
button to the project and visual
designer right-click on the project tree
and select the add peripheral command
now switch to breakout peripherals and
then double-click on one of the LEDs to
add it to our project repeat the process
to add a button to the project and then
close the dialogue if you switch to the
schematic you'll see the peripherals
have been also placed for you the wiring
might look a little odd because the
connections are made by terminals any
two terminals with the same name are
connected together since we are going to
control the LED and button from the GPIO
lines of the Raspberry Pi we need to
make sure that we have connected the
peripherals to the GPIO pins on the
Raspberry Pi we do this simply by
changing the terminal name on the
peripheral but you may need the
Raspberry Pi pin out to choose a general
purpose GPIO pin to connect to
connected up the electronics we need to
write the controlling program to switch
back to the visual designer module the
beauty of visual designer is that you
can expand the peripherals in the
projectory to access their methods for
example if we expand the LED peripheral
we can simply drag and drop the on
method into the loop routine
the button doesn't have any expandable
methods because the only thing we need
to note is whether it is being pressed
and for that we have what we call a
sensor function a sensor function for
the button will return true if it is
pressed and false if it isn't if we drag
across on the button on to the flow
chart we'll actually get a decision box
will allow us to split our code into two
paths depending on whether the button is
being pressed at the moment we are
constantly testing if our button is
being pressed and turning the LED on if
it is however we still need to tell the
program what to do if the button is not
pressed we want to turn the LED off so
drag and drop the off method into some
free space alongside the other routine
now click on an output node on the
decision blog and then click on the
input node at the top of the off routine
complete the program flow by connecting
from the bottom of the off routine to
the main loop that's it press the play
button to run the simulation and test
out the program
when you click on the button the LED
should light up and when you release the
LED should turn off the last step would
be to program the physical Raspberry Pi
you first need to configure the PI for
used approaches which is discussed in a
separate movie assuming this is done you
go to the program setting dialog select
our PI SSH as the interface and specify
in the IP address or the host name of
the device then hit the program button
to automatically upload your firmware to
the physical device