Show Posts
Pages: [1] 2 3 ... 5
1  Topics / Robotics / Re: Lego Mindstorms NXT on Arduino IDE on: April 07, 2014, 02:07:57 am
Thanks.
It looks like not very handy to do this.
I put my question at a dutch arduino forum too, with the same result.

I've used BricxCC to program NXT in C.
But at our school we use arduino as well. So it should be nice if we had one interface to program both devices.

Gr.
Johan
2  Topics / Robotics / Lego Mindstorms NXT on Arduino IDE on: April 04, 2014, 02:17:02 am
Hello,

Is it possible to programm the Lego Mindstorm (NXT) with the Arduino IDE?
I find (google) it is the same chip as the Arduino Due.

Gr.
Johan
3  Community / Exhibition / Gallery / Re: String numeric output with V-USB HID on: March 20, 2014, 02:26:48 am
Oke, this is an delay-function.
But I want to write the time in excel since beginning of the program.
So we can draw such as a time-temperature chart.

Or I don't understand it well?

Thanks for hint, but the installation of a driver is just what we don't want.

J.

4  Community / Exhibition / Gallery / Re: String numeric output with V-USB HID on: March 19, 2014, 07:39:45 am
Another question:

How is it possible to use the millis() function, because of timer0 is disabled?
Is millis() switchable at different timers?

Johan
5  Community / Exhibition / Gallery / Re: String numeric output with V-USB HID on: February 03, 2014, 05:15:18 am
Works!
The circuit was wrong.
In the usb-connector I used, the sequence of D+, D- etc. was different of the circuit at hackster.io.
I expected that the sequence at the picture was the same of at a real usb-connector. But it was not... :-(

I'm happy to play with it.
Thanks for supporting me.

Gr.
Johan
6  Community / Exhibition / Gallery / Re: String numeric output with V-USB HID on: January 27, 2014, 08:36:23 am
I build the circuit over-and-over, but Zener U$S2 (connected with r2/3) becomes very hot and windows still said that he couldn't find the right drivers for this device.

I bought the 1N5227B. In your article you speak about the 1N5227B-TAP. See comparision:

http://nl.farnell.com/jsp/search/productcompare.jsp?N=0&Ntk=gensearch&Ntt=1N5227B&Ntx=mode+matchallpartial&exposeLevel2Refinement=true&suggestions=false&ref=globalsearch&_requestid=99111


Whats the difference between them?

J.
7  Community / Exhibition / Gallery / Re: String numeric output with V-USB HID on: January 23, 2014, 03:25:43 am
Thanks Ray,
I will check my circuit first.
The components comes from Farnell. As far as I know the same kind of shop than Newark. (element 14).

But I set it up right?
-UNO connect to pc - upload sketch - UNO disconnect - connect usb-circuit - open excel?
Otherwise you have two usb-ports in use. So to who should Excel listen?

I will keep you informed.

Gr.
Johan

8  Community / Exhibition / Gallery / Re: String numeric output with V-USB HID on: January 22, 2014, 03:34:07 am
Hi Ray,

Thanks for answering me on Hackster.io.

I'm a little basic in Arduino code so not all things are clear to me.

What have I done:
-I build the circuit as shown on hackster and other sites with connections at D2, D4, D5, Vcc and Gnd.
-I connect a pot to analog A0
-I uploaded the sketch to my arduino UNO.
-I disconnected my UNO from pc, and give it external Vcc.
-I connected the circuit with the USB connector
-And looks in Excel, and wait, and wait, but nothing happens...

When I connect the selfmade usb connector, my pc gives the message that there are no drivers found for this device. Also the sound you hear by connecting gives three low beeps.

If the steps as shown above are right, I have to check my circuit.

Also I have this questions:
- We will try to use this for measurement up to 2 analog ports. Nothing else. Can I delete all unnecessarry code, p.e. all keystrokes?
- What do you think about the velocity of this realtime connection? Measuring 50Hz lightflashing, or a 440Hz sound?

Thanks for help so far.
I hope it is useful to us. The PLX-DAQ macro for Excel is realy good too, but the disadvantage is that you have first to install the macro on your system before you can work with it.

Gr.
Johan
9  Using Arduino / Programming Questions / Re: statechangedetection and debounce on: December 21, 2013, 06:45:18 am
Thanks for last two replies.
I saw a hardware solution (capacitor) was possible too.
Thats a great idea, i think.

10  Using Arduino / Programming Questions / Re: statechangedetection and debounce on: December 17, 2013, 03:46:31 am
Thanks for explanation.
I, or my students,  will try this later. There are other deadlines at the moment.

(I coach a group of students who do projects by Physics, including some with arduino. And their projecttime is nearly ended. It's all very basic for them and for me, but I hope to enthousiasm them to choose for Arduino.)
11  Using Arduino / Programming Questions / Re: statechangedetection and debounce on: December 12, 2013, 05:35:22 am
Hmm... not as simple as I thought.

When I pushed the button the first time I started millis() to measure the 2 seconds (wherein the 3 pushes must be done).
Evenso I started millis() for debounce.

But the same statements reads the buttonstate for push 1, 2 or 3.

Code:
if (buttonState != lastButtonState) {                // vergelijken met vorige staat van de knop
    if (buttonState == HIGH) {                        // als de status nu HIGH is, is hij dus van LOW naar HIGH gegaan en is de knop dus INgedrukt.
      buttonPushCounter++;                            // we tellen nu +1
      if (buttonPushCounter < 2){                     //als de teller kleiner is dan 2
        starttime = millis();       

I have the measure the time between the first two pushes.

What can I do?

J.
12  Using Arduino / Programming Questions / Re: statechangedetection and debounce on: December 11, 2013, 06:27:27 am
Indeed!
In fact I  coded a 'debounce'-system, only with a debouncetime of 2 seconds.

The only thing i have to do is:
If the second push is within 20 ms, the push isn't a push but a jitter.

Thanks for this eyeopener.

J.
13  Using Arduino / Programming Questions / statechangedetection and debounce on: December 11, 2013, 05:35:41 am
Hi,

When a button is pressed 3 times within 2 seconds, a led light up.
I've done this with the arranged sketch of StateChangeDetection.

Now I want to debounce the button.
But in the Debounce example there look likes a StateChangeDetection too.
When I try to combine this, i think a few statements are double, but I'm not sure of it.

How can i combine these two examples?

This is the my first code (sorry for dutch comment)

Code:
const int  buttonPin = 2;    // the pin that the pushbutton is attached to
const int ledPin = 13;       // the pin that the LED is attached to

// Variables will change:
int buttonPushCounter = 0;   // counter for the number of button presses
int buttonState = 0;         // current state of the button
int lastButtonState = 0;     // previous state of the button

unsigned long starttime;
unsigned long stoptime;
int time;

void setup() {
  pinMode(buttonPin, INPUT);
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}

void loop() {
 
  buttonState = digitalRead(buttonPin);                //uitlezen knop

  if (buttonState != lastButtonState) {                // vergelijken met vorige staat van de knop
    if (buttonState == HIGH) {                        // als de status nu HIGH is, is hij dus van LOW naar HIGH gegaan en is de knop dus INgedrukt.
      buttonPushCounter++;                            // we tellen nu +1
      if (buttonPushCounter < 2){                     //als de teller kleiner is dan 2
        starttime = millis();                         //noemen we dit de starttime (gevuld met de functie millis(), die te tijd in millisec. aangeeft vanaf de start van de sketch)
        Serial.print("starttime: ");
        Serial.println(starttime);
      }
      Serial.print("number of button pushes:  ");
      Serial.println(buttonPushCounter);
    }
  }
  lastButtonState = buttonState;                      //nu is deze status (HIGH) dus de vorige status geworden

  if (buttonPushCounter == 3) {                        //als de teller op waarde 3 staat, dus de knop 3 keer HIGH geweest is
    stoptime = millis();                                // noemen we dat de stoptime, ook weer gevuld met millis()
    Serial.print("stoptime: ");
    Serial.println(stoptime);

    time = stoptime-starttime;                          //we trekken stop- en starttijd van elkaar af en noemen dit 'time'

    Serial.print("time between pushes ");
    Serial.println(time);

    buttonPushCounter = 0;                              //dan zetten we de teller weer op 0, klaar voor de volgende ronde

    if (time < 2000){                                  //nu controleren we op de het optellen van 0 tot 3 binnen de 2 seconden is gebeurt
      digitalWrite(ledPin, HIGH);                      //zo ja, ledje aan of wat dan ook...
    }
    else {
      digitalWrite(ledPin, LOW);                      //en anders niks
    }
  }
}

Gr.
Johan
14  Using Arduino / Programming Questions / Re: keypad read out on: April 25, 2013, 05:57:07 am
A little bit strange thing:

after the 4 inputs I see:
Code:
1
12
123
1234 J

It puts a 'J' after the code. Where did he come from?

This is the code:
Code:
char secureCode[4]={'1','2','3','4'};
char code[4];
char c=0;

void loop(){
  char key=keypad.getKey();
  if(key!=NO_KEY){
    code[c++]=key;
    if(c==4){
      char correct=1;
      for(c=0; c<4; c++){
        correct&=(code[c]==secureCode[c]);
      }
      if(correct){
        //Code for correct keys
      }
      else{
        //Code for incorrect keys
      }
      c=0;
    }
  }
}
15  International / Nederlands / Re: keypad code uitlezen on: April 25, 2013, 04:21:13 am
@ruud

Je moet int code gewoon boven de setup() plaatsen, zodat deze voor heel de sketch te gebruiken is.
Als je 'm in de loop plaatst maakt ie 'm iedere loop weer aan.

Gr.
Johan
Pages: [1] 2 3 ... 5