0% found this document useful (0 votes)
34 views4 pages

Sensory Input: Programmer, Voltage Regulators Seral To USB Converter

Robots need sensors to receive input from the environment which microcontrollers handle. Arduinos are inexpensive development boards containing a microcontroller, programming support, and various peripherals that allow control of inputs, outputs, analog signals, and pulse-width modulation. The Arduino programming language uses setup() and loop() functions, with loop() running code continuously. Digital and analog I/O, timers, and serial communication are common peripherals that can be controlled through functions like pinMode(), digitalWrite(), and AnalogWrite().

Uploaded by

Hema hree
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views4 pages

Sensory Input: Programmer, Voltage Regulators Seral To USB Converter

Robots need sensors to receive input from the environment which microcontrollers handle. Arduinos are inexpensive development boards containing a microcontroller, programming support, and various peripherals that allow control of inputs, outputs, analog signals, and pulse-width modulation. The Arduino programming language uses setup() and loop() functions, with loop() running code continuously. Digital and analog I/O, timers, and serial communication are common peripherals that can be controlled through functions like pinMode(), digitalWrite(), and AnalogWrite().

Uploaded by

Hema hree
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Sensory Input

Robots need to be able to


recieve input from the
world in the form of sensory
input.
Microcontrollers handle this

input.
Thousands of sophisticated

sensors available
Arduino
Development board for the
ATMega328
Inludes

Programmer,
Voltage Regulators

Seral to USB Converter

CHEAP $
30! Has everything you need
Arduino C
Template
void setup() {
// Setup stuff to only run once at the
beginning
}
void loop()
{
// This function gets called indefinatly

Peripherals
Analog to Digital
Converters (ADC)
Counters/Timers (TMRx)

PWM Modules (CCP/PWM)

Serial Ports (UART)

Many, many more....


Digital I/O
Only HIGH and LOW values
Each pin configurable to do

input or output
pinMode(pinNumber, pinState)
pinMode(13, INPUT)

pinMode(13,

OUTPUTArduino
Digital I/O
Example
int ledPin = 13;
void setup() {
// Set the digital pin as output:
pinMode(ledPin, OUTPUT);
}
void loop()
{
// Bring the pin high (1)
digitalWrite(ledPin, HIGH);
})

Arduino PWM
Command
AnalogWrite(Pin,
DutyCycle)
DutyCycle = 0 0%, 127
50%, 255 100%
Pin can be 3, 5, 6, 9, 10, or 11

Frequency of about 490Htz


Other periods are possible, but
not with AnalogWrite

You might also like