sron
Posts: 24
Joined: Mon Apr 20, 2015 9:11 am

Detect Pi model from c code

Mon Jan 01, 2018 12:12 pm

There is a way to detect the pi model from c code?

I know I can use 'uname -a' but i would like to know if is the best way.

specifically, i need to detect between Pi3 and PiZero

Thanks

sparkie777
Posts: 118
Joined: Tue Nov 27, 2012 4:37 am

Re: Detect Pi model from c code

Mon Jan 01, 2018 12:23 pm

just read '/proc/device-tree/model' and you are done

sron
Posts: 24
Joined: Mon Apr 20, 2015 9:11 am

Re: Detect Pi model from c code

Mon Jan 01, 2018 1:35 pm

Working

Thanks :)

Return to “Advanced users”

Who is online

Users browsing this forum: No registered users and 20 guests