mirror of
https://github.com/brendanhaines/RasPi.git
synced 2024-11-09 16:44:40 -07:00
working DSM2 library and DSM2tester
This commit is contained in:
parent
99e929ece7
commit
93e4d90269
|
@ -5,14 +5,21 @@
|
||||||
|
|
||||||
#define VALUE_MASK 0x3FF
|
#define VALUE_MASK 0x3FF
|
||||||
|
|
||||||
DSM2::DSM2( int mode )
|
DSM2::DSM2()
|
||||||
{
|
{
|
||||||
std::cout << "opening serial port..." << std::flush;
|
std::cout << "opening serial port..." << std::flush;
|
||||||
fd = serialOpen( "/dev/ttyAMA0", 115200 );
|
fd = serialOpen( "/dev/ttyAMA0", 115200 );
|
||||||
std::cout << "SUCCESS " << fd << std::endl;
|
if( fd < 0 )
|
||||||
|
{
|
||||||
|
std::cout << "FAILURE" << std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cout << "SUCCESS " << fd << std::endl;
|
||||||
|
}
|
||||||
std::cout << "flushing serial..." << std::flush;
|
std::cout << "flushing serial..." << std::flush;
|
||||||
serialFlush(fd);
|
serialFlush(fd);
|
||||||
std::cout << "SUCCESS" << std::endl;
|
std::cout << "DONE" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DSM2::update()
|
void DSM2::update()
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
class DSM2
|
class DSM2
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DSM2( int mode = 1024 );
|
DSM2();
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
int values[7];
|
int values[7];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user