I am trying to convert a float to an IEEE-754 Hex representation. The following code works on my Mac.
#include
#include
union Data {
int i;
float f;
};
int main() {
float var = 502.7;
union Data value;
…
Trying to build a menu system but running into some issues with pointers - which I don't have much experience with.
I don't understand why removing the while(1) makes the comparison fail between mainmenu_table[1][i] == &option6 but for some reason…
I have the makerfab sim808 and the documentation does not specify what is what that is returned in the gps raw data. The following is the data, has anyone worked with this and can let me know what is what.
GPS raw data:…
I am trying to count using the internal ATMega328 to create a Theremin based on this concept.
I am using the internal timer1 and timer0 counters. However, I am unable to find documentation for which pin to use as an input to trigger the…
Can somebody tell me how ATmega8 (or similar 8-bit proc.) implements math operation like subtraction, addition, division, multiplication on register logic?
Where can I read about speed of this operation? (I know that division and floating point…
My Arduino Mega (with CH340 but all the drivers needed installed) has stopped reading from the serial port. Doesn´t matter what I write it keeps saving number 50. I have tried with simple examples codes as this one:
int incomingByte = 0; // for…
I am trying to get readings from 3 rotary encoders (KY-040) and send values via UART.
I am using Arduino-Mega 2560 board but due to requirements reason I am programming it in C.
But when I try to get the reading from encoder I get random…
Ok, so a laser on earth hits a mirror on the moon and bounces back. On the ATmega128 microprocessor, we use TIMER1 to capture the clock ticks when the laser shot out and the clock ticks when it returned, subtract and get a "distance" in clock ticks.…
I want to make a code about accurate delay library in ATmega8 with winAVR as the compiler, do you have any idea to convert the code below to assembly? I have no idea to convert the code, because I don't understand assembly.
this is the code.
static…
my code is for atmega32 microcontroller for converting coordinates to nmea format how can i convert this to atmega16 code.
since it is using atmega32 library files
will this code work on atmega16 or some changes are required....
#include…
In the below code image bitwise left shift operator is used with the register for uart initialization,How does that left shift operator (1(left shift)RXEN),(1(left shift)) work when register bit(RXEN,TXEN) is not initialised
enter image description…
I recently met a problem when I was playing with an ATmega2560, and I really don't understand what's wrong with it.
Here is my code.
main:
#include "Definitions.h"
int main(void) {
Initialization();
while (1) {
//_delay_ms(1); // or…
I'm new to programming in AVR assembly, and I'm having difficulties understanding the following code.
.include "m328Pdef.inc"
main: ldi r22, 0x20
sts 0x0100, r22
ldi zh, 0x01
ldi zl, 0x00
ldi r20, 0x05
clr r22
ld r22, z
…