Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with loop For
29-03-2013, 11:13 AM,
RE: Problem with loop For
As far as I can see, this is more a C problem than a Pinguino problem.

1- Wtv020sd16p.h defines a C++ class, you should use only C like this :
#ifndef Wtv020sd16p_h
#define Wtv020sd16p_h

  Wtv020sd16p(int resetPin,int clockPin,int dataPin,int busyPin);
  void reset();
  void playVoice(int voiceNumber);
  void asyncPlayVoice(int voiceNumber);
  void stopVoice();
  void pauseVoice();
  void mute();
  void unmute();
  void sendCommand(unsigned int command);
  int _resetPin;
  int _clockPin;
  int _dataPin;
  int _busyPin;
  int _busyPinState;


2- in void setup(), you call resetModule() which is defined after your call. You should prototype your functions before. This is actually what Wtv020sd16p.h is done for so just add void resetModule(); in your header file.

3- With SDCC, you can't write :
for (unsigned int mask = 0x8000; mask > 0; mask >>= 1)
You should write this instead :
unsigned int mask;
for (mask = 0x8000; mask > 0; mask >>= 1)

4- I can't see all functions defined in Wtv020sd16p.h in your code ...

Good luck.

(28-03-2013, 05:49 AM)plautz Wrote: Hello,

My first post here, so excuse-me if it is in wrong area.

I'm trying to port code from arduino to pinguino, but without success.

The code is to control a sound module (WTV020-SD-16P) with simple commands.

The code is attached and when I try to compile with pinguino it says that an error during compilations happens.

The problem seems to be on function SendCommand (between lines 54 and 78) and the file Wtv020sd16p.h, because if these are commenteds is possible to compile the code.

Any ideas?

Thanks in advance and sorry for my bad english (I'm from Brasil).

It is easier to complain than it is to do, but it is better to do than it is to complain.

Messages In This Thread
Problem with loop For - by plautz - 28-03-2013, 05:49 AM
RE: Problem with loop For - by regis - 29-03-2013, 11:13 AM
RE: Problem with loop For - by plautz - 29-03-2013, 02:17 PM
RE: Problem with loop For - by latcakir - 20-05-2013, 09:53 AM
RE: Problem with loop For - by plautz - 21-05-2013, 09:24 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)