Question: Task is to be done in thinkerCad Task 2.2: Create a new Arduino program that does the following: 1. Create a global integer variable called

Task is to be done in thinkerCad

Task is to be done in thinkerCad Task 2.2: Create a new

Task 2.2: Create a new Arduino program that does the following: 1. Create a global integer variable called "counter" that keeps track of how many times the loop() function has executed. 2. Create another function called float x_from_line_and_y(float m, float yint, int y) that calculates the x value from the equation of a line and having the y value supplied. Hint: You might need to learn a bit more about what happens when you multiple an int by a float. Is the result a float? Is it an int? What if you assign a floating point value to an integer variable? 3. In the loop() function, print out the counter variable and the value that is returned from calling x_from_line_and_y0 with an arbitrary (non-zero) slope and y-intercept value, and the counter variable as the input y value. Also, put a delay of 1.9 seconds in the loop() function so that it doesn't execute too quickly

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!