diff --git a/3-99 Research/3 ARCADE/I2C/main.c b/3-99 Research/3 ARCADE/I2C/main.c index 03663c263..90a17b80d 100644 --- a/3-99 Research/3 ARCADE/I2C/main.c +++ b/3-99 Research/3 ARCADE/I2C/main.c @@ -1,5 +1,3 @@ -#define F_CPU 16000000UL - #include #include @@ -17,8 +15,8 @@ int main(void) { // Clear PB5: LED OFF PORTB &= ~(1 << PB5); - _delay_ms(1000); // Delay 1000 milliseconds (1 second) - } + _delay_ms(1000); // Delay 1000 milliseconds (1 second) } - return 0; // Though this line is never reached because of the infinite loop + return 0; // Though this line is never reached because of the infinite loop + } } diff --git a/3-99 Research/3 ARCADE/I2C/main.elf b/3-99 Research/3 ARCADE/I2C/main.elf index e9c484bc6..30a70dd56 100755 Binary files a/3-99 Research/3 ARCADE/I2C/main.elf and b/3-99 Research/3 ARCADE/I2C/main.elf differ diff --git a/3-99 Research/3 ARCADE/I2C/main.hex b/3-99 Research/3 ARCADE/I2C/main.hex index 455ba7243..c99064111 100644 --- a/3-99 Research/3 ARCADE/I2C/main.hex +++ b/3-99 Research/3 ARCADE/I2C/main.hex @@ -5,74 +5,9 @@ :100040000C943E000C943E000C943E000C943E0038 :100050000C943E000C943E000C943E000C943E0028 :100060000C943E000C943E0011241FBECFEFD8E04C -:10007000DEBFCDBF0E9440000C9465020C940000CE -:10008000CF93DF93CDB7DEB76C970FB6F894DEBF92 -:100090000FBECDBF84E290E0FC01208184E290E0BD -:1000A0002062FC01208385E290E0FC01208185E252 -:1000B00090E02062FC01208380E090E0AAE7B4E4B5 -:1000C0008F87988BA98BBA8B20E030E04AE755E404 -:1000D0006F85788989899A890E94D001DC01CB01DA -:1000E0008B8B9C8BAD8BBE8B20E030E040E85FE3D8 -:1000F0006B897C898D899E890E944A0188232CF412 -:1001000081E090E0988F8F8B3FC020E03FEF4FE77A -:1001100057E46B897C898D899E890E94CB011816D2 -:100120004CF520E030E040E251E46F857889898920 -:100130009A890E94D001DC01CB01BC01CD010E9453 -:100140004F01DC01CB01988F8F8B0FC080E991E0CC -:100150009A8F898F898D9A8D0197F1F79A8F898F60 -:100160008F89988D0197988F8F8B8F89988D892B88 -:1001700069F714C06B897C898D899E890E944F0123 -:10018000DC01CB01988F8F8B8F89988D9C8F8B8F03 -:100190008B8D9C8D0197F1F79C8F8B8F85E290E082 -:1001A000FC01208185E290E02F7DFC01208380E02E -:1001B00090E0AAE7B4E489839A83AB83BC8320E010 -:1001C00030E04AE755E469817A818B819C810E9405 -:1001D000D001DC01CB018D839E83AF83B88720E003 -:1001E00030E040E85FE36D817E818F8198850E94D9 -:1001F0004A0188232CF481E090E09A8789873FC0E8 -:1002000020E03FEF4FE757E46D817E818F81988535 -:100210000E94CB0118164CF520E030E040E251E49A -:1002200069817A818B819C810E94D001DC01CB01A4 -:10023000BC01CD010E944F01DC01CB019A87898767 -:100240000FC080E991E09C878B878B859C85019707 -:10025000F1F79C878B8789859A8501979A8789878B -:1002600089859A85892B69F714C06D817E818F817C -:1002700098850E944F01DC01CB019A878987898587 -:100280009A859E878D878D859E850197F1F79E873C -:100290008D8709CF0E947E0108F481E008950E94B5 -:1002A000AA0188F09F5798F0B92F9927B751B0F05D -:1002B000E1F0660F771F881F991F1AF0BA95C9F7EA -:1002C00014C0B13091F00E94C401B1E008950C94C3 -:1002D000C401672F782F8827B85F39F0B93FCCF376 -:1002E000869577956795B395D9F73EF49095809567 -:1002F000709561957F4F8F4F9F4F0895990F00081C -:10030000550FAA0BE0E8FEEF16161706E807F907E7 -:10031000C0F012161306E407F50798F0621B730B82 -:10032000840B950B39F40A2661F0232B242B252B03 -:1003300021F408950A2609F4A140A6958FEF811DA6 -:10034000811D089557FD9058440F551F59F05F3F88 -:1003500071F04795880F97FB991F61F09F3F79F0E7 -:1003600087950895121613061406551FF2CF469569 -:10037000F1DF08C0161617061806991FF1CF8695EB -:100380007105610508940895E894BB2766277727CF -:10039000CB0197F908950E947E0108F48FEF08952C -:1003A0000E94E3010C9454020E94460238F00E941D -:1003B0004D0220F0952311F00C943D020C94430261 -:1003C00011240C94C5010E94A20170F3959FC1F302 -:1003D000950F50E0551F629FF001729FBB27F00DF3 -:1003E000B11D639FAA27F00DB11DAA1F649F662748 -:1003F000B00DA11D661F829F2227B00DA11D621F97 -:10040000739FB00DA11D621F839FA00D611D221F50 -:10041000749F3327A00D611D231F849F600D211D34 -:10042000822F762F6A2F11249F5750409AF0F1F0B7 -:1004300088234AF0EE0FFF1FBB1F661F771F881F20 -:1004400091505040A9F79E3F510580F00C943D0219 -:100450000C94C5015F3FE4F3983ED4F386957795FD -:100460006795B795F795E7959F5FC1F7FE2B880FC6 -:10047000911D9695879597F9089597F99F6780E85C -:1004800070E060E008959FEF80EC089500240A94E6 -:100490001616170618060906089500240A9412165F -:1004A0001306140605060895092E0394000C11F492 -:1004B000882352F0BB0F40F4BF2B11F460FF04C03F -:0E04C0006F5F7F4F8F4F9F4F0895F894FFCFCF +:10007000DEBFCDBF0E9440000C9458000C940000DD +:10008000259A2D9A2FEF83ED90E3215080409040E8 +:10009000E1F700C000002D982FEF83ED90E3215091 +:1000A00080409040E1F700C0000090E080E00895BB +:0400B000F894FFCFF2 :00000001FF diff --git a/3-99 Research/3 ARCADE/I2C/makefile b/3-99 Research/3 ARCADE/I2C/makefile new file mode 100644 index 000000000..1815a0b60 --- /dev/null +++ b/3-99 Research/3 ARCADE/I2C/makefile @@ -0,0 +1,41 @@ + +# Define the microcontroller type and clock frequency. +MCU = atmega328p +F_CPU = 16000000UL + +# Define the project name (source and output files) +TARGET = main +SRC = $(TARGET).c + +# Compiler and tools for AVR +CC = avr-gcc +CFLAGS = -mmcu=$(MCU) -DF_CPU=$(F_CPU) -Os -Wall +LDFLAGS = -mmcu=$(MCU) +OBJCOPY = avr-objcopy + +# avrdude settings: adjust the port (-P) to match your device +AVRDUDE = avrdude +AVRDUDE_FLAGS = -c arduino -p m328p -P /dev/ttyACM0 -b 115200 + +# Output file names +ELF = $(TARGET).elf +HEX = $(TARGET).hex + +# Default target: builds the HEX file +all: $(HEX) + +# Compile source file to an ELF executable +$(ELF): $(SRC) + $(CC) $(CFLAGS) $(SRC) -o $(ELF) + +# Convert the ELF file to an Intel HEX file +$(HEX): $(ELF) + $(OBJCOPY) -O ihex -R .eeprom $(ELF) $(HEX) + +# Flash the HEX file to the device with avrdude +flash: $(HEX) + $(AVRDUDE) $(AVRDUDE_FLAGS) -D -U flash:w:$(HEX):i + +# Clean up build files +clean: + rm -f $(ELF) $(HEX)