Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

AVR Programming Need to convert this set of code without using arduino libraries. Assembly code. IR Breakbeam sensor demo! #define LEDPIN 13 Pin 13: Arduino

AVR Programming

Need to convert this set of code without using arduino libraries. Assembly code.

image text in transcribed

IR Breakbeam sensor demo! #define LEDPIN 13 Pin 13: Arduino has an LED connected on pin 13 Pin 11: Teensy 2.0 has the LED on pin 11 Pin 6: Teensy++2.0 has the LED on pin 6 Pin 13: Teensy 3.0 has the LED on pin 13 #define SENSORPIN 4 variables will change: int sensorState 0, lastState-0; reading the pushbutton status variable for void setup0 initialize the LED pin as an output: pinMode(LEDPIN, OUTPUT); finitialize the sensor pin as an input: pinMode(SENSORPIN, INPUT) digitalWrite(SENSORPIN, HIGH);turn on the Serial.begin(9600); void loop0 f read the state of the pushbutton value: sensorState- digitalRead(SENSORPIN); // check if the sensor beam is broken / if it is, the sensorState is LOW: if (sensorStateLOW) / turn LED on: digitalWrite(LEDPIN, HIGH); else t ff turn LED off digitalWrite(LEDPIN, LOW); if (sensorState && !lastState) Serial.println"Unbroken") if (sensorState&& lastState) Serial.println"Broken)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago