Click here to Skip to main content
15,887,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Adding two matrix objects and assigning the result to third object using overloaded operators ? Pin
Tarun Jha25-Mar-18 5:08
Tarun Jha25-Mar-18 5:08 
GeneralRe: Adding two matrix objects and assigning the result to third object using overloaded operators ? Pin
Richard MacCutchan25-Mar-18 5:32
mveRichard MacCutchan25-Mar-18 5:32 
GeneralRe: Adding two matrix objects and assigning the result to third object using overloaded operators ? Pin
Tarun Jha25-Mar-18 6:37
Tarun Jha25-Mar-18 6:37 
GeneralRe: Adding two matrix objects and assigning the result to third object using overloaded operators ? Pin
Richard MacCutchan25-Mar-18 7:16
mveRichard MacCutchan25-Mar-18 7:16 
GeneralRe: Adding two matrix objects and assigning the result to third object using overloaded operators ? Pin
Tarun Jha25-Mar-18 8:06
Tarun Jha25-Mar-18 8:06 
QuestionLinux C++ implementation of ioctl SOLVED Pin
Vaclav_23-Mar-18 8:50
Vaclav_23-Mar-18 8:50 
AnswerRe: Linux C++ implementation of ioctl Pin
Jochen Arndt24-Mar-18 23:39
professionalJochen Arndt24-Mar-18 23:39 
AnswerRe: Linux C++ implementation of ioctl Pin
leon de boer26-Mar-18 16:53
leon de boer26-Mar-18 16:53 
The speed is configured outside the program or on the library you are using on the Pi

Edit /boot/config.txt if it doesn't exist create it
add the line or edit the line with your baudrate
dtoverlay=i2c-speed,i2c1_baudrate=400000

i2c1 may also be disabled by default I can't remember if so you need
dtparam=i2c_vc=on

In the userland repository there is also a direct header and library
bcm2835: C library for Broadcom BCM 2835 as used in Raspberry Pi[^]
and a forum
bcm2835 : Google Groups[^]
Standard use
#include <bcm2835.h>  

int main(int argc, char **argv)  
{  
    char buf[1];

    if (!bcm2835_init())return 1;  
    bcm2835_i2c_begin();                //Start I2C operations.
    bcm2835_i2c_setSlaveAddress(0x20);  //I2C address
    bcm2835_i2c_set_baudrate(10000);    //1M baudrate

    while(1)  
    {   
        buf[0] = 0xEF;    //LED ON
        bcm2835_i2c_write(buf,1);
        bcm2835_delay(500);
        buf[0] = 0xFF;     //LED OFF
        bcm2835_i2c_write(buf,1);
        bcm2835_delay(500); 
    }    
    bcm2835_i2c_end();  
    bcm2835_close();  
    return 0;  
} 

In vino veritas


modified 26-Mar-18 23:06pm.

GeneralRe: Linux C++ implementation of ioctl Pin
Vaclav_4-Apr-18 5:08
Vaclav_4-Apr-18 5:08 
QuestionVS2017: Cannot debug Dll's Pin
indrekm23-Mar-18 1:13
indrekm23-Mar-18 1:13 
SuggestionRe: VS2017: Cannot debug Dll's Pin
Richard MacCutchan23-Mar-18 1:21
mveRichard MacCutchan23-Mar-18 1:21 
SuggestionRe: VS2017: Cannot debug Dll's Pin
Jochen Arndt23-Mar-18 1:25
professionalJochen Arndt23-Mar-18 1:25 
AnswerRe: VS2017: Cannot debug Dll's Pin
Randor 23-Mar-18 8:09
professional Randor 23-Mar-18 8:09 
QuestionSelect and Pick lines in OpenGL Pin
Gopi Nath22-Mar-18 19:40
Gopi Nath22-Mar-18 19:40 
AnswerRe: Select and Pick lines in OpenGL Pin
leon de boer22-Mar-18 20:30
leon de boer22-Mar-18 20:30 
GeneralRe: Select and Pick lines in OpenGL Pin
Gopi Nath22-Mar-18 21:08
Gopi Nath22-Mar-18 21:08 
GeneralRe: Select and Pick lines in OpenGL Pin
Gopi Nath24-Jul-18 21:17
Gopi Nath24-Jul-18 21:17 
QuestionNotifiation Messages for CSpinButtonCtrl in MFC Pin
Sampath57922-Mar-18 3:46
Sampath57922-Mar-18 3:46 
AnswerRe: Notifiation Messages for CSpinButtonCtrl in MFC Pin
Jochen Arndt22-Mar-18 4:32
professionalJochen Arndt22-Mar-18 4:32 
GeneralRe: Notifiation Messages for CSpinButtonCtrl in MFC Pin
Sampath57922-Mar-18 7:31
Sampath57922-Mar-18 7:31 
GeneralRe: Notifiation Messages for CSpinButtonCtrl in MFC Pin
Victor Nijegorodov22-Mar-18 8:37
Victor Nijegorodov22-Mar-18 8:37 
GeneralRe: Notifiation Messages for CSpinButtonCtrl in MFC Pin
Sampath57922-Mar-18 17:10
Sampath57922-Mar-18 17:10 
GeneralRe: Notifiation Messages for CSpinButtonCtrl in MFC Pin
Victor Nijegorodov22-Mar-18 21:45
Victor Nijegorodov22-Mar-18 21:45 
GeneralRe: Notifiation Messages for CSpinButtonCtrl in MFC Pin
Jochen Arndt22-Mar-18 9:46
professionalJochen Arndt22-Mar-18 9:46 
GeneralRe: Notifiation Messages for CSpinButtonCtrl in MFC Pin
Sampath57922-Mar-18 17:17
Sampath57922-Mar-18 17:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.