Q.1) If an int array is defined by (int Num[4] = {3,6,12,15);), write a sketch over TinkerCAD to scan the elements of th
Posted: Sat Nov 27, 2021 2:37 pm
term in a single Serial.println sentence. i.e. Serial.println(put your equation here); 8. Floor result of 7 using one equation in a Serial.println sentence. Q.3) A Temperature sensor reads temperature values in the range (-10,50) with an accuracy error of +0.05 degree Celsius. Use random function with a floating seed to generate 10 float number that represents 10 possible readings of the sensor. Generated float numbers shall have no decimal digits (for example 1.00 or 15.00 or -3.00 and so on), then add to each randomly generated value an accuracy error, that is also randomly generated, in the range (-0.05 to +0.05). Include your code and a screenshot of the printed output. Below is an example of 10 randomly generated readings with the accuracy error added: 2.40 21.60 41.40 -10.50 48.50 35.10 19.20 23.90 26.80 35.30 Q.4) Examine below circuit plus developed sketch. Fill below LED/pins status timetable when you execute the sketch: 1 // HW 4__4 2 int pins[] = {0,1,2,3,4,5,6,7}; 3 int i; 4 byte LEDs = 183; 5 void setup() 6 1 Serial.begin(9600); Serial.println (LED, BIN); for(i=0; i<8;1++) 10 pinMode (pins, OUTPUT); digitalWrite(pins, bitRead (LEDs, 1)); } delay(5000); } void loop() 19 20 22 DIGITAL (PWM) bitclear (LEDS, 1); bitclear (LEDs, 4); bitWrite (LEDs, 7, 0); bitset (LEDs, 6); O UNO ARDUINO for(i=0;i<8; 1++) 23 24 25 20 27 28 29 digitalWrite(pins, bitRead (LEDs, i)); 1 1 Serial Monitor LED @ pin 5 LED @ pin 4 Pin 3 LED @ pin 2 Pin 1 Time (sec) 0-1 LED @ pin 7 ON Pin 7 HIGH Pin 6 LOW Pin 0 HIGH 1-2 2-3 3-4 4-5 5-6 6 to infinity