i have code in the Arduino ide for a temperature sensor that shows the temperature on three 7 segment displays, it shows the temperature to one decimal point. using an arduino uno. I am struggling to convert the below code to assembly. can someone please help?
#include <SevSeg.h>
#include "SevSeg.h" // Included the library for the 7 segment display
SevSeg sevseg; // Created an object
const int sensor_pin = A0; // initialized A0 for LM35 sensor
float tempc; //variable to store temperature in degree Celsius
float sensor_out; // variable to store the output
unsigned long interval = 1000; // the time we need to wait
unsigned long previousMillis = 0; // millis() returns an unsigned long.
void setup() {
pinMode(sensor_pin, INPUT); // Declared the sensor pin as Input
byte numDigits = 3; it to 3.
byte digitPins[] = {10, 11, 12};
segment displays
byte segmentPins[] = {9, 2, 3, 5, 6, 8, 7, 4};
pins of displays
bool resistorsOnSegments = true;
bool updateWithDelaysIn = true;
byte hardwareConfig = COMMON_CATHODE; // Type of display we are using
sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments);
sevseg.setBrightness(100);
}
void loop() {
sensor_out = analogRead(sensor_pin);
tempc = (sensor_out * 500) / 1024;
tempc = tempc - 32;
tempc = tempc * 5;
tempc = tempc / 9;
delay_function();
sevseg.refreshDisplay();
}
void delay_function() {
unsigned long currentMillis = millis();
if ((unsigned long)(currentMillis - previousMillis) >= interval) {
sevseg.setNumber(tempc, 1); // Sets temperature on display
previousMillis = millis();
}
}