C3 and I forgot...
Rsadeika
Posts: 3,837
how to code in C. Below the program blinks the LED but I do not get the - printf("Starting blinky\n"); to show on the terminal screen. I am working in project view. When I remove the 'auto sd_mount' stuff, then I get "Starting blinky" on the terminal screen, in all memory modes. Must be something really dumb that I am doing.
Thanks
Ray
Thanks
Ray
/** * scratch1.c */ #include <stdio.h> #include <propeller.h> /* Auto sd_mount of SD. */ extern _Driver _NullDriver; extern _Driver _FileDriver; _Driver *_driverlist[] = { &_NullDriver, &_FileDriver, NULL }; void high(int pin) // high function definition { int mask = 1 << pin; // Set up mask OUTA |= mask; // Bitwise OR w/ OUTA & DIRA DIRA |= mask; } void low(int pin) // low function definition { int mask = 1 << pin; // Set up mask OUTA &= ~mask; // Pin output state to low DIRA |= mask; // Pin direction to output } int main(void) { sleep(1); printf("Starting blinky\n"); while(1) { high(23); sleep(1); low(23); sleep(1); } return 0; }
Comments
I remember the C3 SD card is different. It's on a shared SPI bus.....ok, I forgot the details beyond this. Check the C3 docs and in PropGCC are their especial C3 demo programs for some functions?
Ray