mirror of
https://github.com/brendanhaines/RasPi.git
synced 2025-04-11 19:24:51 -06:00
working DSM2 library and DSM2tester
This commit is contained in:
parent
99e929ece7
commit
93e4d90269
@ -5,14 +5,21 @@
|
||||
|
||||
#define VALUE_MASK 0x3FF
|
||||
|
||||
DSM2::DSM2( int mode )
|
||||
DSM2::DSM2()
|
||||
{
|
||||
std::cout << "opening serial port..." << std::flush;
|
||||
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;
|
||||
serialFlush(fd);
|
||||
std::cout << "SUCCESS" << std::endl;
|
||||
std::cout << "DONE" << std::endl;
|
||||
}
|
||||
|
||||
void DSM2::update()
|
||||
|
@ -4,7 +4,7 @@
|
||||
class DSM2
|
||||
{
|
||||
public:
|
||||
DSM2( int mode = 1024 );
|
||||
DSM2();
|
||||
|
||||
void update();
|
||||
int values[7];
|
||||
|
Loading…
x
Reference in New Issue
Block a user