Difference between revisions of "Programming electronics"

From ThorstensHome
Jump to: navigation, search
 
(17 intermediate revisions by one user not shown)
Line 1: Line 1:
Ok, I did my first steps to control an electro motor with [[arduino]], today I bought myself a "learning package USB" from Franzis.  
+
I love to play with electronic devices.
  
I plug it into my computer's USB port and it appears as /dev/ttyUSB0. I can then use it to switch on and switch off an LED.
+
= My devices =
 +
* I have an [[arduino]]
 +
* I have a [[Lego CyberMaster]], a successor of Lego Technik and a precursor to Lego MindStorms
 +
* I have some [http://www.linuxintro.org/wiki/USB-to-serial-adapters USB to RS232 adapters]
 +
* I have an [[ftdi]] FT232R controller
 +
* I have an [[ATtiny13]] microprocessor. It looks like this:
 +
 +
            ------
 +
  PB0(MOSI)-|ATtiny|-GND
 +
  PB1(MISO)-|  13  |-PB4
 +
  PB2 (SCK)-|      |-PB3
 +
        VCC-|    o|-RES
 +
            ------
  
Python program to play the note A (440 Hz):
+
= My experiments =
<pre>
+
* [[oszilloskop|build a simple oscilloscope (German)]]
import serial, time
+
* [[play a 440 Hz tune on a loudspeaker]]
 +
* [[ampel|build a traffic light (German)]]
 +
* [[control an LED via USB/RS232 adapter]]
  
conn = serial.Serial('/dev/ttyUSB0',
+
= See also =
                    baudrate=9600,
+
* [[arduino]]
                    bytesize=serial.EIGHTBITS,
+
* http://electroments.blogspot.de
                    parity=serial.PARITY_NONE,
+
* http://elektronik-labor.de
                    stopbits=serial.STOPBITS_ONE,
+
* http://bkainka.de
                    timeout=1,
+
* http://wiki.bennyshome.de
                    xonxoff=0,
+
                    rtscts=0)
+
 
+
while True:
+
        conn.setDTR(True) 
+
        time.sleep(1/880)
+
        conn.setDTR(False)
+
        time.sleep(1/880)
+
</pre>
+

Latest revision as of 14:20, 8 January 2013

I love to play with electronic devices.

My devices

            ------
 PB0(MOSI)-|ATtiny|-GND
 PB1(MISO)-|  13  |-PB4
 PB2 (SCK)-|      |-PB3
       VCC-|     o|-RES
            ------

My experiments

See also