Show Posts
Pages: [1]
1  Community / Exhibition / Gallery / Re: Quiz / Buzzer system (Arduino + Processing) on: February 14, 2011, 03:48:07 am
An update:

I had caps printed for the buttons at shapeways.
2  Topics / E-Textiles and Craft / Re: EL Wire on: January 31, 2011, 01:45:36 am
There is an EL tutorial at adafruit.

EL needs a much higher voltage than an arduino can supply
3  Community / Bar Sport / Re: 555 Contest on: January 31, 2011, 01:35:11 am
There is also prizes just for participating, so it might be worth submitting an entry regardless...
4  Community / Bar Sport / Re: Migration of forum accounts. on: January 29, 2011, 01:12:51 am
It is unlikely that the passwords are plaintext, and I don't know why moving the forum implies they are. The super secret password list is just applied to the new site, no?
5  Community / Website and Forum / Re: Karma on: January 28, 2011, 07:41:18 pm
Is it you who has given lots of people in this thread negative karma?  

I don't approve.
Nope. I don't approve either. But those people will get what is coming to them.
6  Community / Website and Forum / Re: Karma on: January 28, 2011, 06:31:40 pm
Mowcius is not happy

Mowcius has an idea who it was (who was online here then...) - now whether to be mean or not
'Twas I. I encourage everyone reading this to give me negative karma.

7  Development / Suggestions for the Arduino Project / Re: Really slow IDE on Win 7 on: January 28, 2011, 06:15:10 pm
I was wondering why the IDE was so sluggish. Thanks for bringing this to my attention
8  Community / Exhibition / Gallery / Re: Quiz / Buzzer system (Arduino + Processing) on: January 28, 2011, 04:35:48 am
I'm not really sure if there is a detectable bias, I'll try and test it over the weekend when a friend comes round, I don't think i can reliably test it by myself.

If I have a problem with bias, I think I will take your idea of polling the pins up front and measure which teams buzz in in each loop, but then pick the 'winner' at random. Or, at 'random'.

edit: I just had a go at 60 simultaneous button presses of adjacent buttons and it came up as 28/32 which i think is pretty good.
9  Community / Exhibition / Gallery / Re: Quiz / Buzzer system (Arduino + Processing) on: January 28, 2011, 03:46:15 am
I was just polling the pins, so it was triggering repeatedly when a button was pressed, but today at lunch I updated it to use the Bounce library and so it will only register the button once when it is pressed.

I want to clean it up, but,
Code:
#include <Bounce.h>

const int ledPin =  13;
const int buttonA = 2;
const int buttonB = 3;
const int buttonC = 4;
const int buttonD = 5;
const int buttonY = 6;
const int buttonN = 7;

Bounce bounceA = Bounce( buttonA,5 );
Bounce bounceB = Bounce( buttonB,5 );
Bounce bounceC = Bounce( buttonC,5 );
Bounce bounceD = Bounce( buttonD,5 );
Bounce bounceY = Bounce( buttonY,5 );
Bounce bounceN = Bounce( buttonN,5 );

boolean aPressed = false;
boolean bPressed = false;
boolean cPressed = false;
boolean dPressed = false;
boolean yPressed = false;
boolean nPressed = false;



void setup() {
  pinMode(ledPin, OUTPUT);     
  pinMode(buttonA,INPUT);
  pinMode(buttonB,INPUT);
  pinMode(buttonC,INPUT);
  pinMode(buttonD,INPUT);
  pinMode(buttonY,INPUT);
  pinMode(buttonN,INPUT);
  Serial.begin(9600);
}

void loop(){
  bounceA.update ( );
  bounceB.update ( );
  bounceC.update ( );
  bounceD.update ( );
  bounceY.update ( );
  bounceN.update ( );
  digitalWrite(ledPin, LOW);


if(aPressed == false){
  if (bounceA.read() == HIGH) {
    digitalWrite(ledPin, HIGH);
    Serial.println(String("2"));
    aPressed = true;
  }
}
if(aPressed == true){
  if (bounceA.read() == LOW) {
    digitalWrite(ledPin, LOW);
    //Serial.println(String("2"));
    aPressed = false;
  }
}

if(bPressed == false){
  if (bounceB.read() == HIGH) {
    digitalWrite(ledPin, HIGH);
    Serial.println(String("3"));
    bPressed = true;
  }
}
if(bPressed == true){
  if (bounceB.read() == LOW) {
    digitalWrite(ledPin, LOW);
    bPressed = false;
  }
}

if(cPressed == false){
  if (bounceC.read() == HIGH) {
    digitalWrite(ledPin, HIGH);
    Serial.println(String("4"));
    cPressed = true;
  }
}
if(cPressed == true){
  if (bounceC.read() == LOW) {
    digitalWrite(ledPin, LOW);
    cPressed = false;
  }
}

if(dPressed == false){
  if (bounceD.read() == HIGH) {
    digitalWrite(ledPin, HIGH);
    Serial.println(String("5"));
    dPressed = true;
  }
}
if(dPressed == true){
  if (bounceD.read() == LOW) {
    digitalWrite(ledPin, LOW);
    dPressed = false;
  }
}

if(yPressed == false){
  if (bounceY.read() == HIGH) {
    digitalWrite(ledPin, HIGH);
    Serial.println(String("6"));
    yPressed = true;
  }
}
if(yPressed == true){
  if (bounceY.read() == LOW) {
    digitalWrite(ledPin, LOW);
    yPressed = false;
  }
}

if(nPressed == false){
  if (bounceN.read() == HIGH) {
    digitalWrite(ledPin, HIGH);
    Serial.println(String("7"));
    nPressed = true;
  }
}
if(nPressed == true){
  if (bounceN.read() == LOW) {
    digitalWrite(ledPin, LOW);
    nPressed = false;
  }
}

}

In regard to "Is it possible to have 2 pressed at the same time?" , do you mean, register two simultaneous presses? No, so if buzzers A and B are pressed simultaneously, A will register as the button pressed unless you do it between polling A and B. So there is a slight benefit to being A over B, but also D over A. I calculate that the buttons are being polled at least every 10ms, so I think that is sufficient resolution, at least for my purposes.
10  Using Arduino / Project Guidance / Re: pressure vessel on: January 26, 2011, 02:44:30 pm
A kipps apparatus is used to make CO2 this way. you might want to look into it. It autoregulates based on how much gas you take off.
11  Using Arduino / Programming Questions / Re: Running a loop once (Beginner talk!) on: January 26, 2011, 12:27:18 am
could do something like:

Code:
int lightPin = 0;
int motorPin = 9;
boolean trigger=false;

void setup()
{
 pinMode(motorPin, OUTPUT);
 pinMode(lightPin, INPUT);
}

void loop() {
   if (analogRead(lightPin) > 300 && trigger==false) {     
      digitalWrite(motorPin, HIGH);
      delay(2000);
      digitalWrite(motorPin, LOW);
      trigger=true;
        }
   if (analogRead(lightPin) < 300) {
      digitalWrite(motorPin, LOW);
      trigger=false;
        }
  }
12  Community / Exhibition / Gallery / Quiz / Buzzer system (Arduino + Processing) on: January 26, 2011, 12:08:58 am
I spend part of the summer vacation building a quiz system that I can use in the classroom (I'm a science teacher). The buzzers are basically simple buttons and the processing sketch does most of the work.



Don't know if we can embed youtube but here it is in action:
All files are available here.

13  Forum 2005-2010 (read only) / Interfacing / Re: Phidgets ph adapter interfaceing on: January 20, 2011, 06:00:06 pm
Anytime I have used pH meters, step #1 was calibrating. If you interpolate between the high pH sensor value and low pH sensor value can you predict what the middle pH sensor value would be? Aka make up your own equation.

With such close pH values in your samples, it is possible the setup is having trouble. It might be worth beginning with detecting pH3 pH10 then going for precision measurements around pH 7

However I would first alter the code to get more consistent readings. I would analog read once each loop, there may be variations between each reading in your loop (i would bet on it). This would cause inconsistent variation between the corrected and uncorrected values.

I would change the code to:

* read the sensor value x 8
* determine the mean sensor value over 8 measurements.
* calculate the pH based on the mean  sensor value
* calculate the temp corrected pH based on the mean sensor value

Also, It might be worth taking more than 8 readings. (say, 80, but only delay 100...?)

The temperature corrected value seems off, your calculation uses 1024 rather than 200.
14  Forum 2005-2010 (read only) / Interfacing / Re: Detecting an arduino on: January 20, 2011, 06:40:45 am
For reference: Windows (7)/Processing

I've constructed a program using processing which talks to the arduino, and Ideally I would export it as an executable that I could run on other computers besides my own.

The problem is that the total number of serial ports seems to vary in some manner im not aware of, and obviously the settings will vary if i use another computer.

I guess the question is, I am telling processing to look at a specific serial port in a sequence of serial ports (as in hey, look at the third port). Can I tell processing to look at a specific serial port instead (look at COM 7).
15  Forum 2005-2010 (read only) / Interfacing / Detecting an arduino on: January 19, 2011, 02:47:14 am
Is there a simple way to detect the presence of an arduino and which serial port it is connected to? If I export a sketch to an executable, the serial port is hard coded.

I thought about having the processing sketch send a message to every serial port and listen for a reply, but this doesnt seem particularly elegant.
Pages: [1]