A program to measure the temperature using the Max6675 board. The temperature is shown on 8x8 Max7219 matrix display and it is saved on SD as well.
Dependencies: MAX7219 SDFileSystem mbed
Fork of MAXREFDES99_demo by
The program measures the temperature using the Max6675 board designed for Arduino. The temperature is shown on Max7219 8x8 matrix display (designed for Arduino as well) as text marque from right to left. The fonf size is 5x7 so the last row is used to show some info:
- All leds off: Normal temperature measuring - Leds shifting: Saving on SD card - Leds blinking: SD card missing or damaged
The Blue "user button" is used to save measured temperature on SD card. First click start saving, the second stop the process. Together the temperature is saved also the time. The time is reset when the process start. Connecting the USB to PC it's possible to see instant temperature and all saved data on SD.
Diff: main.cpp
- Revision:
- 6:00aabe967e51
- Parent:
- 3:41bdbc9b3cec
- Child:
- 7:4b81ed6da6ab
--- a/main.cpp Mon Apr 11 16:19:13 2016 +0000 +++ b/main.cpp Wed Apr 27 10:27:34 2016 +0000 @@ -68,8 +68,12 @@ { case 1: - - user_font = get_user_input("\nPlease enter 0 to use 5x7 font or 1 to use 16x16 font: ", 1); + printf("\n 0: For 5x7 font"); + printf("\n 1: For 16x16 Aerial bold font"); + printf("\n 2: For 16x16 Manual font"); + user_font = get_user_input("\nPlease select font: ", 2); + if(user_font == 0) + printf("\nNote:Position option works only for 5x7 font\n"); break; case 2: @@ -96,8 +100,8 @@ if(user_font==0) print_char(&display, user_input, user_char); - else if(user_font==1) - print_char_16x16(&display, 0, user_char); + else if(user_font>=1) + print_char_16x16(&display, 0, user_char,user_font); //make sure is good for next loop user_input = 0; @@ -107,14 +111,14 @@ case 4: if(user_font==0) - user_input = get_user_input("\nPlease enter which position, 1 to 32: ", 32); + user_input = get_user_input("\nPlease enter which position 1 to 32: ", 32); p_str = get_user_string("\nPlease enter a string less than 24 characters: "); if(user_font==0) print_string(&display, user_input, p_str); - else if(user_font==1) - print_string_16x16(&display,p_str); + else if(user_font>=1) + print_string_16x16(&display,p_str,user_font); //make sure is good for next loop user_input = 0; @@ -125,7 +129,7 @@ if(user_font==0) user_input = get_user_input("\nPlease enter number of shifts, 1 to 32: ", 32); - else if(user_font==1) + else if(user_font>=1) user_input = get_user_input("\nPlease enter number of shifts, 1 to 96: ", 96); shift_right = get_user_input("\nWhich direction? 0 for left, 1 for right: ", 1); @@ -135,7 +139,7 @@ printf("\nShifting Display Right %d positions\n", user_input); if(user_font==0) shift_display_right(&display, user_input, 100); - else if(user_font==1) + else if(user_font>=1) shift_display_right_16x16(&display, user_input, 100); } else @@ -143,7 +147,7 @@ printf("\nShifting Display Left %d positions\n", user_input); if(user_font==0) shift_display_left(&display, user_input, 100); - else if(user_font==1) + else if(user_font>=1) shift_display_left_16x16(&display, user_input, 100); } @@ -160,9 +164,9 @@ printf("\nRunning Demo\n"); if(user_font==0) - demo(&display, display_config, false); - else if(user_font==1) - demo_16x16(&display, display_config, false); + demo(&display, display_config, false); + else if(user_font>=1) + demo_16x16(&display, display_config, user_font,false); break; @@ -171,9 +175,9 @@ //blocking case, endless loop shift_right = get_user_input("\nWhich direction? 0 for left, 1 for right: ", 1); if(user_font==0) - endless_scroll_display(&display, shift_right); - else if(user_font==1) - endless_scroll_display_16x16(&display, shift_right); + endless_scroll_display(&display, shift_right); + else if(user_font>=1) + endless_scroll_display_16x16(&display, shift_right); break; @@ -186,7 +190,6 @@ break; } } - return 0; }