!Qwert 0 Posted October 16, 2014 Share Posted October 16, 2014 I found an adaptation of a cap-sense sketch that uses port manipulation to create a capacitive sensor for Arduino to a MSP430. My question is that when I was using the sketch and adjusting it to use a tm4C123 device, I got these errors: TouchSensor.ino: In function 'uint8_t readCapacitivePin(int)': TouchSensor.ino:58:24: error: 'P1OUT' was not declared in this scope TouchSensor.ino:59:23: error: 'P1DIR' was not declared in this scope TouchSensor.ino:61:23: error: 'P1IN' was not declared in this scope I looked into this and found out on this post: http://forum.43oh.com/topic/5166-need-advice-porting-arduino-code-to-energia/ That this is using peripheral names on the MSP430 regarding registers P1DIR - to set directionP1OUT - to set an output bit P1IN - to read an input bit I remembered that wiring.c defined the port, pin and ddr. And if I commented out port = (uint8_t*) &P1OUT; ddr = (uint8_t*) &P1DIR; bitmask = 1 << pinToMeasure; pin = (uint8_t*) &P1IN; It would compile but I feel I am missing something My problem is that I was looking into how to change the peripheral names for tm4c123 instead of the MSP430 so I can use the sketch on my tm4c123. Here is the link to the sketch: https://gist.github.com/thecodemaiden/6040927 Quote Link to post Share on other sites
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.