Change dead Bitbucket links to Sourcehut.

The arduino-pn532 repo wiki was not transferred
to Sourcehut and therefore is gone forever. Links
to the now dead wiki have been marked as broken.
M contents/avr-ada-122-f25-rpms.rst +1 -1
@@ 31,7 31,7 @@ And run:
 Notes:
 
 * The used GCC version is 4.9.2.
-* Instead of using normal .spec files + rpmbuild, I build the binaries with my `custom build script <https://bitbucket.org/tkoskine/avr-ada-build-script>`_
+* Instead of using normal .spec files + rpmbuild, I build the binaries with my `custom build script <https://hg.sr.ht/~tkoskine/avr-ada-build-script>`_
   and `fpm <https://github.com/jordansissel/fpm>`_ (for installation, you need only dnf).
 * The installation happens to /opt/avr-ada-122
 * The RPMs are unofficial in every possible way and they are not endorsed by Fedora or AVR-Ada projects.

          
M contents/avr-ada-122-rpi1-debs.rst +2 -2
@@ 22,11 22,11 @@ apt-get asks about the installation of t
 
 The installed binaries go to /usr/local/avr-ada-122 directory.
 
-The build script can be found from https://bitbucket.org/tkoskine/avr-ada-build-script (branch raspberry-pi-wheezy_).
+The build script can be found from https://hg.sr.ht/~tkoskine/avr-ada-build-script (branch raspberry-pi-wheezy_).
 
 Once the build script has compiled and installed avr-gcc and AVR-Ada, you can package the results with fpm::
 
    fpm -s dir -t deb -n avr-ada -v 1.2.2 /usr/local/avr-ada-122
 
 .. _method: http://arduino.ada-language.com/avr-ada-package-for-ubuntu-1404.html
-.. _raspberry-pi-wheezy: https://bitbucket.org/tkoskine/avr-ada-build-script/branch/raspberry-pi-wheezy
+.. _raspberry-pi-wheezy: https://hg.sr.ht/~tkoskine/avr-ada-build-script/browse?rev=raspberry-pi-wheezy

          
M contents/avr-ada-122-ubuntu-debs.rst +2 -2
@@ 8,7 8,7 @@ I created quick and dirty AVR-Ada packag
 using the latest AVR-Ada sources (basically 1.2.2 + some fixes).
 It is categorized as "quick and dirty" because I generated
 the binaries on Ubuntu 14.04 using my
-`avr-ada build script <https://bitbucket.org/tkoskine/avr-ada-build-script>`_
+`avr-ada build script <https://hg.sr.ht/~tkoskine/avr-ada-build-script>`_
 and then created the package using `fpm <https://github.com/jordansissel/fpm>`_.
 
 Anyway, if you are brave enough, you can get the package from `ubuntu.ada-language.com <http://ubuntu.ada-language.com/>`_

          
@@ 33,7 33,7 @@ required for AVR-Ada programs.
 
 If you want to generate the package by yourself, you can clone avr-ada-build-script repository and run the script and the fpm tool::
 
-   hg clone https://bitbucket.org/tkoskine/avr-ada-build-script
+   hg clone https://hg.sr.ht/~tkoskine/avr-ada-build-script
    cd avr-ada-build-script
    # install gnat-4.6, probably need many other dependencies also
    apt-get install gnat-4.6

          
M contents/avr-ada-rpms.rst +2 -2
@@ 35,11 35,11 @@ Another thing is that my packages are no
 *--nogpgcheck* parameter when installing the packages.
 
 When you have installed the packages, you can verify the installation
-by cloning my `arduino-hello-uart <https://bitbucket.org/tkoskine/arduino-hello-uart>`_ repository and compiling it:
+by cloning my `arduino-hello-uart <https://hg.sr.ht/~tkoskine/arduino-hello-uart>`_ repository and compiling it:
 
 ::
 
-   hg clone https://bitbucket.org/tkoskine/arduino-hello-uart
+   hg clone https://hg.sr.ht/~tkoskine/arduino-hello-uart
    cd arduino-hello-uart
    make
 

          
M contents/avr-buildscript.rst +4 -4
@@ 5,15 5,15 @@ Automating avr-gnat and AVR-Ada installa
 :tags: gnat, shell, avrada12
 
 For those, who don't want to follow my `manual build instructions <http://arduino.ada-language.com//building-avr-gnat-for-avr-ada.html>`_, I made
-`a script <https://bitbucket.org/tkoskine/avr-ada-build-script/raw/tip/build-avr-ada-environment.sh>`_ which automates the steps.
+`a script <https://hg.sr.ht/~tkoskine/avr-ada-build-script/raw/build-avr-ada-environment.sh?rev=default>`_ which automates the steps.
 
 You can use the script like this:
 
 ::
 
-    wget https://bitbucket.org/tkoskine/avr-ada-build-script/get/tip.zip
-    unzip tip.zip
-    cd tkoskine-avr-ada-build-script-1677e4b66123
+    wget https://hg.sr.ht/~tkoskine/avr-ada-build-script/archive/tip.tar.gz
+    tar zxvf tip.tar.gz
+    cd avr-ada-build-script-tip/
     sh -x build-avr-ada-environment.sh
 
 The script will build GNAT 4.7.0 into $HOME/programs64/gnat-native-470 directory

          
M contents/avr-toolchain.rst +2 -2
@@ 233,12 233,12 @@ Testing the setup
 -----------------
 
 To verify that you can actually compile AVR-Ada programs, you can download
-some example code from my bitbucket repositories and build them.
+some example code from my Sourcehut repositories and build them.
 
 ::
 
     export PATH=$HOME/programs/avrada/bin:$PATH
-    hg clone https://bitbucket.org/tkoskine/arduino-hello-uart
+    hg clone https://hg.sr.ht/~tkoskine/arduino-hello-uart
     cd arduino-hello-uart
     make
 

          
M contents/beginner/4digit7segment.rst +1 -1
@@ 170,7 170,7 @@ The code is following:
    end loop;
 
 
-The rest of the code is available from `arduino-mega2560-4d-7segment repository <https://bitbucket.org/tkoskine/arduino-mega2560-4d-7segment>`_.
+The rest of the code is available from `arduino-mega2560-4d-7segment repository <https://hg.sr.ht/~tkoskine/arduino-mega2560-4d-7segment>`_.
 
 And now the explanation of the code:
 

          
M contents/beginner/blink.rst +1 -1
@@ 122,5 122,5 @@ After the upload finishes, you should se
 Get the code
 ------------
 
-The full code can be found from my bitbucket.org `arduino-blink-led <https://bitbucket.org/tkoskine/arduino-blink-led>`_ repository.
+The full code can be found from my Sourcehut `arduino-blink-led <https://hg.sr.ht/~tkoskine/arduino-blink-led>`_ repository.
 

          
M contents/beginner/button-interrupts.rst +1 -1
@@ 78,6 78,6 @@ There are some gotchas you need to be aw
   pressed more than once during the waiting period and my code misses some
   of the presses. Another approach can be found from `AVR-Ada repository <http://sourceforge.net/p/avr-ada/code/ci/master/tree/apps/debounce/>`_.
 
-Full code is available in the `examples/button-interrupt <https://bitbucket.org/tkoskine/arduino-blog/src/b627f38b479d212225c958081ef52f1026dfcda6/examples/button-interrupt/?at=default>`_ directory.
+Full code is available in the `examples/button-interrupt <https://hg.sr.ht/~tkoskine/arduino-blog/browse/examples/button-interrupt?rev=b627f38b479d212225c958081ef52f1026dfcda6>`_ directory.
 
 .. _debouncing: http://arduino.cc/en/Tutorial/Debounce

          
M contents/beginner/countingseconds.rst +3 -3
@@ 34,7 34,7 @@ you can create a simple counter:
 
 Adding buttons to reset/stop time is left as an exercise for the reader :).
 
-Code is at `bitbucket`_. Notice that the repository is
+Code is at `sourcehut`_. Notice that the repository is
 *arduino-mega2560-4d-7segment* and the branch is this time *attiny4313*.
 This is mostly because I was lazy and didn't want to create a separate
 repository for this simple demo.

          
@@ 43,7 43,7 @@ To get the code with `Mercurial`_ you ne
 
 ::
 
-   hg clone https://bitbucket.org/tkoskine/arduino-mega2560-4d-7segment
+   hg clone https://hg.sr.ht/~tkoskine/arduino-mega2560-4d-7segment
    cd arduino-mega2560-4d-7segment
    hg update attiny4313
 

          
@@ 52,5 52,5 @@ To get the code with `Mercurial`_ you ne
 .. _AVR-Ada: http://sourceforge.net/projects/avr-ada/
 .. _Arduino: http://www.arduino.cc/
 .. _7-segment display: http://arduino.ada-language.com/controlling-4-digit-7-segment-display.html
-.. _bitbucket: https://bitbucket.org/tkoskine/arduino-mega2560-4d-7segment
+.. _sourcehut: https://hg.sr.ht/~tkoskine/arduino-mega2560-4d-7segment
 .. _Mercurial: http://mercurial.selenic.com/

          
M contents/beginner/ds18b20.rst +1 -1
@@ 91,5 91,5 @@ The shield includes a small prototyping 
 should fit.
 
 .. _DS18B20: http://paeae.com/ds18b20-1-wire-temperature-sensor.html
-.. _arduino-ds18b20 repository: https://bitbucket.org/tkoskine/arduino-ds18b20
+.. _arduino-ds18b20 repository: https://hg.sr.ht/~tkoskine/arduino-ds18b20
 .. _the official Wireless Shield: http://arduino.cc/en/Main/ArduinoWirelessShield
  No newline at end of file

          
M contents/beginner/lcd3310.rst +1 -1
@@ 97,5 97,5 @@ Now, just add some buttons and you are r
 .. _UEXT: https://www.olimex.com/Products/Modules/UEXT/
 .. _UEXT specification: https://www.olimex.com/Products/Modules/UEXT/resources/UEXT_rev_B.pdf
 .. _C example: https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/iMX233/MOD-LCD3310
-.. _arduino-mod-lcd3310 repository: https://bitbucket.org/tkoskine/arduino-mod-lcd3310
+.. _arduino-mod-lcd3310 repository: https://hg.sr.ht/~tkoskine/arduino-mod-lcd3310
 .. _roguelike: http://en.wikipedia.org/wiki/Roguelike

          
M contents/beginner/motorshield-pwm.rst +2 -2
@@ 130,7 130,7 @@ The complete code is here:
    end Motor;
 
 
-As usual, the code can be found from Bitbucket Mercurial repository:
-`motorshield <https://bitbucket.org/tkoskine/arduino-motorshield>`_.
+As usual, the code can be found from Sourcehut Mercurial repository:
+`motorshield <https://hg.sr.ht/~tkoskine/arduino-motorshield>`_.
 AVR-Ada 1.2 is required.
 

          
M contents/beginner/progmem.rst +1 -1
@@ 32,7 32,7 @@ by *Address* attribute. You don't need t
 how the address is calculated, the compiler handles everything
 for you.
 
-The updated code is available at `my arduino-mod-lcd3310 repository <https://bitbucket.org/tkoskine/arduino-mod-lcd3310>`_ as usual.
+The updated code is available at `my arduino-mod-lcd3310 repository <https://hg.sr.ht/~tkoskine/arduino-mod-lcd3310>`_ as usual.
 The revision number for this change is *ab6d9f7edc6f*.
 
 And here the .bss usage before and after Linker_Section pragma::

          
M contents/expert/pn532.rst +6 -6
@@ 43,8 43,8 @@ tags, but I haven't had time to add code
 If you are interested about the communication protocol details for various tag types,
 they are documented in wiki_:
 
-* `NFC Forum Type 2 tags <https://bitbucket.org/tkoskine/arduino-pn532/wiki/NFC_Forum_Type_2_tags>`_
-* `NFC Forum Type 4 tags <https://bitbucket.org/tkoskine/arduino-pn532/wiki/NFC_Forum_Type_4_tags>`_
+* `NFC Forum Type 2 tags <https://bitbucket.org/tkoskine/arduino-pn532/wiki/NFC_Forum_Type_2_tags>`_ (BROKEN LINK)
+* `NFC Forum Type 4 tags <https://bitbucket.org/tkoskine/arduino-pn532/wiki/NFC_Forum_Type_4_tags>`_ (BROKEN LINK)
  
 Code
 ----

          
@@ 138,9 138,9 @@ Another thing missing is proper NDEF for
 `documentation <https://learn.adafruit.com/adafruit-pn532-rfid-nfc/ndef>`_,
 if you are interested about the issue.
 
-The code is available under ISC license at `Bitbucket <https://bitbucket.org/tkoskine/arduino-pn532/>`_.
+The code is available under ISC license at `Sourcehut <https://hg.sr.ht/~tkoskine/arduino-pn532/>`_.
 
-Example hex_ file can be fetched from `arduino-blog repository <https://bitbucket.org/tkoskine/arduino-blog/src/tip/examples/nfc/>`_.
+Example hex_ file can be fetched from `arduino-blog repository <https://hg.sr.ht/~tkoskine/arduino-blog/browse/examples/nfc?rev=default>`_.
 It is compiled for 16MHz Arduino with pin configuration: 
 
 * MISO = PB4 (digital pin 12)

          
@@ 151,7 151,7 @@ It is compiled for 16MHz Arduino with pi
 .. _Adafruit: http://www.adafruit.com/
 .. _tricky: https://learn.adafruit.com/adafruit-pn532-rfid-nfc/breakout-wiring
 .. _UEXT: https://www.olimex.com/Products/Modules/UEXT/
-.. _code: https://bitbucket.org/tkoskine/arduino-pn532
+.. _code: https://hg.sr.ht/~tkoskine/arduino-pn532
 .. _wiki: https://bitbucket.org/tkoskine/arduino-pn532/wiki/Home
 .. _NFCTools: https://play.google.com/store/apps/details?id=com.wakdev.wdnfc
-.. _hex: https://bitbucket.org/tkoskine/arduino-blog/raw/d6a1c1e0ab0ff2f1e562182772583b9266e770dc/examples/nfc/nfc_16MHz.hex
+.. _hex: https://hg.sr.ht/~tkoskine/arduino-blog/raw/examples/nfc/nfc_16MHz.hex?rev=default

          
M contents/expert/pn532_part2.rst +5 -5
@@ 30,8 30,8 @@ Example output when reading NEO is below
 Yubikey NEO basically returns https URL which has the changing key
 part at the end of the url.
 
-As before_, my code is available at https://bitbucket.org/tkoskine/arduino-pn532
-and generated hex files at https://bitbucket.org/tkoskine/arduino-blog as
+As before_, my code is available at https://hg.sr.ht/~tkoskine/arduino-pn532
+and generated hex files at https://hg.sr.ht/~tkoskine/arduino-blog as
 `nfc_i2c.hex`_ and `nfc_spi.hex`_.
 
 nfc_i2c.hex works with `Adafruit PN532 Arduino Shield`_ while the SPI version

          
@@ 48,8 48,8 @@ Final note:
 For I2C, I used slightly modified (bigger buffers) version of Rolf's AVR.I2C package.
 Earlier, I had made my own I2C routines also, but Rolf's package is more polished.
 
-.. _PN532 code: https://bitbucket.org/tkoskine/arduino-pn532
+.. _PN532 code: https://hg.sr.ht/~tkoskine//arduino-pn532
 .. _Adafruit PN532 Arduino Shield: http://www.adafruit.com/product/789
 .. _before: http://arduino.ada-language.com/read-write-and-emulate-nfc-tags-using-adafruit-pn532-breakout-board-olimexino-328-and-avr-ada.html
-.. _nfc_i2c.hex: https://bitbucket.org/tkoskine/arduino-blog/src/380dd36738b2f8e47efaeb615030098efeb8fbb9/examples/nfc-part-2/nfc_i2c.hex?at=default
-.. _nfc_spi.hex: https://bitbucket.org/tkoskine/arduino-blog/src/380dd36738b2f8e47efaeb615030098efeb8fbb9/examples/nfc-part-2/nfc_spi.hex?at=default
+.. _nfc_i2c.hex: https://hg.sr.ht/~tkoskine/arduino-blog/raw/examples/nfc-part-2/nfc_i2c.hex?rev=default
+.. _nfc_spi.hex: https://hg.sr.ht/~tkoskine/arduino-blog/raw/examples/nfc-part-2/nfc_spi.hex?rev=default

          
M contents/expert/software-i2c.rst +4 -4
@@ 15,8 15,8 @@ using GPIO pins.
 The code was for Atmel SAMD21 and as such could not be used with AVR-Ada.
 This led me to rewrite the code in Ada.
 
-I abstracted the `core logic <https://bitbucket.org/tkoskine/arduino-blog/src/8c55f8b849222c23639bacbe8ddbabcc64d8c08c/examples/soft-i2c/soft_i2c.adb?fileviewer=file-view-default>`_
-into a `generic package <https://bitbucket.org/tkoskine/arduino-blog/src/8c55f8b849222c23639bacbe8ddbabcc64d8c08c/examples/soft-i2c/soft_i2c.ads?fileviewer=file-view-default>`_,
+I abstracted the `core logic <https://hg.sr.ht/~tkoskine/arduino-blog/browse/examples/soft-i2c/soft_i2c.adb?rev=tip>`_
+into a `generic package <https://hg.sr.ht/~tkoskine/arduino-blog/browse/examples/soft-i2c/soft_i2c.ads?rev=tip>`_,
 which can be used on any platform as long as few procedures are provided by the user:
 
 ::

          
@@ 75,8 75,8 @@ And procedures which implement the requi
 
 
 An implementation for AVR-Ada and Arduino UNO (atmega328p) is provided
-in `uno_i2c.ads <https://bitbucket.org/tkoskine/arduino-blog/src/8c55f8b849222c23639bacbe8ddbabcc64d8c08c/examples/soft-i2c/uno_i2c.ads?fileviewer=file-view-default>`_
-and `uno_i2c.adb <https://bitbucket.org/tkoskine/arduino-blog/src/8c55f8b849222c23639bacbe8ddbabcc64d8c08c/examples/soft-i2c/uno_i2c.adb?fileviewer=file-view-default>`_.
+in `uno_i2c.ads <https://hg.sr.ht/~tkoskine/arduino-blog/browse/examples/soft-i2c/uno_i2c.ads?rev=tip>`_
+and `uno_i2c.adb <https://hg.sr.ht/~tkoskine/arduino-blog/browse/examples/soft-i2c/uno_i2c.adb?rev=tip>`_.
 
 .. image:: http://arduino.tkoskine.fastmail.com.user.fm/tmp102_temperature_sensor.jpg?asatt=1&variant=small
    :alt: TMP102 temperature sensor

          
M contents/expert/thinkpad-bios-password.rst +2 -2
@@ 80,7 80,7 @@ To read EEPROM using Arduino and AVR-Ada
    end loop;
 
 
-You can find it from my `arduino-thinkpad-bios <https://bitbucket.org/tkoskine/arduino-thinkpad-bios>`_ repository. The source code expects AVR-Ada 1.2 (the development version at the time of writing).
+You can find it from my `arduino-thinkpad-bios <https://hg.sr.ht/~tkoskine/arduino-thinkpad-bios>`_ repository. The source code expects AVR-Ada 1.2 (the development version at the time of writing).
 
 I didn't know the exact I2C address of the EEPROM, so I iterated through
 multiple addresses and printed out all the info I was able to get.

          
@@ 102,7 102,7 @@ My AVR-Ada program outputs each byte (of
    ...
 
 If you want to convert this to binary image form, you can save the output
-to a file and feed the file to my `write_blocks.pl <https://bitbucket.org/tkoskine/arduino-thinkpad-bios/src/409d08842f13/write_blocks.pl>`_
+to a file and feed the file to my `write_blocks.pl <https://hg.sr.ht/~tkoskine/arduino-thinkpad-bios/browse/write_blocks.pl?rev=tip>`_
 Perl script.
 
 The bytes are `IBM keyboard <http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html#ss1.4>`_

          
M contents/intermediate/alarm-clock.rst +1 -1
@@ 269,7 269,7 @@ which can help us.
 
 However, this and the button usage is left as an exercise for the reader. ;)
 
-As usual, the code is available at `arduino-alarm-clock repository <https://bitbucket.org/tkoskine/arduino-alarm-clock>`_.
+As usual, the code is available at `arduino-alarm-clock repository <https://hg.sr.ht/~tkoskine/arduino-alarm-clock>`_.
 
 *Note:* While the code is written using Ada and the required logic is quite simple, I do not guarantee
 that the alarm clock works 100% reliably or with a good accuracy. You should not rely on it as your only alarm clock.

          
M contents/intermediate/attiny2313-led.rst +1 -1
@@ 115,5 115,5 @@ And then you need to compile the source 
     avr-objcopy -O ihex -R .eeprom led.elf led.hex
 
 The full source code can be found from
-`my Bitbucket Mercurial repository <https://bitbucket.org/tkoskine/arduino-attiny2313-led>`_.
+`my Bitbucket Mercurial repository <https://hg.sr.ht/~tkoskine/arduino-attiny2313-led>`_.
 

          
M contents/intermediate/attiny4313-usi-twi.rst +2 -2
@@ 88,8 88,8 @@ instead of Request_Data:
    Attiny_TWI.Master.Write_Data (EEPROM_Address, Buffer);
 
 
-This time the code is available from my `arduino-blog <https://bitbucket.org/tkoskine/arduino-blog>`_
-repository, under directory `examples/attiny-twowire <https://bitbucket.org/tkoskine/arduino-blog/src/968e356d564f6b1efcc809594066e7f8a4a075cd/examples/attiny-twowire?at=default>`_.
+This time the code is available from my `arduino-blog <https://hg.sr.ht/~tkoskine/arduino-blog>`_
+repository, under directory `examples/attiny-twowire <https://hg.sr.ht/~tkoskine/arduino-blog/browse/examples/attiny-twowire?rev=tip>`_.
 
 The Attiny_TWI.Master package still needs some finishing touches (like fixing some delays),
 but once I am happy with it, I will commit it into AVR-Ada repository.

          
M contents/intermediate/delay-measurements.rst +1 -1
@@ 158,4 158,4 @@ Notes
   modifying the OSCCAL register.
   
 
-As usual, the code is found from `Bitbucket <https://bitbucket.org/tkoskine/arduino-blog/src/1ae7b6d384d2bbcf639be48273f7051f8632a350/examples/delays/?at=default>`_.
+As usual, the code is found from `Sourcehut <https://hg.sr.ht/~tkoskine/arduino-blog/browse/examples/delays?rev=1ae7b6d384d2bbcf639be48273f7051f8632a350>`_.

          
M contents/intermediate/ina219-sensor.rst +2 -2
@@ 81,5 81,5 @@ by yourself or wait for future articles 
 power saving using AVR-Ada :).
 
 The code for the program is available in my
-`arduino-blog repository <https://bitbucket.org/tkoskine/arduino-blog/>`_
-(see examples/ina219 directory).
  No newline at end of file
+`arduino-blog repository <https://hg.sr.ht/~tkoskine/arduino-blog/>`_
+(see examples/ina219 directory).

          
M contents/intermediate/neopixel.rst +3 -3
@@ 174,7 174,7 @@ If you have a browser with flash support
 
    <object type="application/x-shockwave-flash" width="400" height="225" data="https://www.flickr.com/apps/video/stewart.swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="flashvars" value="intl_lang=en-US&photo_secret=e1d89ec831&photo_id=16847282345&hd_default=false"></param><param name="movie" value="https://www.flickr.com/apps/video/stewart.swf"></param><param name="bgcolor" value="#000000"></param><param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="https://www.flickr.com/apps/video/stewart.swf" bgcolor="#000000" allowfullscreen="true" flashvars="intl_lang=en-US&photo_secret=e1d89ec831&photo_id=16847282345&hd_default=false" width="400" height="225"></embed></object>   
 
-As usual, the code can be found from Bitbucket_. In addition, in this case I put
+As usual, the code can be found from Sourcehut_. In addition, in this case I put
 the hexfile_ there also.
 
 .. _followup discussion: http://sourceforge.net/p/avr-ada/mailman/message/33575458/

          
@@ 182,5 182,5 @@ the hexfile_ there also.
 .. _exact: https://learn.adafruit.com/adafruit-neopixel-uberguide/advanced-coding
 .. _advices: https://learn.adafruit.com/adafruit-neopixel-uberguide/power
 .. _blog: http://wp.josh.com/2014/05/13/ws2812-neopixels-are-not-so-finicky-once-you-get-to-know-them/
-.. _Bitbucket: https://bitbucket.org/tkoskine/arduino-blog/src/tip/examples/neopixel/?at=default
-.. _hexfile: https://bitbucket.org/tkoskine/arduino-blog/raw/fa20a7bce5b876e06795f9d98af39e52378ddec5/examples/neopixel/neopixel-led.hex
  No newline at end of file
+.. _Sourcehut: https://hg.sr.ht/~tkoskine/arduino-blog/browse/examples/neopixel?rev=tip
+.. _hexfile: https://hg.sr.ht/~tkoskine/arduino-blog/raw/examples/neopixel/neopixel-led.hex?rev=tip
  No newline at end of file

          
M contents/intermediate/power-saving-revisited.rst +2 -2
@@ 21,6 21,6 @@ I also made some observations:
 
 It is somewhat complex to add good watchdog support for atmega328p and also "trigger an interrupt instead of reset" functionality,
 so I won't be committing my watchdog code to AVR-Ada repos any time soon. Meanwhile, you can get the code from
-from my `arduino-blog repository <https://bitbucket.org/tkoskine/arduino-blog/>`_,
-examples/`deep-sleep <https://bitbucket.org/tkoskine/arduino-blog/src/tip/examples/deep-sleep/>`_ directory.
+from my `arduino-blog repository <https://hg.sr.ht/~tkoskine/arduino-blog/>`_,
+examples/`deep-sleep <https://hg.sr.ht/~tkoskine/arduino-blog/browse/examples/deep-sleep?rev=tip>`_ directory.
 

          
M contents/intermediate/power-saving.rst +2 -2
@@ 256,7 256,7 @@ The setup was same as `before <http://ar
    :height: 299
    :width: 500
 
-The program running on the sleeping Arduino can be found from `here (sleeper-atmega328p.hex) <https://bitbucket.org/tkoskine/arduino-blog/raw/efb5a3fbe62005f709021894d7a43c75f8b1685d/examples/sleeper/sleeper-atmega328p.hex>`_ in ihex format.
+The program running on the sleeping Arduino can be found from `here (sleeper-atmega328p.hex) <https://hg.sr.ht/~tkoskine/arduino-blog/raw/examples/sleeper/sleeper-atmega328p.hex?rev=efb5a3fbe62005f709021894d7a43c75f8b1685d>`_ in ihex format.
 
 The measurement results were:
 

          
@@ 295,7 295,7 @@ If my measurements are correct, you can 
 
 Also, I didn't even try all the available power saving tricks, so it should be possible to go even lower. (See the Sparkfun tutorial for details.)
 
-The complete code is available from my `arduino-blog repository <https://bitbucket.org/tkoskine/arduino-blog/>`_, under examples/sleeper directory.
+The complete code is available from my `arduino-blog repository <https://hg.sr.ht/~tkoskine/arduino-blog/>`_, under examples/sleeper directory.
 
 
 

          
M contents/intermediate/remote-controlled-robot.rst +1 -1
@@ 115,7 115,7 @@ backward, and turning, and commands rece
    end if;
 
 The rest of the code can be found from
-`arduino-rc-robot repository <https://bitbucket.org/tkoskine/arduino-rc-robot/>`_.
+`arduino-rc-robot repository <https://hg.sr.ht/~tkoskine/arduino-rc-robot/>`_.
 
 Finally, I connected XBee Explorer USB to my PC,
 opened a terminal program, and started sending control commands.

          
M contents/intermediate/trinket-soft-serial.rst +2 -2
@@ 63,9 63,9 @@ the difference comes from the inaccurate
 The procedure uses 8N1 format, meaning that the start bit (pin low)
 is sent first, then the data byte as 8 bits, and finally one stop bit (pin high).
 
-The example code_ can be found from `Bitbucket <https://bitbucket.org/tkoskine/arduino-blog/>`_ as
+The example code_ can be found from `Sourcehut <https://hg.sr.ht/~tkoskine/arduino-blog/>`_ as
 usual.
 
 .. _Trinket: https://www.adafruit.com/products/1501
-.. _code: https://bitbucket.org/tkoskine/arduino-blog/src/2877b1ca6f9cfa0087af4ac80f020a91a8d81e22/examples/trinket-soft-serial/?at=default
+.. _code: https://hg.sr.ht/~tkoskine/arduino-blog/browse/examples/trinket-soft-serial/?rev=2877b1ca6f9cfa0087af4ac80f020a91a8d81e22
 

          
M contents/intermediate/wireless-temperature-sensor.rst +1 -1
@@ 114,6 114,6 @@ It was nice to see that you can create a
 on a single battery. Of course, in my setup, I reported the temperature only
 once per hour. Doing it more often would drain the battery more.
 
-The source code is available at `bitbucket.org/tkoskine/arduino-blog <https://bitbucket.org/tkoskine/arduino-blog/src/tip/examples/wireless-temp-sensor/>`_ as usual.
+The source code is available at `arduino-blog repository <https://hg.sr.ht/~tkoskine/arduino-blog/browse/examples/wireless-temp-sensor?rev=tip>`_ as usual.
 
 

          
M contents/pages/about.rst +1 -1
@@ 21,7 21,7 @@ web host, but most likely it will be mov
 server later, thanks to increased traffic lately (2013 May).
 
 The blog articles, theme, and other related settings can
-be found from my `arduino-blog <https://bitbucket.org/tkoskine/arduino-blog>`_
+be found from my `arduino-blog <https://hg.sr.ht/~tkoskine/arduino-blog>`_
 repository.
 
 .. _arduino.ada-language.com: http://arduino.ada-language.com/