Show Posts
Pages: [1] 2 3
1  Using Arduino / Networking, Protocols, and Devices / Re: GPS Bee and Seeeduino Stalker on: April 19, 2011, 02:18:55 pm
No suggestion?
2  Using Arduino / Networking, Protocols, and Devices / GPS Bee and Seeeduino Stalker on: April 18, 2011, 04:02:11 pm
Hi,

I'm trying to use a GPS Bee with a Seeeduino Stalker2.0, but I'm not able to obtain nmea string, either in the bee slot and using a seeedstudio xbeeShield. No problem when I link an xbee module in these 2 places.
No problem when I use a GPS Bee with a regular Arduino and a XbeeShield.

Here the code I use:
Code:
/*
Program that read a char from serial port and turn on a led (pin 13)
 if the char was H. Put it low is the char is an L
 */
 
 /* parallax code */
 
//int ledPin = 13;
 
#include <Wire.h>



char string[32];
char byteRead;

int ledPin = 13;                  // LED test pin
 int rxPin = 0;                    // RX PIN
 int txPin = 1;                    // TX TX
 int byteGPS=-1;
 char linea[300] = "";
 char comandoGPR[7] = "$GPRMC";
 int cont=0;
 int bien=0;
 int conta=0;
 int indices[13];
 /*------------------------------------*/




void setup() {
  // initialize serial communication:
  Serial.begin(9600);
  /* parallax code */
  for (int i=0;i<300;i++){       // Initialize a buffer for received data
     linea[i]=' ';
   }
   
  // initialize the LED pins:
 // pinMode(ledPin, OUTPUT);
}


void loop() {
 
   digitalWrite(ledPin, HIGH);
   byteGPS=Serial.read();         // Read a byte of the serial port
   if (byteGPS == -1) {           // See if the port is empty yet
     delay(100);
   } else {
     linea[conta]=byteGPS;        // If there is serial port data, it is put in the buffer
     conta++;                     
     Serial.print(byteGPS, BYTE);
     
     
                       
     }
   } 

  /*
 
 
  // read the port:

 int availableBytes = Serial.available();
for(int i=0; i<availableBytes; i++)
{
    string[i] = Serial.read();
}
Serial.print(string);
Serial.println();
   } */

Thank you for any opinion!

Marco.
3  Using Arduino / Installation & Troubleshooting / Re: Can't upload to Seeeduino Stalker v1.o using USB and UartsBee 3.1 on: February 07, 2011, 10:41:17 am
Hi!

Have you tried to contact Icing Chang from Seeedustudio? He 'll be able to help you.

Saludos.

Marco.
4  General Category / General Discussion / Re: first arduino on: February 02, 2011, 04:08:21 pm
Inventor's kit from sparkfun should works
http://www.sparkfun.com/products/10173
5  General Category / General Discussion / Re: How to program an intel CPU on: February 02, 2011, 04:02:23 pm
merci pour toute ces précision Richard!

6  General Category / General Discussion / Re: How to program an intel CPU on: February 02, 2011, 02:13:41 pm
All of this is very difficult to solder at home. Much cheaper is to go to computer hardware shop and to buy a motherboard there.
I've got one smiley

Are you able to do things like blink a led? Is it difficult to load a program in a ROM?

 smiley
7  General Category / General Discussion / How to program an intel CPU on: February 01, 2011, 07:46:25 am
Ola.

I would like to ask to people with some notion over it, at very high level terms, how intel CPUs programming works.

One easily can find slides with assembler for x086 processor. But does modern Intel CPUs works the same way? Can I to plug a cpu in a breadbord or have to use a special socket? Other hardware is needed? 

Looking at the RS catalogue one can find some intel cpu, a part of the Atom line in a so called FCBGA8 package (437 pin!).

Just my little curiosity  smiley

Saludos.

Marco.
Marco
 
8  General Category / General Discussion / Re: Hello from The Philippines! on: February 01, 2011, 07:18:28 am
Thank you for your friendship!

Saluti da Torino! (IT)
9  Forum 2005-2010 (read only) / Syntax & Programs / Re: HOW to work with vs 9 c++ compiler on: January 09, 2011, 03:49:34 pm
Try to take a look at the first message of this post:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1289140820
10  Forum 2005-2010 (read only) / Syntax & Programs / Re: Send data to arduino via Visual C++  and print it on: October 08, 2010, 07:16:43 am
Really Really thanks Paul, you are one of the biggest resource of the entire Arduino environment.  You have to put yourself in a library (PaulS.h  smiley-grin).

When I'm back home I'll try to modify the code
11  Forum 2005-2010 (read only) / Syntax & Programs / Re: Send data to arduino via Visual C++  and print it on: October 08, 2010, 06:45:57 am
Thanks Paul  smiley-grin
I'm trying with this code:
Code:
_serialPort->Write(startString,0,3);
     int Buffer= _serialPort->Read(buffer,0,3);
    }
    _serialPort->Close();
But I'm receiving odd data (Like buffer = 1, instead of '>' I'm sending). Have I to set some Sleep?or cycles or set String^ instead of int

 :o
12  Forum 2005-2010 (read only) / Syntax & Programs / Re: Send data to arduino via Visual C++  and print it on: October 07, 2010, 03:39:18 am
Mhh some topic ago is written that Close() reset the arduino...
13  Forum 2005-2010 (read only) / Syntax & Programs / Send data to arduino via Visual C++  and print it on: October 07, 2010, 03:08:00 am
Hello everyone,

I'm trying to send some serial data from a Visual C++ console program to an arduino, and i would like to print it out in the serial monitor.

I can't manage to print the data in real time becouse the serial port is busy with the C program, and probably the things are too fast and when I open the serial monitor data has gone.

What can I do about this? Can i save dato to an eprom, or what..?

Thanks a lot for help!

Here the sketch  
Code:
byte inByte;
byte messaggio[] = {
  0, 0, 0, 0, 0, 0, 0, 0};
void setup()
{
  Serial.begin(9600);


}

void loop()
{

  if (Serial.available() > 0) {
    inByte = Serial.read();
    for (int ii=0; ii<=7; ii++)
    {
      messaggio[ii] = inByte;
      ii = ii + 1;
    }
    delay(1000);
    Serial.println("il valore di  e'" );
    Serial.print (messaggio[0]);

    Serial.print (messaggio[1]);

    Serial.print (messaggio[2]);

    Serial.print (messaggio[3]);

    Serial.print (messaggio[4]);

    Serial.print (messaggio[5]);

    Serial.print (messaggio[6]);

    Serial.println (messaggio[7]);


  }
}


and the Visual C++ program (I'm sending data with sendData_starString method)
Code:
// sendPacket.cpp : file di progetto principale.

namespace sendPacket {
#include "stdafx.h"
#include <cstdio>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdexcept>



using namespace System;
using namespace std;
using namespace System::IO;
using namespace System::IO::Ports;
using namespace System::Threading;

//initialize flags structure (:1 means 1 bit register dimension, using bitfields)
  struct FLAGS{

  unsigned short pitch:1;
  unsigned short roll:1;
  unsigned short thrust:1;
  unsigned short yaw:1;
  unsigned short acc:1;
  unsigned short height:1;
  unsigned short acc_height:1;
  unsigned short trigger:1;
  unsigned short freq:8;
};

  //initialize data to send
struct SCIENTIFIC_COMMANDDATA
{
    //always 0x17
     unsigned char packetdescriptor;
    //pitch, roll, thrust, yaw commands. 0..4095 2048=middle
    unsigned short pitch;
    unsigned short roll;
    unsigned short thrust;
    unsigned short yaw;
    //flags
    //Bit 0(0x01): Pitch control through serial interfacae enabled
    //Bit 1(0x02): Roll control through serial interface enabled
    //Bit 2(0x04): Thrust control through serial interface enabled
    //Bit 3(0x08): Yaw control through serial interface enabled
    //Bit 4(0x10): ACC-Mode on/off
    //Bit 5(0x20): Height control - on/off (only with ACC)
    //Bit 6(0x40): overwrite ACC/Height mode control
    //(0=mode selected by RC 1=mode selected by Bit 4 and 5)
    //Bit 7(0x80): Trigger Scientific status packet (triggers a response
    //with the actual scientific state)
    //Bit 8..15: sendrate of the scientific packet in 5Hz
    //(0=off;1=5Hz, 20=100Hz, 200=1kHz)
    //Scientific packet is send for three seconds max.
    //after the last command_data packet
    unsigned short flags;

};


//send-data methods
void sendData_startString(array<unsigned char> ^ startString)
{


    
    
    StringComparer^ stringComparer = StringComparer::OrdinalIgnoreCase;
    //Thread^ readThread = gcnew Thread(gcnew ThreadStart(PortChat::Read));

    // Create a new SerialPort object with default settings.
    SerialPort^  _serialPort = gcnew SerialPort("COM4");

    // Allow the user to set the appropriate properties.
    _serialPort->BaudRate = 9600 ;
    _serialPort->Parity = Parity::None;
    _serialPort->DataBits = 8;
    _serialPort->StopBits = StopBits::One;
    _serialPort->Handshake =Handshake::None;

    // Set the read/write timeouts
   // _serialPort->ReadTimeout = 500;
  //  _serialPort->WriteTimeout = 500;
    _serialPort->Open();
   int ii;
   for(ii=0;ii<10;ii++)
   {
    _serialPort->Write(startString,0,3);
    Thread::Sleep(1000);
   }


    _serialPort->Close();


}

 //declare crc methods
unsigned short crc_update(unsigned short crc, unsigned char data)
{

    data ^= (crc & 0xff);
    data ^= data << 4;
    return ((((unsigned short )data << 8) | ((crc>>8)&0xff)) ^ (unsigned char )(data >> 4)
            ^ ((unsigned short )data << 3));


}
unsigned short crc16(void* data, unsigned short cnt)
{
    //unsigned short crc=0xff;
    unsigned char * ptr=(unsigned char *) data;
    int i;
    unsigned short crc;
    for (i=0;i<cnt;i++)
    {
        crc=crc_update(crc,*ptr);
        Console::WriteLine("crc:"+crc);
        ptr++;
    }
    return  crc;

}



int data;
unsigned short crc=0xff;
unsigned short crc_fin;


int main(array<System::String ^> ^args)
{
    //initialize struct
   FLAGS myFlags;
   SCIENTIFIC_COMMANDDATA scientific_commanddata;
  
    //set startstring
    array<unsigned char>^ startString={'>','*','>'};
   //unsigned char startString[]={'>','*','>'};
    // flags manually set
   myFlags.pitch=0;
   myFlags.roll=0;
   myFlags.thrust=0;
   myFlags.yaw=0;
   myFlags.acc=1;
   myFlags.height=0;
   myFlags.acc_height=0;
   myFlags.trigger=1;
   myFlags.freq= 20; //20 hz??
    
    //other SCIENTIFIC_COMMANDATA variables manually set
   scientific_commanddata.packetdescriptor = 0x17;
   scientific_commanddata.pitch= 0;
   scientific_commanddata.roll=0;
   scientific_commanddata.thrust=100;
   scientific_commanddata.yaw=0;
   _int8 length=sizeof(scientific_commanddata);
   void* ptr;
   ptr=&(scientific_commanddata.packetdescriptor);
       void *data_p=&data;

    crc16(ptr,length);
    sendData_startString(startString);


    printf("sizeof startString: %d bytes\n",sizeof(startString));
    printf("sizeof scientific_commandata: %d bytes\n",sizeof(scientific_commanddata));
    printf("sizeof flags: %d bytes\n",sizeof(myFlags));
    printf("sizeof lenght: %d bytes\n",sizeof(length));
    printf("starbytes: %s\n",startString);
    printf("crc16: %d\n",crc);
    char Hex[64];
    _itoa_s(crc, Hex, 16);
    printf("crc16 (hex): %s\n",Hex);
    getchar();
    return 0;
}
 
14  Forum 2005-2010 (read only) / Italiano / Re: Arduino a scuola on: October 12, 2010, 02:34:54 am
Azz non ci avessi da lavorare mi piacerebbe davvero venirvi a sentire. Se ripenso alla formazione da perito elettronico che ho ricevuto mi metto a piangere :'(
15  Forum 2005-2010 (read only) / Italiano / Re: problema memoria esterna on: October 12, 2010, 02:29:57 am
Grazie per le informazioni uwefed  smiley-grin!
Ci sono alcune persone in questo forum che amano l'elettronica e non si fanno problemi a spiegarcela mettendoci qualche "pulce" nell'orecchio. Aggiungono un sacco di valore a tutto il mondo di Arduino, e tu sei  una di queste (l'altro che mi ha già aiutato molto è PaulS).
Azz dovevo fare ingegneria elettronica invece che gestionale.
Pages: [1] 2 3