Nar0x
Mitglied
Benutzerprofil
Anmeldungsdatum: 11.03.2010
Beiträge: 1
|
Nar0x Mitglied
12:11:24 11.03.2010 Titel: |
Bluetoothboard-ConnectionProgramm |
Zitieren |
Hey Leute,
ich mache in Projekt in der SChule woch ich mit einem Bluetoothboard arbeite und ich komme bei einen Computerprogramm nicht mehr weiter da es immer einen Error anzeigt. Ich hab auch schon gegoogelt,aber da kam ich auch nicht weiter.
Main:
| C/C++ Code: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | #include <windows.h>
#include <winuser.h>
#include <stdio.h>
#include <conio.h>
#include "hb625.h"
#define BAUDRATE 9600
#define TIMEOUT 5000 //ms
#define POLLING_INTERVAL 1000 //ms
unsigned char Com_Port_Number, Error, channel;
BOOL Loop = TRUE;
UINT idTimer;
MSG msg;
void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime);
int main(void)
{
printf("Enter the HB625 com port number(1..255):");
scanf("%d", &Com_Port_Number);
//open com port
if( !Open_HB625( Com_Port_Number, BAUDRATE, TIMEOUT ) )
{
printf("Can't open port!\n");
return 1;
}
printf("\n\r");
//start timer
idTimer = SetTimer(NULL, 0, POLLING_INTERVAL, (TIMERPROC) TimerProc);
if( !idTimer )
{
printf("Can't start timer!");
return 1;
}
while(Loop)
{
GetMessage(&msg, NULL, 0, 0);
DispatchMessage(&msg);
if( _kbhit() )
Loop = FALSE;
}
KillTimer(NULL, idTimer);
Close_HB625();
return 0;
}
void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
{
if( Set_Digital_Output((1<<channel), &Error) )
{
printf("Digital output N%1d is ON;\r", channel+1);
if( channel < 7)
channel++;
else
channel = 0;
}
else
{
printf("\n\rError: %d;\n", Error);
Loop = FALSE;
}
}
| |
| C/C++ Code: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | #include <windows.h>
#include <winuser.h>
#include <stdio.h>
#include <conio.h>
#include "hb625.h"
#define BAUDRATE 9600
#define TIMEOUT 5000 //ms
#define POLLING_INTERVAL 1000 //ms
unsigned char Com_Port_Number, Error, channel;
BOOL Loop = TRUE;
UINT idTimer;
MSG msg;
void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime);
int main(void)
{
printf("Enter the HB625 com port number(1..255):");
scanf("%d", &Com_Port_Number);
//open com port
if( !Open_HB625( Com_Port_Number, BAUDRATE, TIMEOUT ) )
{
printf("Can't open port!\n");
return 1;
}
printf("\n\r");
//start timer
idTimer = SetTimer(NULL, 0, POLLING_INTERVAL, (TIMERPROC) TimerProc);
if( !idTimer )
{
printf("Can't start timer!");
return 1;
}
while(Loop)
{
GetMessage(&msg, NULL, 0, 0);
DispatchMessage(&msg);
if( _kbhit() )
Loop = FALSE;
}
KillTimer(NULL, idTimer);
Close_HB625();
return 0;
}
void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
{
if( Set_Digital_Output((1<<channel), &Error) )
{
printf("Digital output N%1d is ON;\r", channel+1);
if( channel < 7)
channel++;
else
channel = 0;
}
else
{
printf("\n\rError: %d;\n", Error);
Loop = FALSE;
}
}
| |
| C/C++ Code: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | #include <windows.h>
#include <winuser.h>
#include <stdio.h>
#include <conio.h>
#include "hb625.h"
#define BAUDRATE 9600
#define TIMEOUT 5000 //ms
#define POLLING_INTERVAL 1000 //ms
unsigned char Com_Port_Number, Error, channel;
BOOL Loop = TRUE;
UINT idTimer;
MSG msg;
void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime);
int main(void)
{
printf("Enter the HB625 com port number(1..255):");
scanf("%d", &Com_Port_Number);
//open com port
if( !Open_HB625( Com_Port_Number, BAUDRATE, TIMEOUT ) )
{
printf("Can't open port!\n");
return 1;
}
printf("\n\r");
//start timer
idTimer = SetTimer(NULL, 0, POLLING_INTERVAL, (TIMERPROC) TimerProc);
if( !idTimer )
{
printf("Can't start timer!");
return 1;
}
while(Loop)
{
GetMessage(&msg, NULL, 0, 0);
DispatchMessage(&msg);
if( _kbhit() )
Loop = FALSE;
}
KillTimer(NULL, idTimer);
Close_HB625();
return 0;
}
void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
{
if( Set_Digital_Output((1<<channel), &Error) )
{
printf("Digital output N%1d is ON;\r", channel+1);
if( channel < 7)
channel++;
else
channel = 0;
}
else
{
printf("\n\rError: %d;\n", Error);
Loop = FALSE;
}
}
| |
Die HB625-Header-Datei
| C/C++ Code: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #ifndef _HB625_H_
#define _HB625_H_
#include <windows.h>
#define ERR_NO 0 // no error
#define ERR_TX 1 // Tx error
#define ERR_RX 2 // Rx error
#define ERR_CS 3 // control sum error
#define ERR_PARAM 4 // parameters value error
#ifdef _HB625_EXPORT_
#define HB625_API __declspec(dllexport)
#else
#define HB625_API __declspec(dllimport)
#endif
#ifdef __cplusplus
extern "C" {
#endif
HB625_API BOOL WINAPI Open_HB625( unsigned char comport, long baudrate, long timeout );
HB625_API BOOL WINAPI Close_HB625(void);
HB625_API BOOL WINAPI Read_All_Channel( short int* Result_Array, unsigned char* error );
HB625_API BOOL WINAPI Set_Digital_Output( unsigned char out, unsigned char* error );
#ifdef __cplusplus
}
#endif
#endif /* _HB625_H_ */
| |
| C/C++ Code: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #ifndef _HB625_H_
#define _HB625_H_
#include <windows.h>
#define ERR_NO 0 // no error
#define ERR_TX 1 // Tx error
#define ERR_RX 2 // Rx error
#define ERR_CS 3 // control sum error
#define ERR_PARAM 4 // parameters value error
#ifdef _HB625_EXPORT_
#define HB625_API __declspec(dllexport)
#else
#define HB625_API __declspec(dllimport)
#endif
#ifdef __cplusplus
extern "C" {
#endif
HB625_API BOOL WINAPI Open_HB625( unsigned char comport, long baudrate, long timeout );
HB625_API BOOL WINAPI Close_HB625(void);
HB625_API BOOL WINAPI Read_All_Channel( short int* Result_Array, unsigned char* error );
HB625_API BOOL WINAPI Set_Digital_Output( unsigned char out, unsigned char* error );
#ifdef __cplusplus
}
#endif
#endif /* _HB625_H_ */
| |
| C/C++ Code: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #ifndef _HB625_H_
#define _HB625_H_
#include <windows.h>
#define ERR_NO 0 // no error
#define ERR_TX 1 // Tx error
#define ERR_RX 2 // Rx error
#define ERR_CS 3 // control sum error
#define ERR_PARAM 4 // parameters value error
#ifdef _HB625_EXPORT_
#define HB625_API __declspec(dllexport)
#else
#define HB625_API __declspec(dllimport)
#endif
#ifdef __cplusplus
extern "C" {
#endif
HB625_API BOOL WINAPI Open_HB625( unsigned char comport, long baudrate, long timeout );
HB625_API BOOL WINAPI Close_HB625(void);
HB625_API BOOL WINAPI Read_All_Channel( short int* Result_Array, unsigned char* error );
HB625_API BOOL WINAPI Set_Digital_Output( unsigned char out, unsigned char* error );
#ifdef __cplusplus
}
#endif
#endif /* _HB625_H_ */
| |
| Code: | 1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 | --------------------Configuration: mingw5 - CUI Debug, Builder Type: MinGW--------------------
Checking file dependency...
Compiling C:\Users\Florian\Documents\Schule\3ahit\PPM\C\Testprogramm1\c01.c...
Linking...
[Error] C:\Users\Florian\Documents\Schule\3ahit\PPM\C\Testprogramm1\c01.c:27: undefined reference to `_imp__Open_HB625@12'
[Error] C:\Users\Florian\Documents\Schule\3ahit\PPM\C\Testprogramm1\c01.c:55: undefined reference to `_imp__Close_HB625@0'
[Error] C:\Users\Florian\Documents\Schule\3ahit\PPM\C\Testprogramm1\c01.c:61: undefined reference to `_imp__Set_Digital_Output@8'
[Error] collect2: ld returned 1 exit status
Complete Make c01: 4 error(s), 0 warning(s)
| |
| Code: | 1 2 3 4 5 6 7 8 9 10 11 | --------------------Configuration: mingw5 - CUI Debug, Builder Type: MinGW--------------------
Checking file dependency...
Compiling C:\Users\Florian\Documents\Schule\3ahit\PPM\C\Testprogramm1\c01.c...
Linking...
[Error] C:\Users\Florian\Documents\Schule\3ahit\PPM\C\Testprogramm1\c01.c:27: undefined reference to `_imp__Open_HB625@12'
[Error] C:\Users\Florian\Documents\Schule\3ahit\PPM\C\Testprogramm1\c01.c:55: undefined reference to `_imp__Close_HB625@0'
[Error] C:\Users\Florian\Documents\Schule\3ahit\PPM\C\Testprogramm1\c01.c:61: undefined reference to `_imp__Set_Digital_Output@8'
[Error] collect2: ld returned 1 exit status
Complete Make c01: 4 error(s), 0 warning(s)
| |
| Code: | 1 2 3 4 5 6 7 8 9 10 11 | --------------------Configuration: mingw5 - CUI Debug, Builder Type: MinGW--------------------
Checking file dependency...
Compiling C:\Users\Florian\Documents\Schule\3ahit\PPM\C\Testprogramm1\c01.c...
Linking...
[Error] C:\Users\Florian\Documents\Schule\3ahit\PPM\C\Testprogramm1\c01.c:27: undefined reference to `_imp__Open_HB625@12'
[Error] C:\Users\Florian\Documents\Schule\3ahit\PPM\C\Testprogramm1\c01.c:55: undefined reference to `_imp__Close_HB625@0'
[Error] C:\Users\Florian\Documents\Schule\3ahit\PPM\C\Testprogramm1\c01.c:61: undefined reference to `_imp__Set_Digital_Output@8'
[Error] collect2: ld returned 1 exit status
Complete Make c01: 4 error(s), 0 warning(s)
| |
Er meldet immer das er diese Befehle für das Board nicht findet.
Das programm hab ich nicht selber geschriebn sondern die waren bei dem Board dabei und da war auch das compilierte Prog. dabei.
mfg Nar0x |
|
|
|