Difference between revisions of "Programming electronics"

From ThorstensHome
Jump to: navigation, search
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]]
  
Python program to play the note A (440 Hz):
+
= My experiments =
<pre>
+
* [[play a 440 Hz tune on a loudspeaker]]
import serial, time
+
 
+
conn = serial.Serial('/dev/ttyUSB0',
+
                    baudrate=9600,
+
                    bytesize=serial.EIGHTBITS,
+
                    parity=serial.PARITY_NONE,
+
                    stopbits=serial.STOPBITS_ONE,
+
                    timeout=1,
+
                    xonxoff=0,
+
                    rtscts=0)
+
 
+
while True:
+
        conn.setDTR(True) 
+
        time.sleep(1/880)
+
        conn.setDTR(False)
+
        time.sleep(1/880)
+
</pre>
+
  
 
Today I assumed that the attiny 13 is correctly built in when the small point is where the half circle is in the diagrams. In other words VCC and RES is next to the point. I tested it the other way today and smoke came up. Classical smoke test.
 
Today I assumed that the attiny 13 is correctly built in when the small point is where the half circle is in the diagrams. In other words VCC and RES is next to the point. I tested it the other way today and smoke came up. Classical smoke test.

Revision as of 11:34, 30 September 2012

I love to play with electronic devices.

Contents

My devices

My experiments

Today I assumed that the attiny 13 is correctly built in when the small point is where the half circle is in the diagrams. In other words VCC and RES is next to the point. I tested it the other way today and smoke came up. Classical smoke test.

Now let's get to the ATTiny13 included in the package. Mine has on its back a print L8 Taiwan R1 and on the left top BF3. To install the bootloader and fuses to the device you must first run mProc to invert the voltages.

ftdi

The ftdi chip works with Linux. It is (except that it is said to deliver 5V, not 12) a USB to RS232 adapter. Let's play with it.

See also