 <?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://Robo.Fish/wiki/index.php?action=history&amp;feed=atom&amp;title=Arduino</id>
	<title>Arduino - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://Robo.Fish/wiki/index.php?action=history&amp;feed=atom&amp;title=Arduino"/>
	<link rel="alternate" type="text/html" href="https://Robo.Fish/wiki/index.php?title=Arduino&amp;action=history"/>
	<updated>2026-06-04T17:46:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://Robo.Fish/wiki/index.php?title=Arduino&amp;diff=2409&amp;oldid=prev</id>
		<title>Kai: /* Introduction */</title>
		<link rel="alternate" type="text/html" href="https://Robo.Fish/wiki/index.php?title=Arduino&amp;diff=2409&amp;oldid=prev"/>
		<updated>2017-02-26T17:50:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Introduction&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
=== &amp;lt;br /&amp;gt;Introduction ===&lt;br /&gt;
[http://arduino.cc Arduino] is a microcontroller abstraction platform with a number of royalty-free, inexpensive microcontroller board models, an easy-to-use C/C++ programming tool, and a large community of users of all ages. A microcontroller is well suited for time-critical and/or power-efficient control of motors, and for sensor fusion. Arduino boards are thus suitable for powering the [[Robot State Agent | state agent]] of a robot.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
The typical Arduino board is based on an 8-bit [http://www.atmel.com/products/microcontrollers/avr/default.aspx Atmel AVR] microcontroller because those are cheap and offer sufficient computing performance for most applications. There are also boards with faster, 32-bit processors based on AVR32 or [[ARM#Microcontrollers | ARM Cortex-M]], like the [[#Teensy | Teensy]].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
[https://arduinohistory.github.io According to Hernando Barragán], Arduino was developed based on the physical programming environment &amp;#039;&amp;#039;Wiring&amp;#039;&amp;#039; that he created.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Power supply considerations===&lt;br /&gt;
Arduino boards are powered via the USB connection to your computer. In the final operation environment it is usually powered by applying power to the VIN (V&amp;lt;sub&amp;gt;in&amp;lt;/sub&amp;gt;) pin. The supply voltage should should be between 7 V and 12 V.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== PWM ===&lt;br /&gt;
There are dedicated output pins for delivering square pulses with the desired frequency and the desired duty cycle. This is useful for controlling the amount of power that is delivered to slow-switching devices like LEDs and DC motors (via an intermediate power transistor stage). This technique is called pulse width modulation (PWM).&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Communicating With Other Devices ===&lt;br /&gt;
====I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C====&lt;br /&gt;
You can use the [https://www.arduino.cc/en/Reference/Wire Wire Library] to communicate via the [[I2C | I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C]] protocol. Note that the Arduino can be slaved at a desired I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C address. [https://www.arduino.cc/en/Tutorial/MasterReader This tutorial] explains how to set up to Arduino controllers to communicate with each other, where one Arduino assumes the I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; master role and the other Arduino the slave role.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
100 kHz is the default speed. 400 kHz is the maximum supported by the ATmega microcontroller on the Arduino board.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== SPI ====&lt;br /&gt;
You can use the [https://www.arduino.cc/en/Reference/SPI SPI Library] to communicate with other chips via the SPI protocol but this library handles only the case in which the Arduino is the SPI master. To configure the Arduino as slave we need to use the low-level Atmel AVR instruction set&lt;br /&gt;
&amp;lt;pre class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
pinMode(MISO, OUTPUT);&lt;br /&gt;
pinMode(MOSI, INPUT);&lt;br /&gt;
pinMode(SCL, INPUT);&lt;br /&gt;
pinMode(SS, INPUT);&lt;br /&gt;
SPCR = (1 &amp;lt;&amp;lt; SPE); // enable SPI as slave in mode 0, sending MSB first&lt;br /&gt;
SPI.attachInterrupt(); // implies SPCR = SPCR | (1&amp;lt;&amp;lt;SPIE)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
where we install an interrupt handling function (a.k.a. interrupt service routine) for the interrupt type &amp;#039;&amp;#039;SPI_STC_vect&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;code&amp;quot;&amp;gt;&lt;br /&gt;
ISR(SPI_STC_vect)&lt;br /&gt;
{&lt;br /&gt;
  byte d = SPDR; // reading one byte from the data register&lt;br /&gt;
  // Do something with d. For example, append to a data array.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and where you need to implement your own messaging protocol on top of this basic byte-passing.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Here are two articles about programming SPI communication in AVR microcontrollers:&lt;br /&gt;
* [http://avrbeginners.net/architecture/spi/spi.html AVRBeginners.net]&lt;br /&gt;
* [http://maxembedded.com/2013/11/the-spi-of-the-avr maxEmbedded.com]&lt;br /&gt;
and documentation provided by Atmel for the [http://www.atmel.com/Images/Atmel-42735-8-bit-AVR-Microcontroller-ATmega328-328P_Datasheet.pdf ATmega328] plus an [http://www.atmel.com/Images/Atmel-2585-Setup-and-Use-of-the-SPI_ApplicationNote_AVR151.pdf application note on SPI for AVR microcontrollers].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== UART ====&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Applications ===&lt;br /&gt;
* [[Arduino_Push_Button | Push Buttons with Arduino]]&lt;br /&gt;
* [[Arduino_DC_Motor | DC Motor Control with Arduino]]&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Arduino IDE ===&lt;br /&gt;
==== USB Issue on Linux ====&lt;br /&gt;
If you see the error message &amp;#039;&amp;#039;&amp;#039;can&amp;#039;t open device &amp;quot;/dev/ttyUSB0&amp;quot;: Permission denied&amp;#039;&amp;#039;&amp;#039; in the Arduino IDE you need to add your user account to the same group that &amp;#039;&amp;#039;/dev/ttyUSB0&amp;#039;&amp;#039; is a member of. To view the group membership of &amp;#039;&amp;#039;/dev/ttyUSB0&amp;#039;&amp;#039; simply type&lt;br /&gt;
&amp;lt;pre class=&amp;quot;terminal&amp;quot;&amp;gt;&lt;br /&gt;
ls -l /dev/ttyUSB0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and note the group name. It&amp;#039;s either &amp;#039;&amp;#039;&amp;#039;dialout&amp;#039;&amp;#039;&amp;#039; (e.g. on Ubuntu 16.04) or &amp;#039;&amp;#039;&amp;#039;serial&amp;#039;&amp;#039;&amp;#039;. Now add yourself to that group by typing&lt;br /&gt;
&amp;lt;pre class=&amp;quot;terminal&amp;quot;&amp;gt;&lt;br /&gt;
sudo usermod -aG &amp;lt;group name&amp;gt; &amp;lt;user name&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and check if you were successfully added by typing&lt;br /&gt;
&amp;lt;pre class=&amp;quot;terminal&amp;quot;&amp;gt;&lt;br /&gt;
groups &amp;lt;user name&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, log out and log in again. This solution is also described [http://playground.arduino.cc/Linux/All on the Arduino website].&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=== Teensy ===&lt;br /&gt;
Teensy is a family of boards from [http://pjrc.com PJRC] that are compatible with the Arduino IDE while using the ARM Cortex-M [http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/kinetis-cortex-m-mcus:KINETIS Kinetis] processors from NXP (who bought the original manufacturer Freescale). These boards offer more computing power than the cheaper, 8-bit Atmel processors with AVR instruction set.&lt;/div&gt;</summary>
		<author><name>Kai</name></author>
	</entry>
</feed>