Tôi yêu Arduino gửi vào
- 11911 lượt xem
Bạn đã biết đến Hoodloader2 cho bài của bạn HACK NÃO đúng không nào? Hôm nay, mình sẽ chỉ cách xóa, vì nhiều lúc mình chỉ cần con atmega328 thôi. Mà cứ mỗi lần nạp cho nó thì phải qua bước kiểm tra con atmega16u2 thì chán quá.



Mình tham khảo đoạn code.
/* Copyright (c) 2015 NicoHood See the readme for credit to other people. HoodLoader2 Run Bootloader example Starts Bootloader mode. This is useful if you only want to use the Fast USB-Serial bridge again. https://github.com/NicoHood/HoodLoader2/blob/master/avr/examples/RunBootloader/RunBootloader.ino You could delete the firmware with avrdude, but this sketch is way simpler to upload for beginners. It forces a watchdog reset, meaning the bootloader is started completely independant. */ #include <avr/wdt.h> void setup() { // close interrupts cli(); // write magic key to ram *(uint16_t*)MAGIC_KEY_POS = 0x7777; // watchdog reset wdt_enable(WDTO_120MS); } void loop() { // wait for reset }Bạn bật Arduino lên và nạp đoạn code kia cho Arduino USB MCU (atmega16u2/atmega32u4) là ok.