@@ -81,17 +81,17 @@ If there are more than one Arduino boards connected,
8181the desired COM port can be also be passed as an optional argument:
8282
8383``` python
84- board = Arduino(" 9600" , port = " COM3" ) # Windows example
84+ board = Arduino(" 9600" , port = " COM3" ) # Windows example
8585```
8686``` python
87- board = Arduino(" 9600" , port = " /dev/tty.usbmodemfa141" ) # OSX example
87+ board = Arduino(" 9600" , port = " /dev/tty.usbmodemfa141" ) # OSX example
8888```
8989
9090A time-out for reading from the Arduino can also be specified as an optional
9191argument:
9292
9393``` python
94- board = Arduino(" 9600" , timeout = 2 ) # Serial reading functions will
94+ board = Arduino(" 9600" , timeout = 2 ) # Serial reading functions will
9595# wait for no more than 2 seconds
9696```
9797
@@ -142,7 +142,7 @@ board.analogWrite(11) #Set analog value (PWM) based on analog measurement
142142** Servo Library Functionality**
143143Support is included for up to 8 servos.
144144
145- - ` Arduino.Servos.attach(pin, min = 544, max = 2400) ` Create servo instance. Only 8 servos can be used at one time.
145+ - ` Arduino.Servos.attach(pin, min= 544, max= 2400) ` Create servo instance. Only 8 servos can be used at one time.
146146- ` Arduino.Servos.read(pin) ` Returns the angle of the servo attached to the specified pin
147147- ` Arduino.Servos.write(pin, angle) ` Move an attached servo on a pin to a specified angle
148148- ` Arduino.Servos.writeMicroseconds(pin, uS) ` Write a value in microseconds to the servo on a specified pin
@@ -158,7 +158,7 @@ board.Servos.detach(9) #free pin 9
158158
159159** Software Serial Functionality**
160160
161- - ` Arduino.SoftwareSerial.begin(ss_rxPin,ss_txPin,ss_device_baud) ` initialize software serial device on
161+ - ` Arduino.SoftwareSerial.begin(ss_rxPin, ss_txPin, ss_device_baud) ` initialize software serial device on
162162specified pins.
163163Only one sofware serial device can be used at a time. Existing software serial instance will
164164be be overwritten by calling this method, both in Python and on the arduino board.
@@ -168,11 +168,27 @@ serial connection.
168168
169169``` python
170170# Software serial example
171- board.SoftwareSerial.begin(0 ,7 , " 19200" ) # Start software serial for transmit only (tx on pin 7)
171+ board.SoftwareSerial.begin(0 , 7 , " 19200" ) # Start software serial for transmit only (tx on pin 7)
172172board.SoftwareSerial.write(" test " ) # Send some data
173173response_char = board.SoftwareSerial.read() # read response character
174174```
175175
176+ ** EEPROM**
177+
178+ - ` Arduino.EEPROM.read(address) ` reads a byte from the EEPROM
179+ - ` Arduino.EEPROM.write(address, value) ` writes a byte to the EEPROM
180+ - ` Arduino.EEPROM.size() ` returns size of the EEPROM
181+
182+ ``` python
183+ # EEPROM read and write examples
184+ location = 42
185+ value = 10 # 0-255(byte)
186+
187+ board.EEPROM .write(location, 10 )
188+ print (board.EEPROM .read(location))
189+ print (' EEPROM size {size} ' .format(size = board.EEPROM .size()))
190+ ```
191+
176192** Misc**
177193
178194- ` Arduino.close() ` closes serial connection to the Arduino.
0 commit comments