An electronic device includes a battery chamber; first through fifth contacts,
positioned in the battery chamber; two detection switches which are turned ON only
when two battery packs are accommodated in the battery chamber in the correct direction;
a voltage detector capable of detecting first through sixth voltages between the
first/second contacts, second/third contacts, third/fourth contacts, fourth/fifth
contacts, first/third contacts, and third/fifth contacts, respectively; and a controller
which allows either four cylindrical cells or the two battery packs to be used
as the power source only if the two detection switches are ON when the fifth and
sixth voltages are substantially the same, or if the two detection switches are
OFF when the first, second, third and fourth voltages is greater than zero volts
and that the first, second, third and fourth voltages are substantially the same.