Welcome InMyPi Forum / Guestbook




hans-jacob Sat 12 Jan 2019 at 18:00:19
Re: ACTION Flamingo SF-501 433Mhz Remote Control Wall Socket

-
nu even de complete file
 
 GNU nano 2.7.4                                                                             File: newkaku.cpp                                                                                       

#include <wiringPi.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <unistd.h>
#include <ctype.h>
#include <iostream>
#include "NewRemoteTransmitter.cpp"

using namespace std;

int main(int argc, char **argv)
{
    int pin_out = 0; // Pin out using wiringPi pin numbering scheme (15 = TxD / BCM GPIO 14, see _H_T_T_P_S_://projects.drogon.net/raspberry-pi/wiringpi/pins/)
    int device = 0;
    int address = 0;
    bool state = false;
   
   
    if( argc != 4 ) { // not enough arguments
        std::cout << "usage: " << argv[0] << " address device state" << std::endl;
        std::cout << "example: " << argv[0] << " M 10 on" << std::endl;
            return 0;
    } else {
            std::cout << "adress1" << argv[1] << " test " << std::endl;
            address = atol(argv[1]);
            device = atol(argv[2]);
            string statestr = argv[3];
           
            if( statestr.compare("on") == 0 ) {
                    state = true;
            } else {
                    state = false;
            }
    }
   
    // load wiringPi
        if(wiringPiSetup() == -1)
        {
                printf("WiringPi setup failed. Maybe you haven't installed it yet?");
                exit(1);
        }

    // setup pin and make it low
        pinMode(pin_out, OUTPUT);
        digitalWrite(pin_out, LOW);
//      KaKuSwitch kaKuSwitch(pin_out);
//      kaKuSwitch.sendSignal(address, device, state);
std::cout << "address= " << address << " device= " << device << std::endl;
NewRemoteTransmitter transmitter(address, 0, 260, 3);
transmitter.setAddress(address);
transmitter.sendUnit(device, state);
}


mogelijk dat niet alles doorkomt in dit <pre> textveld = includes komen hier niet door 
denk dat ie dat als html command ziet omdat includes tussen < > staan
html <code> werkt niet 
oh html <xmp> does the trick


#include <wiringPi.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <unistd.h>
#include <ctype.h>
#include <iostream>
#include "NewRemoteTransmitter.cpp"

using namespace std;

int main(int argc, char **argv) 
{
    int pin_out = 0; // Pin out using wiringPi pin numbering scheme (15 = TxD / BCM GPIO 14, see https://projects.drogon.net/raspberry-pi<wbr />/wiringpi/pins/)
    int device = 0;
    int address = 0;
    bool state = false;
    
    
    if( argc != 4 ) { // not enough arguments
    	std::cout << "usage: " << argv[0] << " address device state" << std::endl;
    	std::cout << "example: " << argv[0] << " M 10 on" << std::endl;
	    return 0;
    } else {
            std::cout << "adress1" << argv[1] << " test " << std::endl;
	    address = atol(argv[1]);
	    device = atol(argv[2]);
	    string statestr = argv[3];
	    
	    if( statestr.compare("on") == 0 ) {
		    state = true;
	    } else {
		    state = false;
	    }
    }
    
    // load wiringPi
	if(wiringPiSetup() == -1)
	{
		printf("WiringPi setup failed. Maybe you haven't installed it yet?");
		exit(1);
	}

    // setup pin and make it low
	pinMode(pin_out, OUTPUT);
	digitalWrite(pin_out, LOW);
//	KaKuSwitch kaKuSwitch(pin_out);
//	kaKuSwitch.sendSignal(address, device, state);
std::cout << "address= " << address << " device= " << device << std::endl;
NewRemoteTransmitter transmitter(address, 0, 260, 3);
transmitter.setAddress(address);
transmitter.sendUnit(device, state);
}




End of Message, Thanks For Viewing! ☺
Tip: if your watching on your phone or tablet ⁝ add / save to homescreen and you get a nice icon its Free!
Tip: on your computer or laptop do not forget to bookmark this page its Free!
BookMark ShortCut Keys press ctrl+d on your keyboard




-

-

Reply to this Message


Name
Subject
Message

, <code> <b> <i> <u> .






POLL / VOTE
Did you like this Page id=231 ?

NO:         YES:




   


Design a Bit like ForumOne 4.0 WayBack 1999 ©
Always Read the Small print?!



http://forum.luberth.com - - http://www.luberth.com/forum/

thanks for your support
Thank You!




Co2 FootPrint of this WebServer



                         My Cheap Chinese Friend Ali     
Copyright Luberth Dijkman 2018 ... 2019