Arduino Sketch


 

Jay H

TVWBB Member
When I ordered a level shifter I also picked up an Adafruit Pro Trinket 3V. I hoped to shrink things down from the Uno I was testing with and avoid the level shifting, but foolish me didn't register that it was 12MHz for the 3V model. And I didn't realize until after I flashed the Trinket with the code, and the bootloader. So I went looking in the repository expecting to find an .ino to recompile for the Pro Trinket, and apparently my Arduino kung fu is severely lacking as well, what the heck am I looking at in there? Sorry for the noob question. I also think I'm probably boned because I flashed the bootloader, not sure if clock speed is a factor there, but I assume it is.
 
That's all greek to me. I was just expecting to find a sketch I could upload via the IDE, not quite that simple.
 
A bit of reading I managed to run make, but it's erroring:

exceptions grillpid.cpp -o build-cli/grillpid.o
grillpid.cpp:9:30: error: digitalWriteFast.h: No such file or directory
grillpid.cpp: In function 'void __vector_10()':
grillpid.cpp:30: error: 'digitalWriteFast' was not declared in this scope
grillpid.cpp: In function 'void __vector_12()':
grillpid.cpp:46: error: 'digitalWriteFast' was not declared in this scope
grillpid.cpp: In member function 'void GrillPid::init()':
grillpid.cpp:418: error: 'pinModeFast' was not declared in this scope
make: *** [build-cli/grillpid.o] Error 1

The digitalWriteFast folder is in the libraries directory, and it seems to have used the other dependencies.
 
The makefile needed digitalWriteFast and jeelib added to this line:

ARDUINO_LIBS := ShiftRegLCD rf12_itplus

ARDUINO_LIBS := ShiftRegLCD rf12_itplus digitalWriteFast jeelib

After the change, It ran, I got a hex file, and uploaded it to the Trinket. Now the Pi is unresponsive even after a reboot. I'm not even sure if I was supposed to use the hex file output or do something different. Looks like I'm going to have to reflash the Pi.
 
I'm stumped, now the Pi is unresponsive when the SPI connection to the Trinket is hooked up, and with just the serial connection it doesn't think its getting data.
 
The makefile needed digitalWriteFast and jeelib added to this line:

ARDUINO_LIBS := ShiftRegLCD rf12_itplus

ARDUINO_LIBS := ShiftRegLCD rf12_itplus digitalWriteFast jeelib
Thanks, I'll update the Makefile. I haven't used the makefile in years though, and there is a heatermeter.ino so I'm not sure why you're having a problem finding an ino file to load into the IDE. The Makefile version compiles for a 16MHz CPU too. I'd just load it in the Arduino IDE and make sure you have the right board selected there.
 
I didn't realize the sketch would open the dependencies as well. Now I just need to unbrick the Trinket bootloader.
 
I was able to reflash the bootloader and load the sketch from the IDE with the correct board selected. It doesn't show connected with just TX and RX hooked up, and it reboots and hoses the file system when SPI connected. In this case no probes ever even make it into the mix. I'm giving up on this route since I can't figure my Uno problem out either.

https://tvwbb.com/showthread.php?70096-Raspberry-Pi-Zero-W-Arduino-Uno

I'd say they were related somehow, but I can't figure how with the number of variables I've eliminated.
 

 

Back
Top