There's also a semi-Arduino-like C library I partially worked on described here:
https://www.element14.com/community/community/designcenter/single-board-computers/next-genbeaglebone/blog/2019/08/15/beaglebone-black-bbb-io-gpio-spi-and-i2c-library-for-c-2019-edition
.. that was tested in the latter half of 2019, on BBB and PocketBeagle. Turning 
a pin on/off in C is like this:

Setup:
#include <iobb.h>
iolib_init();  // initialize the library
iolib_setdir(8, 12, DigitalOut);  // set the pin as an output

And then controlling a pin connected to a relay board or whatever:

pin_high(8, 12);
pin_low(8,12);

where the '8' represents the connector P8, and the '12' represents pin 12 on 
that connector.

It's not pretty code, it's quite ropey, but it worked in the limited tests I've 
used it for, and it supports I2C and SPI too. Plus it's fast, toggle speed is > 
2MHz.

I started trying to port it to BB-AI, but have put it on pause for now, so many 
register differences : (


________________________________
From: [email protected] <[email protected]> on behalf of 
jonnymo <[email protected]>
Sent: 08 April 2020 01:47
To: Beagle Board <[email protected]>
Subject: Re: [beagleboard] Re: 4 Relay relay Cape 'c' code

Ken,

   Sorry I do not have a Relay board, but I have done the shell scripting thing 
before.

Are you using a BB Black?

I am curious as to what Seth/Mala comes up with though.


Cheers,

Jon

On Tue, Apr 7, 2020 at 3:41 PM KenUnix 
<[email protected]<mailto:[email protected]>> wrote:
 Jon,

Thanks I will look at them.

Did you see that script I uploaded? Give it a try.

Ken


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/31b186a4-a24e-4ff3-99a8-762ba3c7791a%40googlegroups.com<https://groups.google.com/d/msgid/beagleboard/31b186a4-a24e-4ff3-99a8-762ba3c7791a%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAG99bkrt_RnDAm%3Drbj3kjs3SEqZXKmeCSXF8AQi9TXDkptERQw%40mail.gmail.com<https://groups.google.com/d/msgid/beagleboard/CAG99bkrt_RnDAm%3Drbj3kjs3SEqZXKmeCSXF8AQi9TXDkptERQw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/DB6P18901MB0214F919F37015C6F99C7C9984C00%40DB6P18901MB0214.EURP189.PROD.OUTLOOK.COM.

Reply via email to