So, dropped it in and it runs which I am seeing as a small victory.
Unfortunately saying...
"Bela: Couldn't find touch controller"
sensor lights are on and 99.9% all connections are good so just checking through.
Thanks again
So, dropped it in and it runs which I am seeing as a small victory.
Unfortunately saying...
"Bela: Couldn't find touch controller"
sensor lights are on and 99.9% all connections are good so just checking through.
Thanks again
Can you show your wiring? Also, that assumes that the device is using its default address of 0x48. Also, with the sensor connected run in the console at the bottom of the IDE:
i2cdetect -y -r 1
and show the result here
Cool thanks so much. OK two pics. I think it's using the default address.
ok I amended the repo, get the updated version and try again.
That works.... Amazing thanks so much. So now I just need to figure out how to send it out via OSC to SC. What's the best approach there?
OK I updated the repo so that it sends to localhost:1234 an OSC message to address /tsc
containing four integers with the values you were previously seeing printed. For prototyping purposes , you may want it to send to the host computer instead, in which case replace "hostAddress = localhost" with "hostAddres = 192.168.7.1" (or 192.168.6.1, depending on what address your computer has on the point-to-point network with Bela), also adjust the port number to taste.
I can receive this with this simple Pd patch, surely it's easy enough to do in Supercollider as well:
If this works as expected, then use the instructions here https://learn.bela.io/using-bela/bela-techniques/running-a-program-as-a-service/ to run it in the background while you run a proper Bela program on the side.
That's great...thanks.
Something going wrong on my end though.
can you update the code on your Bela to the latest dev
branch and then try again? This is done downloading this archive https://github.com/BelaPlatform/Bela/archive/refs/heads/dev.zip and uploading it on the IDE via the "Update Bela" button in the settings tab as per this image:
Wow you are amazing... looks like it's working. The running as a service looks well documented so will try that later.
Do you have one of those buy me a coffee type things?
Thanks!!
Any program run this way will not be able to access Bela’s audio, analog and digital I/Os while another Bela program is running.
Just a bit confused by this bit. Does that exclude the I2C bus then?
I was just think how cool this is and setting it up this project to read a few analog inputs/switches and then just having SuperCollider receiving OSC and making sound.
Is that possible?
Many thanks Simon
simonb Bela’s audio, analog and digital I/Os
these are all handled by a "Bela program" and there can only be one of these running at any time, which will take control over all of those, processing them at audio sampling rate and with low latency. "digital I/O" here refers to the 16 GPIOs handled directly by the Bela core, which are those highlighted in the pin diagram for your board. This does not include devices connected over other digital busses e.g.: I2C, UART, SPI, which can he handled by any program running on the board. You can still access the GPIOs that are not managed by Bela and are not otherwise used by Bela using the Gpio class and integrating it within this same program. See more details here.
simonb I was just think how cool this is and setting it up this project to read a few analog inputs/switches and then just having SuperCollider receiving OSC and making sound.
If you are processing audio via scsynth, you'll have to process all of those also via scsynth, there are dedicated ugens to do that: AnalogIn, DigitalIn, DigitalOut, DigitalIO. You can then use sendReply()
if you want to send a snapshot of the input values back to sclang.
simonb Do you have one of those buy me a coffee type things?
No thanks, I don't drink coffee. Just tell all your friends about the good experience you've had here.
Amazing thanks !!
Hi @giuliomoro
I am just going through the steps above to make this Library on another Bela board.
Just run into this Error. Any ideas how to fix it? Many thanks
Simon
Building Wire.cpp...
Makefile:510: recipe for target '/root/Bela/projects/Adafruit_TSC2007-Linux-master/build/Wire.o' failed
Build finished
In file Wire.cpp: no member named 'readRaw' in 'I2c' column: 21, line: 78
In file Wire.cpp: no member named 'writeRaw' in 'I2c' column: 14, line: 82
In file Wire.cpp: no member named 'readRaw' in 'I2c' column: 20, line: 92
/root/Bela/projects/Adafruit_TSC2007-Linux-master/Wire.cpp:78:21: error: no member named 'readRaw' in 'I2c'
int ret = master->readRaw(address, (i2c_char_t*)buf, 1, !stopBit);
/root/Bela/projects/Adafruit_TSC2007-Linux-master/Wire.cpp:82:14: error: no member named 'writeRaw' in 'I2c'
if (master->writeRaw(_address, (i2c_char_t *) txBuffer, usedTxBuffer, !stopBit) == usedTxBuffer) return 0;
~~~~~~ ^
/root/Bela/projects/Adafruit_TSC2007-Linux-master/Wire.cpp:92:20: error: no member named 'readRaw' in 'I2c'
int ret = master->readRaw(address, buf, len, !stopBit) == len ? 0 : -1;
~~~~~~ ^
3 errors generated.
make: *** [/root/Bela/projects/Adafruit_TSC2007-Linux-master/build/Wire.o] Error 1
`
`
You need to udpate the Bela core code to the dev
branch on the board where you build this.
Thanks!
I am back on this on a OG Bela not mini. Updated to this.
Version details
Image:
v0.3.8h, 5 January 2023
Core code:
Last updated on '2 Oct 2024 23:02:48 '
from file 'Bela-dev'
via 'update_board'
Update was successful
Git desc: 'e43b8abe-dirty'
Downloaded the the Adafruit_TSC2007-Linux-master from above. Wired up everything correctly but now I get the same message as above.
Build finished
Running project ...
Successful to do ioctl for 1 bytes on I2C at addr 72 with flags 1: 1
Couldn't find touch controller
Then tried this.
i2cdetect -y -r 1
And get this.
'
0 1 2 3 4 5 6 7 8 9 a b c d e f
00:
--
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
'
Any ideas what to try next?
Thank you.
Best wishes
Simon
Using this library
https://github.com/giuliomoro/Adafruit_TSC2007-Linux
I don't know why that doesn't work. I suspect that this may fix it, can you try?
diff --git a/Wire.cpp b/Wire.cpp
index b64bae7..3d9e1f2 100644
--- a/Wire.cpp
+++ b/Wire.cpp
@@ -76,7 +76,9 @@ uint8_t arduino::MbedI2C::endTransmission(bool stopBit) {
// we are scanning, return 0 if the addresed device responds with an ACK
char buf[1];
int ret = master->readRaw(_address, (i2c_char_t*)buf, 1, !stopBit);
- return ret;
+ if(1 == ret)
+ return 0;
+ else return -1;
}
#endif
if (master->writeRaw(_address, (i2c_char_t *) txBuffer, usedTxBuffer, !stopBit) == usedTxBuffer) return 0;
Thanks will try when I have a bit more time on it.