• Grading: This assignments counts for 10 points of extra credit toward your homework grade. Filename Example
  • Homework Beginning Programming with Tinkercad




    Download 0.64 Mb.
    Pdf ko'rish
    bet1/3
    Sana07.12.2023
    Hajmi0.64 Mb.
    #113559
      1   2   3
    Bog'liq
    tinkercad-volts



    Homework - Beginning Programming with Tinkercad
    Objective:
    Program an Arduino on Tinkercad using the language Scratch.
    To turn in:
    I will view your Arduino/Scratch code through the Tinkercad website.
    Grading:
    This assignments counts for 10 points of extra credit toward your homework grade.
    Filename Example: fischerAl_tinkercadVolts.png
    Introduction
    In the previous exercises on Tinkercad and in class, you learned to program an Arduino to output a signal
    to turn a light on and off. Arduinos can also receive inputs – that is, read data from other devices. These
    inputs can be either analog or digital, but this exercise will focus on analog signals. Unsurprisingly, reading
    an analog signal involves connecting the device to an analog input on the Arduino/Teensy, which are usually
    labeled A0, A1, A2, and so on. Once the device is connected, the voltage (electrical signal) it outputs can
    be read by the Arduino using the command AnalogRead(pin);.
    Reading a signal can be useful if you want to use the Arduino in a feedback loop to (for example) maintain
    the temperature of a room at a specific set point or log data to a file. However, it’s often more interesting
    if the data the Arduino reads is also displayed on the computer screen. This is done using a feature of the
    IDE called the Serial Monitor. When using the Serial Monitor, the Arduino is programmed in such a way
    as to write data to the computer’s serial port (through the USB port). The Serial Monitor then reads the
    data from the computer’s serial port and displays it as text on the screen. The Serial Monitor is useful
    for displaying data on the screen, but is also one of the best tools for debugging code (finding errors) as it
    provides a visible indicator of what the program is done and what might be going wrong.
    In this exercise, you’ll use Tinkercad to develop a sketch to read the voltage from a potentiometer and print
    the value to the serial monitor. You will also use a variable to store a value. This code will be very similar
    to the code you use to read the temperature in lab.

    Download 0.64 Mb.
      1   2   3




    Download 0.64 Mb.
    Pdf ko'rish

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    Homework Beginning Programming with Tinkercad

    Download 0.64 Mb.
    Pdf ko'rish