Show Posts
|
|
Pages: [1] 2
|
|
1
|
Forum 2005-2010 (read only) / Development / Re: Introducing R2Duino! - USB Stick, 2 Relays
|
on: September 03, 2010, 10:54:48 am
|
|
Kind words, thank you, thank you!
I am glad you like it, for my partner and me worked hard to make this a quality product.
We hope to sell them to schools and colleges, so please spread the word if you think this is an easy to use and fun product.
But don't hesitate to mail me if you are not happy with the product in any way or see points for improvement.
Have fun!
Cheers.
|
|
|
|
|
4
|
Forum 2005-2010 (read only) / Development / Re: Introducing R2Duino! - USB Stick, 2 Relays
|
on: August 20, 2010, 01:30:39 am
|
|
@Eight, the relays are able to handle 60V, AC or DC, and 400mA.
@mowcius, @crOsh, 4 rows of stackable headers are included in the package. And I am negotiating with a chinese manufacturer of molded cases for USB sticks. But the point is, you still want to be able to access the pin headers. I haven't figured out yet what the molded case should look like. Any suggestions?
|
|
|
|
|
6
|
Forum 2005-2010 (read only) / Development / Introducing R2Duino! - USB Stick, 2 Relays
|
on: August 19, 2010, 10:23:35 am
|
The R2Duino is a fully assembled USB STICK sized Arduino clone based on the ATmega328. It has the same functionality as the Arduino Nano 3.0, but comes in a different package. It lacks only a DC power jack, but has a standard size USB connector which fits right into the USB connector of your PC. The name R2Duino comes from the fact that this microcontroller board has 2 RELAYS, connected to pins D8 and D9. The R2Duino was designed and is being produced by Certeza. Specifications:Microcontroller: Atmel ATmega328 Operating Voltage (logic level): 5 V Digital I/O Pins: 14 (of which 6 provide PWM output) Analog Input Pins: 8 DC Current per I/O Pin: 40 mA Flash Memory: 32 KB (of which 2 KB used by bootloader) SRAM: 2 KB EEPROM: 1 KB Clock Speed: 16 MHz Dimensions: 70 x 30 x 20mm EXTRA: 2 relays (60V AC/DC 400mA) on pins D8 and D9, enabled/disabled by jumpers EXTRA: Standard size USB connector Included in the package:4 rows of pin headers. You can solder them on the board if you need them. I have produced a small run of 20 boards. If there is enough interest I will produce more. You can order them from http://www.public-art-international.com/catalog/product_info.php/cPath/62/products_id/219.
|
|
|
|
|
9
|
Forum 2005-2010 (read only) / Interfacing / Re: String sounds with Karplus-Strong Algorithm
|
on: July 30, 2010, 06:00:45 am
|
Can someone tell me what I am doing wrong? I am trying to play 3 plucked strings more or less at the same time, but as soon as I uncomment the lines to play s1 or s2 the sound dies. Any help is appreciated. /** * Trying to play 3 plucked strings at the same time * * * **/
#include "avr/pgmspace.h"
// table of 2 octaves 3 & 4 // Octave 3: C=46, C#=48, D=52, D#=54, E=57, F=61, F#=65, G=68, G#=72, A=76, A#=80, B=86 // Octave 4: C=91, C#=97, D=103, D#=109, E=114, F=120, F#=127, G=134, G#=147, A=155, A#=162, B=170 PROGMEM prog_uchar notes[] = { 46, 48, 52, 54, 57, 61, 65, 68, 72, 76, 80, 86, 91, 97, 103, 109, 114, 120, 127, 134, 147, 154, 161, 170, 182 }; // usage: v = pgm_read_byte_near(notes + nc);
#define SAMPLING_RATE 11025 //#define DELAY_TIME 100000/SAMPLING_RATE #define DELAY_TIME 20000/SAMPLING_RATE
uint16_t v; uint16_t vc; uint8_t nbh; int32_t avg; long cnt;
// String 1 byte s1; uint8_t N1; int16_t buf1[250]; uint8_t bh1; uint16_t f1; uint16_t T1; uint32_t iT1; uint32_t iTMax1;
// String 2 byte s2; uint8_t N2; int16_t buf2[250]; uint8_t bh2; uint16_t f2; uint16_t T2; uint32_t iT2; uint32_t iTMax2;
// String 3 byte s3; uint8_t N3; int16_t buf3[250]; uint8_t bh3; uint16_t f3; uint16_t T3; uint32_t iT3; uint32_t iTMax3;
// ------------------------------------------------------------------------------------------------------------- // setup() // ------------------------------------------------------------------------------------------------------------- void setup(){ pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(7, OUTPUT);
pinMode(8, INPUT); pinMode(9, INPUT); pinMode(10, INPUT);
pinMode(13, OUTPUT);
PORTD = 0;
s1 = 0; // 0 = active s2 = 0; // 0 = active s3 = 0; // 0 = active cnt = 0; }
// ------------------------------------------------------------------------------------------------------------- // loop() // ------------------------------------------------------------------------------------------------------------- void loop(){ cnt++; if (cnt == 10000) cnt=0;
// pluck string at pos 100 if (s1 == 0 && cnt > 100) { f1 = 46; // freq T1 = 200; // duration
// set buffer size N1 = SAMPLING_RATE / f1; // f == 44Hz..65535Hz // fill the buffer with white noise for (uint8_t i=0; i!=N1; i++) { buf1[i] = (int16_t) random(-32768,32767); } bh1 = 0; iTMax1 = SAMPLING_RATE * T1; iT1 = 0; s1 = 1; } else { // do something that takes the same time //delayMicroseconds(5); }
// pluck string at pos 4000 if (s2 == 0 && cnt > 4000) { f2 = 57; // freq T2 = 200; // duration
// set buffer size N2 = SAMPLING_RATE / f2; // f == 44Hz..65535Hz // fill the buffer with white noise for (uint8_t i=0; i!=N2; i++) { buf2[i] = (int16_t) random(-32768,32767); } bh2 = 0; iTMax2 = SAMPLING_RATE * T2; iT2 = 0; s2 = 1; } else { // do something that takes the same time //delayMicroseconds(5); }
// pluck string at pos 8000 if (s3 == 0 && cnt > 8000) { //Serial.println("Sound started."); f3 = 68; // freq T3 = 200; // duration
// set buffer size N3 = SAMPLING_RATE / f3; // f == 44Hz..65535Hz // fill the buffer with white noise for (uint8_t i=0; i!=N3; i++) { buf3[i] = (int16_t) random(-32768,32767); } bh3 = 0; iTMax3 = SAMPLING_RATE * T3; iT3 = 0; s3 = 1; } else { // do something that takes the same time //delayMicroseconds(5); }
v = 0; vc = 0;
/* if (s1 == 1) { v += (int8_t) (buf1[bh1] >> 8); vc++;
nbh = bh1!=N1-1 ? bh1+1 : 0; avg = buf1[bh1] + (int32_t)buf1[nbh]; avg = (avg << 10) - avg; // subtract avg more than once to get faster volume decrease buf1[bh1] = avg >> 11; // no division, just shift bh1 = nbh;
iT1++; if (iT1 == iTMax1) { s1 = 0; } } else { // do something that takes the same time //delayMicroseconds(10); } */ /* if (s2 == 1) { v += (int8_t) (buf2[bh2] >> 8); vc++;
nbh = bh2!=N2-1 ? bh2+1 : 0; avg = buf2[bh2] + (int32_t)buf2[nbh]; avg = (avg << 10) - avg; // subtract avg more than once to get faster volume decrease buf2[bh2] = avg >> 11; // no division, just shift bh2 = nbh;
iT2++; if (iT2 == iTMax2) { s2 = 0; } } else { // do something that takes the same time //delayMicroseconds(10); } */ if (s3 == 1) { v += (int8_t) (buf3[bh3] >> 8); vc++;
nbh = bh3!=N3-1 ? bh3+1 : 0; avg = buf3[bh3] + (int32_t)buf3[nbh]; avg = (avg << 10) - avg; // subtract avg more than once to get faster volume decrease buf3[bh3] = avg >> 11; // no division, just shift bh3 = nbh;
iT3++; if (iT3 == iTMax3) { s3 = 0; } } else { // do something that takes the same time //delayMicroseconds(10); } v = v / vc; // >> (PINB & B00000111); // tremolo effect sendTo8bitDAC(v); // preferably by port operation, e. g. "PORTD = v;"
delayMicroseconds(DELAY_TIME); }
void sendTo8bitDAC(int8_t v) { PORTD = v >> 2; // we use a 6 bit R2R ladder }
|
|
|
|
|