Hello, I'm creating a project using the 1Sheeld for a school project.
It consists of a brake light for bicycles, which has also to serve as turn signals and also detect when the user fall, and call for help by casting his GPS coordinate to one of his contacts.
I'm using a 1Sheeld card combined with an Arduino UNO card, and also a 32×32 matrix led for the turn signal and the brake light.
First, I got some problem with the libraries of the 1Sheeld, because it was giving me an error message when I tried to compile my code. I asked ChatGPT and I think I solved the error by changing a bit of code.
Any way, now I'm just trying to test the 1Sheeld by running a code that turn on a LED when I press a letter on the keyboard of the 1Sheeld, but the LED just don't turn on. So I tried with a simple push button on the app, and it turns on the LED. SO it's not a material problem. (Also here's the code, I took it from an example from Arduino)
#define CUSTOM_SETTINGS
#define INCLUDE_KEYBOARD_SHIELD
/* Include 1Sheeld library. */
#include <OneSheeld.h>
/* LED on pin 13. */
int ledPin = 13;
void setup()
{
/* Start communication. */
OneSheeld.begin();
/* Set the LED as output. */
pinMode(ledPin,OUTPUT);
/* Keyboard callBack function. */
AsciiKeyboard.setOnButtonChange(&keyboardFunction);
Serial.begin(9600);
}
void loop()
{}
/* Function to be invoked once a new character is pressed. */
void keyboardFunction(char data)
{
/* Check on the incoming character. */
if(data == 'A')
{
/* Turn on the LED. */
digitalWrite(ledPin,HIGH);
}
else
{
/* Turn off the LED.*/
digitalWrite(ledPin,LOW);
}
}
sorry for the late answer, so I tried with differents output, but it didn't work either. I took the program from the examples included with the Arduino, so I don't think this is the issue.
Also it isn't a material problem, because as I said, the led can turn on even with the push button on the 1Sheeld App. This might be an library issue, but I don't get any error message anymore.
Hello, i was using 1sheeld too, i did the exact same things as you did, i tried to do tests with LEDs, and it worked, but that was some months ago, after that i made it so i could control a motor, but then everything stopped working recently, like a month ago. I tried to do LED tests again but they didn't work, i made sure that it wasn't any material problems but it isn't, the code worked before too. Your code structure is the same as mine too, so i can say that there shouldn't be any errors, have you tried opening the console with windows+shift+m? personally i get a bunch of question marks after i leave the program running for like, 3 seconds. I tried a bunch of projects that could control LEDs (properly) and used them recently with the same program, then i recompiled (they were old), on the same program, and it stopped working, i do not see any specific reasons but the 1sheeld board do react when i press buttons (not the actual LED though).
edit: found the problem, it's the switch on your 1sheeld board, switch to SW, transfer your program, wait a bit, then switch it to HW, it should work (use this for your keyboard program). Tell me if it worked for you.