Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Programming Questions / Problems uploading a sketch to a new board and even an old one on: August 03, 2014, 01:57:02 am
Hello!
I bought a Sparkfun Redboard yesterday. Yes I know its a clone of the Arduino, but it does run the same sketches so please read on. (They are insisting that it is to used the same as an UNO.)

Its supposed to run the blink sketch upon being powered up. Which I'll address to the vendor. However I then tried to upload the same sketch to it. Instead after the process starts I get this error from the tools:
Binary sketch size: 1,084 bytes (of a 32,256 byte maximum)
avrdude: stk500_getsync(): not in sync: resp=0x00 <<<<<<< that one.

It also happens on one that previously worked.

And oddly enough it works on a Uno.

The same sketch does not produce the same error on yet another clone. And that one gets configured as the board design immediately before the Uno one.
2  Products / Arduino Esplora / Using the Tinkerkit input and output points on: November 02, 2013, 11:45:14 am
Hello!
I bought one of these Esplora devices yesterday. Now I'm looking at making use of its form factor to communicate with the logic examples I am frequently designing and testing. Can the Tinkerkit connectors be used for such as that, outside of their intended use of talking to the Tinkerkit assortment of sensors and such like?

Please note I have run some of the examples.
3  Using Arduino / Programming Questions / Re: Problem is with the PS2Mouse example from Playground on: October 24, 2013, 11:16:10 pm
Hello!
Nick G, I don't know if you're following the PS2Mouse example one, but both of the examples that I cited here and in the other one, on the keyboard problem are now fixed.

Oddly enough it was the same <BLEEP!> problem exactly.
4  Using Arduino / Programming Questions / Re: Using the PS2keyboard library example from playground on: October 24, 2013, 11:11:20 pm
And I'm going to post a new thread regarding the other PS2 example.

You don't really need to do that as they are closely related.

I Googled:

Code:
Ps2mouse wconstants.h

I got 101,000 hits.

For "PS2keyboard wconstants.h" I got 172,000 hits.

Did you try to look it up yourself?

Hello!
Actually yes I did. And regardless of how deliberately rude the other fellow was and your being very helpful, I did find it. And that one built properly.

I believe I tried to fix things for other one, and found that it was a case of near as made no difference, the problem still was there.

Oddly enough the reason sadly no longer exists as my original project as purpose has ended. (For the other one that is.) For this one, then yes there is a valid purpose.

Thank you Nick, you were very helpful today.
5  Using Arduino / Programming Questions / Re: Problem is with the PS2Mouse example from Playground on: October 23, 2013, 08:00:19 pm
Quote
I had thought all of the W* headers were either fixed or removed?
They were. So, when you see a library that still uses one, you know it hasn't been updated for 1.0+ use.

Instead of starting another new thread, learn how to search for one of the bazillion posts about how to upgrade the library.

Hello!
Now what are you thinking of? I really do not have any idea as to what you're getting at this time. I didn't run off and start another thread, I started one on a completely unrelated subject.  And wrote an appropriate reply.

The subject of searching and properly doing so for posts on how to upgrade a library should have been supplied not a response from someone who probably collided with the same problem and was able to fix it which was stated improperly, instead of that preposterous response.
6  Using Arduino / Programming Questions / Re: Using the PS2keyboard library example from playground on: October 23, 2013, 07:49:56 pm
Code:
#include "WProgram.h"
Can you find this header file in your installation (of Arduino IDE) directory? I didn't think so.

The library has not been updated for post 1.0 use. You can do that by changing WProgram to Arduino.

Hello!
Find what? I just did find it and change it. Part of the problem is that I needed to open it using a different editor, which was Linux based.

Please try to be less pushy or provocative in your responses. Sadly that's my job to annoy and alienate people.

The library page insisted that it was updated. I suspect that the zip file may not have been completely updated.
7  Using Arduino / Programming Questions / Problem is with the PS2Mouse example from Playground on: October 22, 2013, 11:20:55 pm
Hello!
Okay in this case I went to the Playground location here: http://playground.arduino.cc/ComponentLib/Ps2mouse

And retrieved the library file from it. I then installed its contents in the library folder for the Arduino and attempted to try its example.

Instead using this code:
Code:

#include "ps2dev.h"

PS2dev mouse(3,2); // 2 data 3clock

char buttons[3] = {0,0,0};

int delta_x = 0;
int delta_y = 0;
//we start off not enabled
int enabled =0;

//ack a host command
void ack() {
  while(mouse.write(0xFA));
}

void write_packet() {
  char overflowx =0;
  char overflowy =0;
  char data[3];
  int x,y;
 
  if (delta_x > 255) {
    overflowx =1;
    x=255;
  }
  if (delta_x < -255) {
    overflowx = 1;
    x=-255;
  } 
  if (delta_y > 255) {
    overflowy =1;
    y=255;
  }
  if (delta_y < -255) {
    overflowy = 1;
    y=-255;
  }
 
  data[0] = ((overflowy & 1) << 7) |
    ( (overflowx & 1) << 6) |
    ( (((delta_y &0x100)>>8) & 1) << 5) |
    ( ( ((delta_x &0x100)>>8)& 1) << 4) |
    ( ( 1) << 3) |
    ( ( buttons[1] & 1) << 2) |
    ( ( buttons[2] & 1) << 1) |
    ( ( buttons[0] & 1) << 0) ;
   
  data[1] = delta_x & 0xff;
  data[2] = delta_y & 0xff;
 
  mouse.write(data[0]);
  mouse.write(data[1]);

  mouse.write(data[2]);

  delta_x = 0;
  delta_y = 0;
}

int mousecommand(int command) {
  unsigned char val;

  //This implements enough mouse commands to get by, most of them are
  //just acked without really doing anything

  switch (command) {
  case 0xFF: //reset
    ack();
    //the while loop lets us wait for the host to be ready
    while(mouse.write(0xAA)!=0); 
    while(mouse.write(0x00)!=0);
 
    break;
  case 0xFE: //resend
    ack();
    break;
  case 0xF6: //set defaults
    //enter stream mode   
    ack();
    break;
  case 0xF5:  //disable data reporting
    //FM
    ack();
    break;
  case 0xF4: //enable data reporting
    //FM
    enabled = 1;
    ack();
    break;
  case 0xF3: //set sample rate
    ack();
    mouse.read(&val); // for now drop the new rate on the floor
    //      Serial.println(val,HEX);
    ack();
    break;
  case 0xF2: //get device id
    ack();
    mouse.write(00);
    break;
  case 0xF0: //set remote mode
    ack(); 
    break;
  case 0xEE: //set wrap mode
    ack();
    break;
  case 0xEC: //reset wrap mode
    ack();
    break;
  case 0xEB: //read data
    ack();
    write_packet();
    break;
  case 0xEA: //set stream mode
    ack();
    break;
  case 0xE9: //status request
    ack();
    //      send_status();
    break;
  case 0xE8: //set resolution
    ack();
    mouse.read(&val);
    //    Serial.println(val,HEX);
    ack();
    break;
  case 0xE7: //set scaling 2:1
    ack();
    break;
  case 0xE6: //set scaling 1:1
    ack();
    break;

  }
 
}

int xcenter ;
int ycenter;

int xsum = 0;
int ysum = 0;

void setup() {
  unsigned char val;
 
  // send the mouse start up
  while(mouse.write(0xAA)!=0); 
  while(mouse.write(0x00)!=0);


}




void loop() {
  unsigned char  c;
  if( (digitalRead(3)==LOW) || (digitalRead(2) == LOW)) {
    while(mouse.read(&c)) ;
    mousecommand(c);
  }

  if (enabled) {
    // move the mouse diagonally
    delta_x = 1;
    delta_y = 1;
    write_packet()  ;
  }
  delay(50);

}

And naturally an error surfaces:
Code:
In file included from ps2_mouse.pde:2:
C:\Users\GCL.CMDRSKYWALKER\Documents\Arduino\libraries\ps2dev/ps2dev.h:12:24: error: WConstants.h: No such file or directory

I had thought all of the W* headers were either fixed or removed?
8  Using Arduino / Programming Questions / Using the PS2keyboard library example from playground on: October 22, 2013, 11:12:14 pm
Hello!
I copied the code from the playground library, and pasted it to a blank sketch. I also remembered to download and install the library code from the Playground entry here: http://playground.arduino.cc/Main/PS2Keyboard

The code of course is also there, but here it is:
Code:
#include <PS2Keyboard.h>

#define DATA_PIN 4
PS2Keyboard keyboard;

void setup() {
  keyboard.begin(DATA_PIN);

  Serial.begin(9600);
  Serial.println("hi");
  delay(1000);
}

void loop() {
  if(keyboard.available()) {
    byte dat = keyboard.read();
    byte val = dat - '0';

    if(val >= 0 && val <= 9) {
      Serial.print(val, DEC);
    } else if(dat == PS2_KC_ENTER) {
      Serial.println();
    } else if(dat == PS2_KC_ESC) {
      Serial.println("[ESC]");
    }
  }
}

And it then presented me with an error:
Code:
In file included from sketch_oct23a.ino:1:
C:\Users\GCL.CMDRSKYWALKER\Documents\Arduino\libraries\PS2Keyboard/PS2Keyboard.h:56: error: 'byte' does not name a type
C:\Users\GCL.CMDRSKYWALKER\Documents\Arduino\libraries\PS2Keyboard/PS2Keyboard.h:83: error: 'byte' does not name a type
sketch_oct23a.ino: In function 'void loop()':
sketch_oct23a:16: error: 'class PS2Keyboard' has no member named 'read'

And I'm going to post a new thread regarding the other PS2 example.
9  Using Arduino / LEDs and Multiplexing / Re: One example works from the BiColor LED set, the other doesn't. on: August 09, 2013, 07:04:31 pm
That is not posting your code.
It takes you one single mistake to get error like these.
So linking to some instructions how to use or manipulate hardware will not tell anything about what is wrong with what you've got.

Hello!
The gentleman wanted either my code, or a link to it. I figured that the best way to present it would be the playground location, who best describes it, but since you wanted to see the code I used:
Code:
#include <BiColorLED.h>

// Simple demo of blinking using BiColorLED library
// Requires v1.1 or greater
// (C) 2012 Wolfgang Faust

// To see the effects of this example, just plug a bi-color LED
// into pins 4 and 5, along with the appropriate resistors.

BiColorLED led=BiColorLED(4,5); // (pin 1, pin 2)
unsigned long lb; // Time the colour was last changed

void setup() {
  Serial.begin(9600);
  led.setColor(1);
  led.setColor2(2);
  led.setBlinkSpeed(1000);
}

void loop() {
  // led.drive() MUST be called for blinking (and yellow) to work.
  led.drive();
  if (lb != led.lastBlink) {
    Serial.print(led.blinkSpeed);
    Serial.print(":");
    Serial.println(led.lastBlink);
    lb=led.lastBlink;
  }
}

So that is the code that was presented. I haven't changed anything in it.
10  Using Arduino / LEDs and Multiplexing / Re: One example works from the BiColor LED set, the other doesn't. on: August 08, 2013, 09:08:41 am
Hi, can you post the full code or a link to it please.

Hello!
It gets described here http://playground.arduino.cc//Code/BiColorLED and can be downloaded from places shown there.
11  Using Arduino / LEDs and Multiplexing / One example works from the BiColor LED set, the other doesn't. on: August 07, 2013, 08:53:34 pm
Hello!
I am trying out the BiColor LED examples on an Arduino, and as it happens one of them does work. Naturally the one named in the example, BiColor does indeed work. However the one named Blink does not. It produces an error:
Code:
\Arduino\libraries\bicolor/BiColorLED.h: In function 'void loop()':
\Arduino\libraries\bicolor/BiColorLED.h:42: error: 'long unsigned int BiColorLED::lastBlink' is private
Blink:23: error: within this context
\Arduino\libraries\bicolor/BiColorLED.h:42: error: 'long unsigned int BiColorLED::blinkSpeed' is private
Blink:24: error: within this context
\Arduino\libraries\bicolor/BiColorLED.h:42: error: 'long unsigned int BiColorLED::lastBlink' is private
Blink:26: error: within this context
\Arduino\libraries\bicolor/BiColorLED.h:42: error: 'long unsigned int BiColorLED::lastBlink' is private
Blink:27: error: within this context

And the code that threw up that error message is:

Quote
  if (lb != led.lastBlink) {

I confess I am lost here.
12  Using Arduino / Displays / Re: BiColor LEDs (New Problem) on: July 04, 2013, 01:27:30 pm
Okay, that worked. I'll concede the point. However what about mentioning that on the Playground page?

Mentioning what?

I general if you get the error: "'name' does not name a type" it means that you either spelled 'name' wrong or the library that defines the name was not installed.

Hello!
I beg your pardon, what I posted there,
Quote
However what about mentioning that on the Playground page?
Should say "However what about mentioning that one on the Playground page?". Implying that anyone wanting to make use of his (the creator of the library) library, should be aware of how to properly install any library.
13  Using Arduino / Displays / Re: BiColor LEDs (New Problem) on: July 04, 2013, 12:48:59 pm
Quote
It looks like the BiColorLED library is not properly installed.

Hello!
Okay, that worked. I'll concede the point. However what about mentioning that on the Playground page?
14  Using Arduino / Displays / BiColor LEDs (New Problem) on: July 04, 2013, 11:40:33 am
Hello!
I just returned to the Arduino after another absence. I decided to try and see if I could apply the ideas for making use of the classic bicolor LED. And chose to try and get to work with 1.05 the examples from the Playground.

However it causes an error, here:
Quote
BiColorLED:9: error: 'BiColorLED' does not name a type
BiColorLED.pde: In function 'void loop()':
BiColorLED:19: error: 'led' was not declared in this scope
BiColorLED:38: error: 'led' was not declared in this scope

That was shown in the sketch here:

Quote
BiColorLED led=BiColorLED(4,5); // (pin 1, pin 2)


As it happens I went and changed the header portion to accommodate the settings for running on everything after 1.x releases.
15  Using Arduino / Installation & Troubleshooting / Re: Arduino Uno R3 shows as Atmega 16u2 DFU on: July 01, 2013, 04:48:19 pm
Hello!
Problem solved. That device was returned to a different Radio Shack, and the newer one works exactly as advertised. I believe it was returned before, because the "Standard Disclaimer" form that was inside this one, wasn't inside the other. Of course the Store Manager doesn't want to believe me, but that's to be expected. smiley-eek
Pages: [1] 2 3 4