mitat.tuu.fi
FrSky Variometer / Altimeter = BMP085
FrSky variometer contains BMP085 barometer sensor for cheap.
Pinout:
Black = Gnd
Red = Vcc
Yellow = SCL (Pro Mini A5)
Brown = SDA (Pro Mini A4)
Pin interrupts on Atmega 168 + 328 (Arduino)
From http://arduino.cc/forum/index.php?topic=80928.0
/*
* Theory: all IO pins on Atmega168 are covered by Pin Change Interrupts.
* The PCINT corresponding to the pin must be enabled and masked, and
* an ISR routine provided. Since PCINTs are per port, not per pin, the ISR
* must use some logic to actually implement a per-pin interrupt service.
*/
/* Pin to interrupt map:
* D0-D7 = PCINT 16-23 = PCIR2 = PD = PCIE2 = pcmsk2
* D8-D13 = PCINT 0-5 = PCIR0 = PB = PCIE0 = pcmsk0
* A0-A5 (D14-D19) = PCINT 8-13 = PCIR1 = PC = PCIE1 = pcmsk1
*/
Setup:
PCMSK2 |= (1<<PCINT23); PCICR |= (1 << PCIE2); PCMSK0 |= (1<<PCINT0);PCICR |= (1 << PCIE0);ISR(PCINT2_vect)
{
code here
}
ISR(PCINT0_vect)
{
code here
}
MultiWii + Mongoose + Tricopter
If you’re using MultiWii at Mongoose-board you might wonder how to connect motors to pins.
Pinouts for tricopter:
Yaw Servo: MultiWii pin=3 = PD3 => Mongoose-pin:3
Front Left: MW=11 = PB3 => Mongoose-pin: spi-header (MOSI)
Front Right: MW=10 = PB2 => Mongoose-pin: 10
Rear: MW=9 = PB1 => Mongoose-pin: 9
RX ppm sum: mw=2 = PD2 (soldered straight to atmega328p)
See: http://www.fuzzydrone.org/2012/01/connecting-motors-and-radio-receiver-to.html
@ measured | multicopter | snippet
SDMInstaller on OS X
SDMInstaller must be run as root on OS X to get it working (formatting etc.)
sudo “/Volumes/SDMInstaller/SDMInst.app/Contents/MacOS/JavaApplicationStub”
@ measured
My tricopter multiwii settings
@ measured | multicopter
SimonK ESC .hex-files (download+avrdude)
Hint: you can find pre-compiled .hex files for all SimonK versions from here : https://github.com/sim-/tgy/downloads
To upload on OS X (for example Hobby King 30A ESC 3A UBEC):
avrdude -c usbasp -pm8 -U flash:w:/Users/xxx/Downloads/tgy_2012-09-30_0d3e617/bs_nfet.hex
@ multicopter | snippet
Bandwidth throttling on OS X
Simple way to enable bandwidth throttling on OS X
sudo ipfw pipe 1 config bw 150KByte/s
sudo ipfw add 1 pipe 1 src-port 80
sudo ipfw pipe 1 config bw 20KByte/s
sudo ipfw add 1 pipe 1 dst-port 80
OpenSCAD 2D object that can be exported to DXF
// basic example of OpenSCAD that makes a plate that has holes in it
// you can export this to DXF because it makes 2D projection
module test()
{
// difference = first “object” is cut out with the rest of the objects
difference()
{
// union = all shapes inside union becomes one
// in this case this is the first object
union()
{
cylinder(r=30, h=3, center=true);
cube(size = [100,30,1], center = true);
}
// ok, let’s then punctuate the cylinder+cube combo with holes
for ( i = [0:10] )
{
rotate([0,0,36*i]) // rotate the “world”
translate([25,0,0]) // move away from the center
{
cylinder(r=2, h=5, center=true); // punch a hole
}
}
}
}
projection(cut=true) test();
@ snippet
Arduino Due performance on sin()
Tested running 100.000 sin() calls and it took 2594 milliseconds. That means you make call sin() at 38.55kHz. If you want to make 44.1kHz sound in real-time there’s no way you can use the sin() method.
Here’s the code I used
void SpeedTest()
{
float f = 1.23;
Serial.println(millis());
for (uint32_t i=0; i<10000; i++)
{
f=sin(f);
f=sin(f);
f=sin(f);
f=sin(f);
f=sin(f);
f=sin(f);
f=sin(f);
f=sin(f);
f=sin(f);
f=sin(f);
}
Serial.println(millis());
Serial.println(f);
}
Few tweaks for Raspberry Pi
Use Adafruit’s Occidentalis distro as your base system. It has all neat stuff done for you (sshd running pi/raspberry). It also includes wlan driver for Asus USB-N10 USB WLAN-adapter (which is great and goes through one celement floor).
Make your system up to date by running this command sequence:
rm /etc/ssh/ssh_host_* && dpkg-reconfigure openssh-server
apt-get -y update
apt-get -y install locales
apt-get -y install ntpdate
ntpdate uk.pool.ntp.org
apt-get -y install ntp fake-hwclock
rpi-update
apt-get -y dist-upgrade
Make a temp filesystem to store logs and all running stuff. Add this row to /etc/fstab:
tmpfs /var/tmp tmpfs nodev,nosuid,size=50M 0 0
Edit /etc/rsyslog.conf and replace all /var/log/ instances with /var/tmp/
One last warning: Your SD card WILL corrupt some day if you don’t do a proper shutdown. Make a backup of your SD card when it’s all set up! If you don’t believe: try it. It’s the nature of SD card that makes this and there’s no easy way out.
